Skip to content

Commit

Permalink
Additional options in bigwarp-apply plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Oct 26, 2017
1 parent 4e84fb4 commit 6d72463
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/bdv/ij/ApplyBigwarpPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void run( String arg )
gd.addStringField( "landmarks_image_file", "" );
gd.addStringField( "moving_image_file", "" );
gd.addStringField( "target_space_file", "" );
System.out.println( "cow" );
gd.addChoice( "interpolation", new String[]{ "Nearest Neighbor", "Linear" }, "Linear" );
gd.addNumericField( "threads", 1, 0 );
gd.showDialog();

if ( gd.wasCanceled() )
Expand All @@ -135,6 +136,7 @@ public void run( String arg )
String landmarksPath = gd.getNextString();
String movingPath = gd.getNextString();
String targetPath = gd.getNextString();
String interpType = gd.getNextChoice();

ImagePlus movingIp = IJ.openImage( movingPath );
ImagePlus targetIp = movingIp;
Expand All @@ -156,7 +158,14 @@ public void run( String arg )
return;
}

ImagePlus warpedIp = apply( movingIp, targetIp, ltm, Interpolation.NLINEAR, 8 );
Interpolation interp = Interpolation.NLINEAR;
if( interpType.equals( "Nearest Neighbor" ))
interp = Interpolation.NEARESTNEIGHBOR;

int nThreads = (int)gd.getNextNumber();
System.out.println( nThreads );

ImagePlus warpedIp = apply( movingIp, targetIp, ltm, interp, nThreads );
warpedIp.show();
}

Expand Down

0 comments on commit 6d72463

Please sign in to comment.