Skip to content

Commit b281d28

Browse files
authored
Merge pull request #5 from imglib/remove-deprecated-api
Remove deprecated ImagePlusImgFactory API
2 parents b499a8a + 7898d10 commit b281d28

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

src/main/java/net/imglib2/imagej/ImgPlusViews.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private static RandomAccessibleInterval< ARGBType > fuseColor( final Img< ? exte
135135
if ( d < 0 || image.dimension( d ) != 3 )
136136
throw new IllegalArgumentException();
137137
return Converters.convert(
138-
Views.collapse( moveAxis( image, d, image.numDimensions() - 1 ) ),
138+
Views.collapse( Views.moveAxis( image, d, image.numDimensions() - 1 ) ),
139139
ImgPlusViews::convertToColor,
140140
new ARGBType() );
141141
}
@@ -168,18 +168,6 @@ private static < T extends Type< T > > ImgPlus< T > newImgPlus( final ImgPlus< ?
168168
return result;
169169
}
170170

171-
// TODO: move to imglib2 Views
172-
private static < T > RandomAccessibleInterval< T > moveAxis( final RandomAccessibleInterval< T > image, final int fromAxis, final int toAxis )
173-
{
174-
if ( fromAxis == toAxis )
175-
return image;
176-
final int direction = toAxis > fromAxis ? 1 : -1;
177-
RandomAccessibleInterval< T > res = image;
178-
for ( int i = fromAxis; i != toAxis; i += direction )
179-
res = Views.permute( res, i, i + direction );
180-
return res;
181-
}
182-
183171
private static void convertToColor( final Composite< ? extends RealType< ? > > in, final ARGBType out )
184172
{
185173
out.set( ARGBType.rgba( toInt( in.get( 0 ) ), toInt( in.get( 1 ) ), toInt( in.get( 2 ) ), 255 ) );

src/main/java/net/imglib2/imagej/imageplus/ImagePlusImgFactory.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -120,32 +120,4 @@ public < S > ImgFactory< S > imgFactory( final S type ) throws IncompatibleTypeE
120120
return new ImagePlusImgFactory( ( NativeType ) type );
121121
throw new IncompatibleTypeException( this, type.getClass().getCanonicalName() + " does not implement NativeType." );
122122
}
123-
124-
/*
125-
* -----------------------------------------------------------------------
126-
*
127-
* Deprecated API.
128-
*
129-
* Supports backwards compatibility with ImgFactories that are constructed
130-
* without a type instance or supplier.
131-
*
132-
* -----------------------------------------------------------------------
133-
*/
134-
135-
@Deprecated
136-
public ImagePlusImgFactory()
137-
{
138-
super();
139-
}
140-
141-
@Deprecated
142-
@Override
143-
public ImagePlusImg< T, ? > create( final long[] dimensions, final T type )
144-
{
145-
cache( type );
146-
@SuppressWarnings( { "unchecked", "rawtypes" } )
147-
final ImagePlusImg< T, ? > img = create( dimensions, type, ( NativeTypeFactory ) type.getNativeTypeFactory() );
148-
return img;
149-
}
150-
151123
}

0 commit comments

Comments
 (0)