From a83e0d62e16dbd8160a916f8f0c6083495aaddd8 Mon Sep 17 00:00:00 2001 From: Michael Doube Date: Wed, 11 Aug 2021 16:06:05 +0800 Subject: [PATCH 1/3] Use consistent UK English spelling of Analyse in the GUI. "zed! thou unnecessary letter!" William Shakespeare, King Lear. --- Legacy/bonej/src/main/resources/plugins.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Legacy/bonej/src/main/resources/plugins.config b/Legacy/bonej/src/main/resources/plugins.config index dbeaf8c38..c1a9159ab 100644 --- a/Legacy/bonej/src/main/resources/plugins.config +++ b/Legacy/bonej/src/main/resources/plugins.config @@ -29,9 +29,9 @@ ### # Author: Michael Doube -Plugins>BoneJ>Analyze, "Calibrate SCANCO", org.bonej.plugins.DensityCalibrator("scanco") -Plugins>BoneJ>Analyze, "Orientation", org.bonej.plugins.Orienteer -Plugins>BoneJ>Analyze, "Particle Analyser", org.bonej.plugins.ParticleCounter +Plugins>BoneJ>Analyse, "Calibrate SCANCO", org.bonej.plugins.DensityCalibrator("scanco") +Plugins>BoneJ>Analyse, "Orientation", org.bonej.plugins.Orienteer +Plugins>BoneJ>Analyse, "Particle Analyser", org.bonej.plugins.ParticleCounter Plugins>BoneJ>Connectivity, "Connectivity", org.bonej.plugins.Connectivity From 05c296b60720a5999fcf0c9acb1dcae4273b94c2 Mon Sep 17 00:00:00 2001 From: Michael Doube Date: Wed, 11 Aug 2021 17:00:55 +0800 Subject: [PATCH 2/3] Update URLs to https://imagej.net/plugins/bonej --- Legacy/bonej/pom.xml | 2 +- Legacy/bonej/src/main/java/org/bonej/plugins/Moments.java | 1 + .../bonej/src/main/java/org/bonej/plugins/ParticleCounter.java | 2 +- Legacy/bonej/src/main/java/org/bonej/plugins/Purify.java | 1 + .../bonej/src/main/java/org/bonej/plugins/ReporterOptions.java | 2 +- Legacy/bonej/src/main/java/org/bonej/plugins/SliceGeometry.java | 2 +- Legacy/bonej/src/main/java/org/bonej/plugins/SphereFitter.java | 1 + Legacy/util/pom.xml | 2 +- Modern/ops/pom.xml | 2 +- Modern/utilities/pom.xml | 2 +- Modern/wrapperPlugins/pom.xml | 2 +- .../bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java | 2 +- README.md | 2 +- pom.xml | 2 +- 14 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Legacy/bonej/pom.xml b/Legacy/bonej/pom.xml index 36022d164..baf5f8607 100644 --- a/Legacy/bonej/pom.xml +++ b/Legacy/bonej/pom.xml @@ -13,7 +13,7 @@ BoneJ legacy plugins Mavenized version of the BoneJ1 plugins - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2015 Royal Veterinary College diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/Moments.java b/Legacy/bonej/src/main/java/org/bonej/plugins/Moments.java index baca362ef..0db07e97c 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/Moments.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/Moments.java @@ -166,6 +166,7 @@ public void run(final String arg) { gd.addCheckbox("Show axes (3D)", true); gd.addCheckbox("Record unit vectors", false); gd.addDialogListener(this); + gd.addHelp("https://imagej.net/plugins/bonej#moments-of-inertia"); gd.showDialog(); if (gd.wasCanceled()) { return; diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/ParticleCounter.java b/Legacy/bonej/src/main/java/org/bonej/plugins/ParticleCounter.java index f0b9fe84b..027ef7401 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/ParticleCounter.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/ParticleCounter.java @@ -194,7 +194,7 @@ public void run(final String arg) { gd.addChoice("Surface colours", items, items[0]); gd.addNumericField("Split value", 0, 3, 7, units + "³"); gd.addNumericField("Volume_resampling", 2, 0); - gd.addHelp("https://imagej.github.io/plugins/bonej#particle-analyser"); + gd.addHelp("https://imagej.net/plugins/bonej#particle-analyser"); gd.addDialogListener(this); gd.showDialog(); if (gd.wasCanceled()) { diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/Purify.java b/Legacy/bonej/src/main/java/org/bonej/plugins/Purify.java index 23a08e8b1..3f68ab1f0 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/Purify.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/Purify.java @@ -99,6 +99,7 @@ public void run(final String arg) { final GenericDialog gd = new GenericDialog("Setup"); gd.addCheckbox("Performance Log", false); gd.addCheckbox("Make_copy", true); + gd.addHelp("https://imagej.net/plugins/bonej#purify"); gd.showDialog(); if (gd.wasCanceled()) return; final boolean showPerformance = gd.getNextBoolean(); diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/ReporterOptions.java b/Legacy/bonej/src/main/java/org/bonej/plugins/ReporterOptions.java index 0453bdad4..60420ab7b 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/ReporterOptions.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/ReporterOptions.java @@ -78,7 +78,7 @@ public void run(final String arg) { "and promote BoneJ to funders."); dialog.addMessage("If you agree to participate please hit OK\n" + "otherwise, cancel. For more information click Help."); - dialog.addHelp("https://imagej.github.io/plugins/bonej#usage-reporting"); + dialog.addHelp("https://imagej.net/plugins/bonej#usage-reporting"); dialog.showDialog(); if (dialog.wasCanceled()) { Prefs.set(OPTOUTKEY, false); diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/SliceGeometry.java b/Legacy/bonej/src/main/java/org/bonej/plugins/SliceGeometry.java index d83f386d8..1d5d8ff3a 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/SliceGeometry.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/SliceGeometry.java @@ -274,7 +274,7 @@ else if (roi.getType() != Roi.RECTANGLE) { gd.addCheckbox("Partial_volume_compensation", false); gd.addNumericField("Background", thresholds[0], 1, 6, pixUnits + " "); gd.addNumericField("Foreground", thresholds[1], 1, 6, pixUnits + " "); - gd.addHelp("https://imagej.github.io/plugins/bonej#slice-geometry"); + gd.addHelp("https://imagej.net/plugins/bonej#slice-geometry"); gd.addDialogListener(this); gd.showDialog(); final String bone = gd.getNextChoice(); diff --git a/Legacy/bonej/src/main/java/org/bonej/plugins/SphereFitter.java b/Legacy/bonej/src/main/java/org/bonej/plugins/SphereFitter.java index 40ccc3a7a..214489336 100644 --- a/Legacy/bonej/src/main/java/org/bonej/plugins/SphereFitter.java +++ b/Legacy/bonej/src/main/java/org/bonej/plugins/SphereFitter.java @@ -128,6 +128,7 @@ public void run(final String arg) { gd.addCheckbox("Add_to_ROI_Manager", false); gd.addCheckbox("Clear_ROI_Manager", false); gd.addDialogListener(this); + gd.addHelp("https://imagej.net/plugins/bonej#fit-sphere"); gd.showDialog(); if (gd.wasCanceled()) { return; diff --git a/Legacy/util/pom.xml b/Legacy/util/pom.xml index 81790e5d4..b1ef8341b 100644 --- a/Legacy/util/pom.xml +++ b/Legacy/util/pom.xml @@ -13,7 +13,7 @@ BoneJ legacy utilities Utility classes for BoneJ1 plugins - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2015 Royal Veterinary College diff --git a/Modern/ops/pom.xml b/Modern/ops/pom.xml index f64840b00..b343d9778 100644 --- a/Modern/ops/pom.xml +++ b/Modern/ops/pom.xml @@ -13,7 +13,7 @@ BoneJ2 Ops Ops created for BoneJ2 - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2015 Royal Veterinary College diff --git a/Modern/utilities/pom.xml b/Modern/utilities/pom.xml index 358a4c2fc..a67c764ac 100644 --- a/Modern/utilities/pom.xml +++ b/Modern/utilities/pom.xml @@ -13,7 +13,7 @@ BoneJ2 utilities Utility methods for BoneJ2 - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2015 Royal Veterinary College diff --git a/Modern/wrapperPlugins/pom.xml b/Modern/wrapperPlugins/pom.xml index cb3b2c222..1bb4a6781 100644 --- a/Modern/wrapperPlugins/pom.xml +++ b/Modern/wrapperPlugins/pom.xml @@ -16,7 +16,7 @@ The Domain Presentation Layer (DPL) of BoneJ2, i.e. the commands that wrap the needed ops, and present results for skeletal biologists. - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2015 Royal Veterinary College diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java index 75bada01a..eecff8f85 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java @@ -149,7 +149,7 @@ public void run() { @SuppressWarnings("unused") private void showHelpPage() { try { - platformService.open(new URL("https://imagej.github.io/plugins/bonej#usage-reporting")); + platformService.open(new URL("https://imagej.net/plugins/bonej#usage-reporting")); } catch (final IOException e) { uiService.showDialog("Something went wrong while opening the help page. Please try again."); logService.trace(e); diff --git a/README.md b/README.md index 5b913f3a0..fc4dc841e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ BoneJ is a collection of Fiji/ImageJ plug-ins for skeletal biology. It provides > doi:[10.12688/wellcomeopenres.16619.1](https://doi.org/10.12688/wellcomeopenres.16619.1) ## Links -* [User guide](https://imagej.github.io/plugins/bonej) +* [User guide](https://imagej.net/plugins/bonej) * [ImageJ forum](https://forum.image.sc/tags/bonej) * [Developer documentation](https://github.com/bonej-org/BoneJ2/wiki) diff --git a/pom.xml b/pom.xml index aadd31b75..cc5cd6a54 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ BoneJ Parent POM Parent POM for BoneJ components - https://imagej.github.io/plugins/bonej + https://imagej.net/plugins/bonej 2016 Royal Veterinary College From f2a42d0a13ab94c2779ff54103d40981da07feae Mon Sep 17 00:00:00 2001 From: Michael Doube Date: Thu, 12 Aug 2021 16:39:27 +0800 Subject: [PATCH 3/3] Add Help buttons to plugins' setup dialogs Help buttons resolve to https://imagej.net/plugins/bonej#plugin-name. Users can click on the Help button to go straight to the user documentation for that feature. --- .../AnalyseSkeletonWrapper.java | 16 ++++++++++++- .../wrapperPlugins/AnisotropyWrapper.java | 13 ++++++++++ .../EllipsoidFactorWrapper.java | 13 +++++++++- .../FractalDimensionWrapper.java | 20 ++++++++++++++++ .../IntertrabecularAngleWrapper.java | 15 ++++++++++++ .../wrapperPlugins/SurfaceAreaWrapper.java | 12 ++++++++++ .../wrapperPlugins/ThicknessWrapper.java | 15 ++++++++++++ .../wrapperPlugins/wrapperUtils/Common.java | 24 +++++++++++++++++++ .../wrapperUtils/UsageReporterOptions.java | 7 +----- 9 files changed, 127 insertions(+), 8 deletions(-) diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnalyseSkeletonWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnalyseSkeletonWrapper.java index 5dbb097aa..f7ed1556c 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnalyseSkeletonWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnalyseSkeletonWrapper.java @@ -80,6 +80,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.bonej.utilities.AxisUtils; import org.bonej.utilities.ImagePlusUtil; import org.bonej.utilities.SharedTable; +import org.bonej.wrapperPlugins.wrapperUtils.Common; import org.scijava.ItemIO; import org.scijava.ItemVisibility; import org.scijava.app.StatusService; @@ -88,6 +89,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.io.IOService; import org.scijava.io.location.FileLocation; import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.table.DefaultGenericTable; @@ -95,6 +97,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.table.IntColumn; import org.scijava.table.PrimitiveColumn; import org.scijava.ui.UIService; +import org.scijava.widget.Button; import org.scijava.widget.ChoiceWidget; import org.scijava.widget.FileWidget; @@ -150,6 +153,9 @@ public class AnalyseSkeletonWrapper extends BoneJCommand { description = "Show skeleton images labelled with their IDs", required = false) private boolean displaySkeletons; + + @Parameter(label = "Help", description = "More about Analyse Skeleton", callback = "showHelpPage") + private Button button; /** * Additional analysis details in a {@link DefaultGenericTable}, null if @@ -189,7 +195,10 @@ public class AnalyseSkeletonWrapper extends BoneJCommand { @Parameter private StatusService statusService; - + + @Parameter + private PlatformService platformService; + private ImagePlus intensityImage; @Override @@ -231,6 +240,11 @@ public void run() { } reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#analyse-skeleton", platformService, uiService, logService); + } private boolean hasNoSkeletons(final AnalyzeSkeleton_ analyzeSkeleton_) { final Graph[] graphs = analyzeSkeleton_.getGraphs(); diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnisotropyWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnisotropyWrapper.java index eb660cb84..af365e71f 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnisotropyWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/AnisotropyWrapper.java @@ -100,6 +100,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.bonej.utilities.ElementUtil; import org.bonej.utilities.SharedTable; import org.bonej.utilities.Visualiser; +import org.bonej.wrapperPlugins.wrapperUtils.Common; import org.bonej.wrapperPlugins.wrapperUtils.HyperstackUtils.Subspace; import org.joml.Matrix3d; import org.joml.Matrix4d; @@ -112,10 +113,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.app.StatusService; import org.scijava.command.Command; import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.ui.DialogPrompt.Result; import org.scijava.ui.UIService; +import org.scijava.widget.Button; import org.scijava.widget.NumberWidget; /** @@ -194,6 +197,9 @@ public class AnisotropyWrapper & NativeType> extends Bo description = "Show the vectors of the mean intercept lengths", required = false) private boolean displayMILVectors; + + @Parameter(label = "Help", description = "More about Anisotropy", callback = "showHelpPage") + private Button button; @Parameter private LogService logService; @@ -205,6 +211,8 @@ public class AnisotropyWrapper & NativeType> extends Bo private UIService uiService; @Parameter private UnitService unitService; + @Parameter + private PlatformService platformService; private static BinaryHybridCFI1 rotateOp; private double milLength; @@ -229,6 +237,11 @@ public void run() { resultsTable = SharedTable.getTable(); reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#anisotropy", platformService, uiService, logService); + } // region -- Helper methods -- private void calculateMILLength(final RandomAccessibleInterval interval) { diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/EllipsoidFactorWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/EllipsoidFactorWrapper.java index 5e7711ea1..4cf4cb85a 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/EllipsoidFactorWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/EllipsoidFactorWrapper.java @@ -118,9 +118,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.app.StatusService; import org.scijava.command.Command; import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.ui.UIService; +import org.scijava.widget.Button; import sc.fiji.skeletonize3D.Skeletonize3D_; @@ -166,6 +168,8 @@ public class EllipsoidFactorWrapper extends BoneJCommand { @SuppressWarnings("unused") @Parameter private UnitService unitService; + @Parameter + private PlatformService platformService; //main input image @SuppressWarnings("unused") @Parameter(validater = "validateImage") @@ -213,7 +217,9 @@ public class EllipsoidFactorWrapper extends BoneJCommand { private List ellipsoidFactorOutputImages; @Parameter(label = "Seed Points", type = ItemIO.OUTPUT) private ImgPlus seedPointImage;// 0=not a seed, 1=medial seed - + @Parameter(label = "Help", description = "More about Ellipsoid Factor", callback = "showHelpPage") + private Button button; + private ImgPlus inputAsBitType; @Override @@ -341,6 +347,11 @@ public void run() { statusService.showStatus("Ellipsoid Factor completed"); reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#ellipsoid-factor", platformService, uiService, logService); + } private List divideOutput(final List outputList, final int repetitions) { final List divided = new ArrayList<>(); diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/FractalDimensionWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/FractalDimensionWrapper.java index 4ae8283ae..ccb5cb37a 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/FractalDimensionWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/FractalDimensionWrapper.java @@ -81,15 +81,20 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.apache.commons.math3.stat.regression.SimpleRegression; import org.bonej.utilities.ElementUtil; import org.bonej.utilities.SharedTable; +import org.bonej.wrapperPlugins.wrapperUtils.Common; import org.bonej.wrapperPlugins.wrapperUtils.HyperstackUtils.Subspace; import org.scijava.ItemIO; import org.scijava.app.StatusService; import org.scijava.command.Command; +import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.table.DefaultGenericTable; import org.scijava.table.DoubleColumn; import org.scijava.table.GenericTable; +import org.scijava.ui.UIService; +import org.scijava.widget.Button; import org.scijava.widget.NumberWidget; /** @@ -147,6 +152,9 @@ public class FractalDimensionWrapper & NativeType> exte @Parameter(label = "Show points", description = "Show (log(size), -log(count)) points", required = false) private boolean showPoints; + + @Parameter(label = "Help", description = "More about Fractal Dimension", callback = "showHelpPage") + private Button button; /** * Table containing the (-log(size), log(count)) points for each 3D subspace @@ -158,6 +166,12 @@ public class FractalDimensionWrapper & NativeType> exte private OpService opService; @Parameter private StatusService statusService; + @Parameter + private LogService logService; + @Parameter + private UIService uiService; + @Parameter + private PlatformService platformService; private BinaryHybridCF, Boolean, RandomAccessibleInterval> hollowOp; private UnaryFunctionOp, List>> boxCountOp; @@ -194,6 +208,12 @@ public void run() { resultsTable = SharedTable.getTable(); reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#fractal-dimension", platformService, uiService, logService); + } + // region -- Helper methods -- private void writePoints(final String headerSuffix, diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/IntertrabecularAngleWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/IntertrabecularAngleWrapper.java index e366b5976..950e07eea 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/IntertrabecularAngleWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/IntertrabecularAngleWrapper.java @@ -83,11 +83,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.ItemIO; import org.scijava.app.StatusService; import org.scijava.command.Command; +import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.table.DoubleColumn; import org.scijava.table.Table; import org.scijava.ui.UIService; +import org.scijava.widget.Button; import org.scijava.widget.NumberWidget; import sc.fiji.analyzeSkeleton.AnalyzeSkeleton_; @@ -166,6 +169,7 @@ public class IntertrabecularAngleWrapper extends BoneJCommand { description = "Print the percentage of each of the type of edges that were culled after calling analyseSkeleton", required = false, persistKey = "ITA_print_culled_edges") private boolean printCulledEdgePercentages; + /** * The ITA edge-end coordinates in a {@link Table}, null if there are no * results @@ -174,10 +178,16 @@ public class IntertrabecularAngleWrapper extends BoneJCommand { private ResultsTable centroidTable; @Parameter(type = ItemIO.OUTPUT, label = "Edge culling percentages") private ResultsTable culledEdgePercentagesTable; + @Parameter(label = "Help", description = "More about Intertrabecular Angles", callback = "showHelpPage") + private Button button; @Parameter private StatusService statusService; @Parameter private UIService uiService; + @Parameter + private LogService logService; + @Parameter + private PlatformService platformService; private double[] coefficients; private boolean anisotropyWarned; @@ -219,6 +229,11 @@ public void run() { printCulledEdgePercentages(pruningResult.b); reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#inter-trabecular-angles", platformService, uiService, logService); + } private void addResults(final Map anglesMap) { final String label = inputImage.getTitle(); diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/SurfaceAreaWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/SurfaceAreaWrapper.java index d7cb29f28..2ea6bfb31 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/SurfaceAreaWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/SurfaceAreaWrapper.java @@ -90,15 +90,18 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.bonej.utilities.AxisUtils; import org.bonej.utilities.ElementUtil; import org.bonej.utilities.SharedTable; +import org.bonej.wrapperPlugins.wrapperUtils.Common; import org.bonej.wrapperPlugins.wrapperUtils.HyperstackUtils.Subspace; import org.bonej.wrapperPlugins.wrapperUtils.ResultUtils; import org.scijava.app.StatusService; import org.scijava.command.Command; import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.ui.UIService; import org.scijava.util.StringUtils; +import org.scijava.widget.Button; import org.scijava.widget.FileWidget; /** @@ -123,6 +126,8 @@ public class SurfaceAreaWrapper & NativeType> extends B description = "Create a binary STL file from the surface mesh", required = false) private boolean exportSTL; + @Parameter(label = "Help", description = "More about Surface Area", callback = "showHelpPage") + private Button button; @Parameter private OpService opService; @Parameter @@ -133,6 +138,8 @@ public class SurfaceAreaWrapper & NativeType> extends B private UnitService unitService; @Parameter private StatusService statusService; + @Parameter + private PlatformService platformService; private String path = ""; private String extension = ""; @@ -158,6 +165,11 @@ public void run() { resultsTable = SharedTable.getTable(); reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#surface-area", platformService, uiService, logService); + } /** * Check if all the spatial axes have a matching calibration, e.g. same unit, diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/ThicknessWrapper.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/ThicknessWrapper.java index 6753edd26..1a3c11900 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/ThicknessWrapper.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/ThicknessWrapper.java @@ -77,9 +77,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.ItemIO; import org.scijava.app.StatusService; import org.scijava.command.Command; +import org.scijava.log.LogService; +import org.scijava.platform.PlatformService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.ui.UIService; +import org.scijava.widget.Button; import org.scijava.widget.ChoiceWidget; import sc.fiji.localThickness.LocalThicknessWrapper; @@ -120,11 +123,18 @@ public class ThicknessWrapper extends BoneJCommand { @Parameter(label = "Trabecular spacing", type = ItemIO.OUTPUT) private ImagePlus spacingMap; + + @Parameter(label = "Help", description = "More about Thickness", callback = "showHelpPage") + private Button button; @Parameter private UIService uiService; @Parameter private StatusService statusService; + @Parameter + private LogService logService; + @Parameter + private PlatformService platformService; private boolean foreground; private LocalThicknessWrapper localThickness; @@ -161,6 +171,11 @@ public void run() { } reportUsage(); } + + @SuppressWarnings("unused") + private void showHelpPage() { + Common.showHelpPage("#thickness", platformService, uiService, logService); + } private void addMapResults(final ImagePlus map) { if (map == null) { diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/Common.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/Common.java index 538ff58bc..547c7d490 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/Common.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/Common.java @@ -55,6 +55,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import static org.scijava.ui.DialogPrompt.OptionType.OK_CANCEL_OPTION; import static org.scijava.ui.DialogPrompt.Result.OK_OPTION; +import java.io.IOException; +import java.net.URL; + import net.imagej.ImgPlus; import net.imagej.axis.CalibratedAxis; import net.imagej.display.ColorTables; @@ -69,6 +72,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import org.scijava.Context; import org.scijava.command.ContextCommand; import org.scijava.log.LogService; +import org.scijava.log.Logger; +import org.scijava.platform.PlatformService; import org.scijava.ui.UIService; import ij.ImagePlus; @@ -179,4 +184,23 @@ private static void copyMetadata(final ImgPlus source, target.setAxis(axis, d); } } + + /** + * Shows a help page on the imagej.net website, direction to the section indicated by 'section'. + * + * @param section on the webpage in the format '#page-section'. If empty or not found, + * webpage opens at the top + * @param platformService + * @param uiService + * @param logService + */ + public static void showHelpPage(String section, + PlatformService platformService, UIService uiService, Logger logService) { + try { + platformService.open(new URL("https://imagej.net/plugins/bonej"+section)); + } catch (final IOException e) { + uiService.showDialog("Something went wrong while opening the help page. Please try again."); + logService.trace(e); + } + } } diff --git a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java index eecff8f85..79a4f5ec4 100644 --- a/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java +++ b/Modern/wrapperPlugins/src/main/java/org/bonej/wrapperPlugins/wrapperUtils/UsageReporterOptions.java @@ -148,11 +148,6 @@ public void run() { @SuppressWarnings("unused") private void showHelpPage() { - try { - platformService.open(new URL("https://imagej.net/plugins/bonej#usage-reporting")); - } catch (final IOException e) { - uiService.showDialog("Something went wrong while opening the help page. Please try again."); - logService.trace(e); - } + Common.showHelpPage("#usage-reporting", platformService, uiService, logService); } }