Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/main/java/net/imglib2/imagej/ImgPlusViews.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down Expand Up @@ -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 ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}