diff --git a/src/main/java/net/preibisch/mvrecon/process/fusion/FusionTools.java b/src/main/java/net/preibisch/mvrecon/process/fusion/FusionTools.java index 0725f9931..6ec563ea8 100644 --- a/src/main/java/net/preibisch/mvrecon/process/fusion/FusionTools.java +++ b/src/main/java/net/preibisch/mvrecon/process/fusion/FusionTools.java @@ -666,6 +666,7 @@ else if ( imgType == ImgDataType.PRECOMPUTED ) * @param border - the target blending border, e.g. 0 * @param transformationModel - the transformation model used to map from the (downsampled) input to the output */ + // NOTE (TP) blending and border are modified public static void adjustBlending( final BasicViewDescription< ? > vd, final float[] blending, final float[] border, final AffineTransform3D transformationModel ) { adjustBlending( vd.getViewSetup().getSize(), Group.pvid( vd ), blending, border, transformationModel ); diff --git a/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedImgRandomAccess.java b/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedImgRandomAccess.java index fc37c753b..86cbf778f 100644 --- a/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedImgRandomAccess.java +++ b/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedImgRandomAccess.java @@ -27,9 +27,11 @@ import net.imglib2.RealRandomAccess; import net.imglib2.converter.Converters; import net.imglib2.converter.RealFloatConverter; +import net.imglib2.converter.RealTypeConverters; import net.imglib2.interpolation.InterpolatorFactory; import net.imglib2.type.numeric.RealType; import net.imglib2.type.numeric.real.FloatType; +import net.imglib2.util.Util; import net.imglib2.view.Views; public abstract class AbstractTransformedImgRandomAccess< T extends RealType< T > > extends AbstractTransformedIntervalRandomAccess @@ -58,17 +60,13 @@ public AbstractTransformedImgRandomAccess( // extend input image and convert to floats final RandomAccessible< FloatType > input; - if ( FloatType.class.isInstance( Views.iterable( img ).cursor().next() ) ) + if ( Util.getTypeFromInterval( img ) instanceof FloatType ) { - input = (RandomAccessible< FloatType >)img; + input = ( RandomAccessible< FloatType > ) img; } else { - input = - Converters.convert( - img, - new RealFloatConverter< T >(), - new FloatType() ); + input = RealTypeConverters.convert( img, new FloatType() ); } // make the interpolator diff --git a/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedIntervalRandomAccessible.java b/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedIntervalRandomAccessible.java index e8ced8ae3..33c157af3 100644 --- a/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedIntervalRandomAccessible.java +++ b/src/main/java/net/preibisch/mvrecon/process/fusion/transformed/AbstractTransformedIntervalRandomAccessible.java @@ -40,7 +40,7 @@ public abstract class AbstractTransformedIntervalRandomAccessible implements Ran final protected int n; - protected InterpolatorFactory< FloatType, RandomAccessible< FloatType > > interpolatorFactory = new NLinearInterpolatorFactory< FloatType >(); + protected InterpolatorFactory< FloatType, RandomAccessible< FloatType > > interpolatorFactory = new NLinearInterpolatorFactory<>(); public AbstractTransformedIntervalRandomAccessible( final Interval interval, // from ImgLoader @@ -60,12 +60,12 @@ public AbstractTransformedIntervalRandomAccessible( public void setLinearInterpolation() { - this.interpolatorFactory = new NLinearInterpolatorFactory< FloatType >(); + this.interpolatorFactory = new NLinearInterpolatorFactory<>(); } public void setNearestNeighborInterpolation() { - this.interpolatorFactory = new NearestNeighborInterpolatorFactory< FloatType >(); + this.interpolatorFactory = new NearestNeighborInterpolatorFactory<>(); } @Override