本文整理汇总了Java中net.imglib2.img.display.imagej.ImageJFunctions.wrapShort方法的典型用法代码示例。如果您正苦于以下问题:Java ImageJFunctions.wrapShort方法的具体用法?Java ImageJFunctions.wrapShort怎么用?Java ImageJFunctions.wrapShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.img.display.imagej.ImageJFunctions
的用法示例。
在下文中一共展示了ImageJFunctions.wrapShort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getImage
import net.imglib2.img.display.imagej.ImageJFunctions; //导入方法依赖的package包/类
@Override
public ImgPlus< UnsignedShortType > getImage( final int timepointId, final ImgLoaderHint... hints )
{
ensureExpIsOpen();
final int channel = setup.getChannel().getId();
final int illumination = setup.getIllumination().getId();
final int angle = setup.getAngle().getId();
final ImagePlus imp = getImagePlus( timepointId );
final Img< UnsignedShortType > img = ImageJFunctions.wrapShort( imp );
final String name = getBasename( timepointId, angle, channel, illumination );
final AxisType[] axes = new AxisType[] { Axes.X, Axes.Y, Axes.Z };
final float zStretching = ( float ) ( exp.pd / exp.pw );
final double[] calibration = new double[] { 1, 1, zStretching };
return new ImgPlus<>( img, name, axes, calibration );
}
示例2: wrapImagePlus
import net.imglib2.img.display.imagej.ImageJFunctions; //导入方法依赖的package包/类
public static Img<? extends RealType<?>> wrapImagePlus( ImagePlus imp){
Img<? extends RealType<?>> img = null;
int type = imp.getType();
switch( type ){
case ImagePlus.GRAY8:
img = ImageJFunctions.wrapByte(imp);
break;
case ImagePlus.GRAY16:
img = ImageJFunctions.wrapShort(imp);
break;
case ImagePlus.GRAY32:
img = ImageJFunctions.wrapFloat(imp);
break;
case ImagePlus.COLOR_256:
IJ.error("image type ("+type+") not handled. "+imp.toString() );
//img = ImageJFunctions.wrapRGBA(imp);
break;
case ImagePlus.COLOR_RGB:
IJ.error("image type ("+type+") not handled. "+imp.toString() );
//img = ImageJFunctions.wrapRGBA(imp);
break;
default:
IJ.error("image type ("+type+") not handled. "+imp.toString() );
break;
}
return img;
}
示例3: getImage
import net.imglib2.img.display.imagej.ImageJFunctions; //导入方法依赖的package包/类
@Override
public RandomAccessibleInterval< UnsignedShortType > getImage( final ViewId view )
{
final String fn = filenames.get( view );
if ( useImageJOpener )
{
final ImagePlus imp = new ImagePlus( fn );
if ( imp.getType() == ImagePlus.GRAY16 )
return new ImgPlus<>( ImageJFunctions.wrapShort( imp ) );
else if ( imp.getType() == ImagePlus.GRAY8 )
{
System.out.println( "wrapping" );
return new ImgPlus<>(
new ImgView<>(
Converters.convert(
( RandomAccessibleInterval<UnsignedByteType> ) ImageJFunctions.wrapByte( imp ),
new Converter< UnsignedByteType, UnsignedShortType >() {
@Override
public void convert( final UnsignedByteType input, final UnsignedShortType output )
{
output.set( input.get() );
}
},
new UnsignedShortType()
), null ) );
}
else
useImageJOpener = false;
}
try
{
return opener.openImg( fn, factory, type );
}
catch ( final ImgIOException e )
{
throw new RuntimeException( e );
}
}
示例4: load
import net.imglib2.img.display.imagej.ImageJFunctions; //导入方法依赖的package包/类
@Override
public RandomAccessibleInterval< UnsignedShortType > load( final String fn )
{
return ImageJFunctions.wrapShort( new ImagePlus( fn ) );
}