/** * 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 ) ); }
/** * 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 ) ); }
/** * 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 ) ); }
@Override public Area call() throws Exception { final Image<BitType> imb = interpol.process(weight); final ImagePlus imp = ImageJFunctions.copyToImagePlus(imb, ImagePlus.GRAY8); // BitType gets copied to 0 and 255 in 8-bit ByteProcessor final ThresholdToSelection ts = new ThresholdToSelection(); ts.setup("", imp); final ImageProcessor ip = imp.getProcessor(); ip.setThreshold(1, 255, ImageProcessor.NO_LUT_UPDATE); ts.run(ip); final Roi roi = imp.getRoi(); return null == roi ? new Area() : M.getArea(roi).createTransformedArea(back); } }));
fuseChannel( out, ImageJFunctions.convertFloat( Hyperstack_rearranger.getImageChunk( imp, c, timepoint ) ), offset, models.get( i + (timepoint - 1) * numImages ), factory ); try
final mpicbg.imglib.image.Image<UnsignedByteType> shapeListImage = new mpicbg.imglib.image.Image<UnsignedByteType>(shapeList, shapeList.getBackground(), "mask"); ByteProcessor rmask = (ByteProcessor) ImageJFunctions.copyToImagePlus(shapeListImage, ImagePlus.GRAY8).getProcessor();
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