Java Code Examples for mpicbg.imglib.image.display.imagej.ImageJFunctions#wrapFloat()

The following examples show how to use mpicbg.imglib.image.display.imagej.ImageJFunctions#wrapFloat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LRFFT.java    From SPIM_Registration with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static final Image< FloatType > wrap( final Img< net.imglib2.type.numeric.real.FloatType > i )
{
	if ( i instanceof ImagePlusImg )
	{
		try
		{
			return ImageJFunctions.wrapFloat( ((ImagePlusImg) i).getImagePlus() );
		}
		catch (ImgLibException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}			
	}
	else
	{
		return ImgLib2.wrapFloatToImgLib1( i );
	}
}
 
Example 2
Source File: PairWiseStitchingImgLib.java    From Stitching with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 ) );
}