From 438a2e2a2f1bd0c4a9df52a13e6c8b0dada8e2de Mon Sep 17 00:00:00 2001 From: Tiago Ferreira Date: Sat, 14 Sep 2024 09:09:25 -0400 Subject: [PATCH] Color mapping of paths: disable non-applicable option in GUI prompts --- .../java/sc/fiji/snt/analysis/SkeletonConverter.java | 4 ++-- src/main/java/sc/fiji/snt/gui/cmds/FigCreatorCmd.java | 9 +++++++++ src/main/java/sc/fiji/snt/plugin/TreeMapperCmd.java | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/sc/fiji/snt/analysis/SkeletonConverter.java b/src/main/java/sc/fiji/snt/analysis/SkeletonConverter.java index 351c840d..f3bd4a49 100644 --- a/src/main/java/sc/fiji/snt/analysis/SkeletonConverter.java +++ b/src/main/java/sc/fiji/snt/analysis/SkeletonConverter.java @@ -690,8 +690,8 @@ public void setMaxConnectDist(double maxConnectDist) { private void assignToImage(final Tree tree) { final String fProp = imp.getProp("extracted-frame"); final String cProp = imp.getProp("extracted-channel"); - final int f = (fProp == null) ? 1 : Integer.valueOf(fProp); - final int c = (cProp == null) ? 1 : Integer.valueOf(cProp); + final int f = (fProp == null) ? 1 : Integer.parseInt(fProp); + final int c = (cProp == null) ? 1 : Integer.parseInt(cProp); tree.list().forEach(path -> path.setCTposition(c, f)); tree.assignImage(imp); } diff --git a/src/main/java/sc/fiji/snt/gui/cmds/FigCreatorCmd.java b/src/main/java/sc/fiji/snt/gui/cmds/FigCreatorCmd.java index 68a8da43..f5420436 100644 --- a/src/main/java/sc/fiji/snt/gui/cmds/FigCreatorCmd.java +++ b/src/main/java/sc/fiji/snt/gui/cmds/FigCreatorCmd.java @@ -87,6 +87,9 @@ public class FigCreatorCmd extends CommonDynamicCmd { @Parameter(required = false) boolean noRasterOutput; + @Parameter(required = false) + boolean noGeodesicTransformation; + @SuppressWarnings("unused") private void init() { super.init(false); @@ -107,6 +110,12 @@ private void init() { choices.remove(0); mi.setChoices(choices); } + if (noGeodesicTransformation) { + final MutableModuleItem mi = (MutableModuleItem) getInfo().getInput("uprightRotation", String.class); + final ArrayList choices = new ArrayList<>(mi.getChoices()); + choices.remove(1); + mi.setChoices(choices); + } } diff --git a/src/main/java/sc/fiji/snt/plugin/TreeMapperCmd.java b/src/main/java/sc/fiji/snt/plugin/TreeMapperCmd.java index 85352b35..52d68124 100644 --- a/src/main/java/sc/fiji/snt/plugin/TreeMapperCmd.java +++ b/src/main/java/sc/fiji/snt/plugin/TreeMapperCmd.java @@ -141,6 +141,7 @@ public void run() { inputs.put("trees", trees); inputs.put("mapper", mapper); inputs.put("noRasterOutput", true); + inputs.put("noGeodesicTransformation", onlyConnectivitySafeMetrics); getContext().getService(CommandService.class).run(FigCreatorCmd.class, true, inputs); } SNTUtils.log("Finished...");