From 6d724633fad3352121fc91bec26fadea0c4ec58e Mon Sep 17 00:00:00 2001 From: John Bogovic Date: Thu, 26 Oct 2017 16:55:17 -0400 Subject: [PATCH] Additional options in bigwarp-apply plugin --- src/main/java/bdv/ij/ApplyBigwarpPlugin.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/bdv/ij/ApplyBigwarpPlugin.java b/src/main/java/bdv/ij/ApplyBigwarpPlugin.java index 718bd12c..83cb848d 100644 --- a/src/main/java/bdv/ij/ApplyBigwarpPlugin.java +++ b/src/main/java/bdv/ij/ApplyBigwarpPlugin.java @@ -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() ) @@ -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; @@ -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(); }