/** * return an {@link Image} of {@link UnsignedShortType} as input for the PhaseCorrelation. If no rectangular roi * is selected, it will only wrap the existing ImagePlus! * * @param imp - the {@link ImagePlus} * @param channel - which channel (if channel=0 means average all channels) * @param timepoint - which timepoint * * @return - the {@link Image} or null if it was not an ImagePlus.GRAY16 or if channel = 0 */ public static Image<UnsignedShortType> getWrappedImageUnsignedShort( final ImagePlus imp, final int channel, final int timepoint ) { if ( channel == 0 || imp.getType() != ImagePlus.GRAY16 ) return null; return ImageJFunctions.wrapShort( Hyperstack_rearranger.getImageChunk( imp, channel, timepoint ) ); }
return reorderHyperstack( imp, 0, 1, 2, closeOldImp, showNewImp ); else if ( newOrder.equalsIgnoreCase( "CTZ" ) ) return reorderHyperstack( imp, 0, 2, 1, closeOldImp, showNewImp ); else if ( newOrder.equalsIgnoreCase( "ZCT" ) ) return reorderHyperstack( imp, 1, 0, 2, closeOldImp, showNewImp ); else if ( newOrder.equalsIgnoreCase( "ZTC" ) ) return reorderHyperstack( imp, 1, 2, 0, closeOldImp, showNewImp ); else if ( newOrder.equalsIgnoreCase( "TCZ" ) ) return reorderHyperstack( imp, 2, 0, 1, closeOldImp, showNewImp ); else if ( newOrder.equalsIgnoreCase( "TZC" ) ) return reorderHyperstack( imp, 2, 1, 0, closeOldImp, showNewImp ); else
imp = Hyperstack_rearranger.convertToHyperStack( imp );
imp1 = Hyperstack_rearranger.convertToHyperStack( imp1 ); imp2 = Hyperstack_rearranger.convertToHyperStack( imp2 );
/** * return an {@link Image} of {@link FloatType} as input for the PhaseCorrelation. If no rectangular roi * is selected, it will only wrap the existing ImagePlus! * * @param imp - the {@link ImagePlus} * @param channel - which channel (if channel=0 means average all channels) * @param timepoint - which timepoint * * @return - the {@link Image} or null if it was not an ImagePlus.GRAY32 or if channel = 0 */ public static Image<FloatType> getWrappedImageFloat( final ImagePlus imp, final int channel, final int timepoint ) { if ( channel == 0 || imp.getType() != ImagePlus.GRAY32 ) return null; return ImageJFunctions.wrapFloat( Hyperstack_rearranger.getImageChunk( imp, channel, timepoint ) ); }
imp1 = Hyperstack_rearranger.convertToHyperStack( imp1 ); imp2 = Hyperstack_rearranger.convertToHyperStack( imp2 );
defaultIndexFrames = indexFrames; reorderHyperstack( imp, indexChannels, indexSlices, indexFrames, true, true );
/** * return an {@link Image} of {@link UnsignedByteType} as input for the PhaseCorrelation. If no rectangular roi * is selected, it will only wrap the existing ImagePlus! * * @param imp - the {@link ImagePlus} * @param channel - which channel (if channel=0 means average all channels) * @param timepoint - which timepoint * * @return - the {@link Image} or null if it was not an ImagePlus.GRAY8 or if channel = 0 */ public static Image<UnsignedByteType> getWrappedImageUnsignedByte( final ImagePlus imp, final int channel, final int timepoint ) { if ( channel == 0 || imp.getType() != ImagePlus.GRAY8 ) return null; return ImageJFunctions.wrapByte( Hyperstack_rearranger.getImageChunk( imp, channel, timepoint ) ); }
fuseChannel( out, ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, timepoint ) ), offset, models.get( i + (timepoint - 1) * numImages ), factory ); try
final Img< FloatType > in = ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, timepoint ) );
blockData.add( new ImageInterpolation<FloatType>( ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), interpolatorFactory, true ) ); blockData.add( new ImageInterpolation<FloatType>( ImageJFunctions.wrapFloat( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), interpolatorFactoryFloat, false ) ); else if ( imp.getType() == ImagePlus.GRAY16 ) blockData.add( new ImageInterpolation<UnsignedShortType>( ImageJFunctions.wrapShort( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), interpolatorFactoryShort, false ) ); else blockData.add( new ImageInterpolation<UnsignedByteType>( ImageJFunctions.wrapByte( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), interpolatorFactoryByte, false ) );
fuseChannel( out, ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), offset, models.get( t - 1 ), new NearestNeighborInterpolatorFactory<FloatType>( new OutOfBoundsStrategyValueFactory<FloatType>() ) ); else fuseChannel( out, ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, t ) ), offset, models.get( t - 1 ), new LinearInterpolatorFactory<FloatType>( new OutOfBoundsStrategyValueFactory<FloatType>() ) ); try
final Img< FloatType > in = ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, t ) );