From e3a56ac004345e1a946543e23e2509038435bcee Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Mon, 17 Feb 2025 16:16:28 -0600 Subject: [PATCH 1/2] Remove deprecated ImagePlusImgFactory API --- .../imagej/imageplus/ImagePlusImgFactory.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/main/java/net/imglib2/imagej/imageplus/ImagePlusImgFactory.java b/src/main/java/net/imglib2/imagej/imageplus/ImagePlusImgFactory.java index a17b839..ea86e0c 100644 --- a/src/main/java/net/imglib2/imagej/imageplus/ImagePlusImgFactory.java +++ b/src/main/java/net/imglib2/imagej/imageplus/ImagePlusImgFactory.java @@ -120,32 +120,4 @@ public < S > ImgFactory< S > imgFactory( final S type ) throws IncompatibleTypeE return new ImagePlusImgFactory( ( NativeType ) type ); throw new IncompatibleTypeException( this, type.getClass().getCanonicalName() + " does not implement NativeType." ); } - - /* - * ----------------------------------------------------------------------- - * - * Deprecated API. - * - * Supports backwards compatibility with ImgFactories that are constructed - * without a type instance or supplier. - * - * ----------------------------------------------------------------------- - */ - - @Deprecated - public ImagePlusImgFactory() - { - super(); - } - - @Deprecated - @Override - public ImagePlusImg< T, ? > create( final long[] dimensions, final T type ) - { - cache( type ); - @SuppressWarnings( { "unchecked", "rawtypes" } ) - final ImagePlusImg< T, ? > img = create( dimensions, type, ( NativeTypeFactory ) type.getNativeTypeFactory() ); - return img; - } - } From 7898d10e3ce5ba18ed549030010d471fbe804e2f Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Mon, 17 Feb 2025 16:19:22 -0600 Subject: [PATCH 2/2] Remove ImgPlusViews.moveAxis Exists within net.imglib2.view.Views --- src/main/java/net/imglib2/imagej/ImgPlusViews.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/net/imglib2/imagej/ImgPlusViews.java b/src/main/java/net/imglib2/imagej/ImgPlusViews.java index a8a4edc..909f242 100644 --- a/src/main/java/net/imglib2/imagej/ImgPlusViews.java +++ b/src/main/java/net/imglib2/imagej/ImgPlusViews.java @@ -135,7 +135,7 @@ private static RandomAccessibleInterval< ARGBType > fuseColor( final Img< ? exte if ( d < 0 || image.dimension( d ) != 3 ) throw new IllegalArgumentException(); return Converters.convert( - Views.collapse( moveAxis( image, d, image.numDimensions() - 1 ) ), + Views.collapse( Views.moveAxis( image, d, image.numDimensions() - 1 ) ), ImgPlusViews::convertToColor, new ARGBType() ); } @@ -168,18 +168,6 @@ private static < T extends Type< T > > ImgPlus< T > newImgPlus( final ImgPlus< ? return result; } - // TODO: move to imglib2 Views - private static < T > RandomAccessibleInterval< T > moveAxis( final RandomAccessibleInterval< T > image, final int fromAxis, final int toAxis ) - { - if ( fromAxis == toAxis ) - return image; - final int direction = toAxis > fromAxis ? 1 : -1; - RandomAccessibleInterval< T > res = image; - for ( int i = fromAxis; i != toAxis; i += direction ) - res = Views.permute( res, i, i + direction ); - return res; - } - private static void convertToColor( final Composite< ? extends RealType< ? > > in, final ARGBType out ) { out.set( ARGBType.rgba( toInt( in.get( 0 ) ), toInt( in.get( 1 ) ), toInt( in.get( 2 ) ), 255 ) );