Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ijpb/MorphoLibJ
Browse files Browse the repository at this point in the history
  • Loading branch information
dlegland committed Feb 14, 2019
2 parents 2f9d523 + 15f2b28 commit 820628a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/MorphoLibJ-manual/MorphoLibJ-manual.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/inra/ijpb/plugins/LabelEdition.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down
18 changes: 16 additions & 2 deletions src/main/java/inra/ijpb/plugins/MorphologicalSegmentation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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" );

Expand Down

0 comments on commit 820628a

Please sign in to comment.