From ab3bf6453c85022c890d54910c1e41e88e4bf0a0 Mon Sep 17 00:00:00 2001 From: Ignacio Arganda-Carreras Date: Wed, 6 Feb 2019 07:58:17 +0100 Subject: [PATCH 1/3] User Manual: remove wrong 2 factor in Jaccard index (code is OK). --- doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx b/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx index 8f6f646c..6f7624fa 100644 --- a/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx +++ b/doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx @@ -9912,7 +9912,7 @@ $r$ \begin_inset Formula \[ -UO_{r}=2\frac{|S_{r}\cap T_{r}|}{|S_{r}\cup T_{r}|} +UO_{r}=\frac{|S_{r}\cap T_{r}|}{|S_{r}\cup T_{r}|} \] \end_inset @@ -9928,7 +9928,7 @@ Jaccard Index or Union Overlap for all regions: \begin_inset Formula \[ -UO=2\frac{\sum_{r}|S_{r}\cap T_{r}|}{\sum_{r}|S_{r}\cup T_{r}|} +UO=\frac{\sum_{r}|S_{r}\cap T_{r}|}{\sum_{r}|S_{r}\cup T_{r}|} \] \end_inset From 34e56c5d10778fe9821b90338f73a023461bf5cf Mon Sep 17 00:00:00 2001 From: Ignacio Arganda-Carreras Date: Wed, 6 Feb 2019 08:48:36 +0100 Subject: [PATCH 2/3] Fix bug when opening large images in plugin. Large images where causing GUI size larger than the screen resolution. --- .../plugins/MorphologicalSegmentation.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/inra/ijpb/plugins/MorphologicalSegmentation.java b/src/main/java/inra/ijpb/plugins/MorphologicalSegmentation.java index abed0959..02aba220 100644 --- a/src/main/java/inra/ijpb/plugins/MorphologicalSegmentation.java +++ b/src/main/java/inra/ijpb/plugins/MorphologicalSegmentation.java @@ -460,8 +460,8 @@ else if( e.getSource() == shuffleColorsButton ) double screenHeight = screenSize.getHeight(); // Zoom in if image is too small - while( ic.getWidth() < screenWidth/2 && - ic.getHeight() < screenHeight/2 && + while( ( ic.getWidth() < screenWidth/2 || + ic.getHeight() < screenHeight/2 ) && ic.getMagnification() < 32.0 ) { final int canvasWidth = ic.getWidth(); @@ -473,6 +473,20 @@ else if( e.getSource() == shuffleColorsButton ) break; } } + // Zoom out if canvas is too large + while( ( ic.getWidth() > 0.75 * screenWidth || + ic.getHeight() > 0.75 * screenHeight ) && + ic.getMagnification() > 1/72.0 ) + { + final int canvasWidth = ic.getWidth(); + ic.zoomOut( 0, 0 ); + // check if canvas size changed (otherwise stop zooming) + if( canvasWidth == ic.getWidth() ) + { + ic.zoomIn(0, 0); + break; + } + } setTitle( "Morphological Segmentation" ); From 15f2b28087fbc0304d47ebe178242662b4475a33 Mon Sep 17 00:00:00 2001 From: Ignacio Arganda-Carreras Date: Wed, 6 Feb 2019 08:53:03 +0100 Subject: [PATCH 3/3] Fix bug with GUIs larger than screen dimensions. Zoom out when any of the canvas dimensions are larger than 0.75 of the screen size. --- .../InteractiveMarkerControlledWatershed.java | 15 ++++++++++++++- src/main/java/inra/ijpb/plugins/LabelEdition.java | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/inra/ijpb/plugins/InteractiveMarkerControlledWatershed.java b/src/main/java/inra/ijpb/plugins/InteractiveMarkerControlledWatershed.java index c817dadb..b125385b 100644 --- a/src/main/java/inra/ijpb/plugins/InteractiveMarkerControlledWatershed.java +++ b/src/main/java/inra/ijpb/plugins/InteractiveMarkerControlledWatershed.java @@ -348,7 +348,20 @@ else if( e.getSource() == shuffleColorsButton ) break; } } - + // Zoom out if canvas is too large + while( ( ic.getWidth() > 0.75 * screenWidth || + ic.getHeight() > 0.75 * screenHeight ) && + ic.getMagnification() > 1/72.0 ) + { + final int canvasWidth = ic.getWidth(); + ic.zoomOut( 0, 0 ); + // check if canvas size changed (otherwise stop zooming) + if( canvasWidth == ic.getWidth() ) + { + ic.zoomIn(0, 0); + break; + } + } setTitle( "Interactive Marker-controlled Watershed" ); // select point tool for manual label merging diff --git a/src/main/java/inra/ijpb/plugins/LabelEdition.java b/src/main/java/inra/ijpb/plugins/LabelEdition.java index ab362cb2..02fcb292 100644 --- a/src/main/java/inra/ijpb/plugins/LabelEdition.java +++ b/src/main/java/inra/ijpb/plugins/LabelEdition.java @@ -228,7 +228,20 @@ public CustomWindow( ImagePlus imp ) break; } } - + // Zoom out if canvas is too large + while( ( ic.getWidth() > 0.75 * screenWidth || + ic.getHeight() > 0.75 * screenHeight ) && + ic.getMagnification() > 1/72.0 ) + { + final int canvasWidth = ic.getWidth(); + ic.zoomOut( 0, 0 ); + // check if canvas size changed (otherwise stop zooming) + if( canvasWidth == ic.getWidth() ) + { + ic.zoomIn(0, 0); + break; + } + } setTitle( "Label Edition" ); mergeButton = new JButton( "Merge" );