Skip to content

Commit

Permalink
optionally apply transform on fiji plugin startup
Browse files Browse the repository at this point in the history
see #117
  • Loading branch information
bogovicj committed Mar 3, 2021
1 parent b97d558 commit 3a42d92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/bdv/ij/BigWarpImagePlusPlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void run( final String arg )
gd.addChoice( "target_image", titles, titles[ 0 ] );

gd.addFileField( "Landmarks file", "" );
gd.addCheckbox( "Apply transform from landmarks", true );

gd.showDialog();

Expand All @@ -73,14 +74,18 @@ public void run( final String arg )
moving_imp = WindowManager.getImage( ids[ gd.getNextChoiceIndex() ] );
target_imp = WindowManager.getImage( ids[ gd.getNextChoiceIndex() ] );
final String landmarkPath = gd.getNextString();
final boolean applyTransform = gd.getNextBoolean();

try
{
new RepeatingReleasedEventsFixer().install();
final BigWarp<?> bw = new BigWarp<>( BigWarpInit.createBigWarpDataFromImages( moving_imp, target_imp ), "Big Warp", new ProgressWriterIJ() );

if( landmarkPath != null && !landmarkPath.isEmpty())
{
bw.loadLandmarks( landmarkPath );
bw.setIsMovingDisplayTransformed( applyTransform );
}

bw.getViewerFrameP().getViewerPanel().requestRepaint();
bw.getViewerFrameQ().getViewerPanel().requestRepaint();
Expand Down

0 comments on commit 3a42d92

Please sign in to comment.