diff --git a/src/main/java/bigtrace/volume/VolumeMisc.java b/src/main/java/bigtrace/volume/VolumeMisc.java index 1c7830e..49a2684 100644 --- a/src/main/java/bigtrace/volume/VolumeMisc.java +++ b/src/main/java/bigtrace/volume/VolumeMisc.java @@ -132,7 +132,7 @@ public static < T extends Comparable< T > & Type< T > > void findMaxLocation( final IterableInterval< T > input, final RealPoint maxLocation ) { // create a cursor for the image (the order does not matter) - final Cursor< T > cursor = input.cursor(); + final Cursor< T > cursor = input.localizingCursor(); // initialize min and max with the first image value @@ -423,21 +423,22 @@ public static ArrayList BresenhamWrap(final RealPoint RP1, final Real - FinalInterval RealIntervaltoInterval (RealInterval R_Int) + public static FinalInterval RealIntervaltoInterval (RealInterval R_Int) { int i; - long [] minL = new long [3]; - long [] maxL = new long [3]; - double [] minR = new double [3]; - double [] maxR = new double [3]; + final int d = R_Int.numDimensions(); + long [] minL = new long [d]; + long [] maxL = new long [d]; + double [] minR = new double [d]; + double [] maxR = new double [d]; R_Int.realMax(maxR); R_Int.realMin(minR); - for (i=0;i<3;i++) + for (i=0;i