本文整理了Java中net.imglib2.util.Util.getArrayOrCellImgFactory()
方法的一些代码示例,展示了Util.getArrayOrCellImgFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getArrayOrCellImgFactory()
方法的具体详情如下:
包路径:net.imglib2.util.Util
类名称:Util
方法名:getArrayOrCellImgFactory
[英]Create an ArrayImgFactory if an image of the requested targetSize
could be held in an ArrayImg. Otherwise return a CellImgFactory with cell size targetCellSize
(or as large as possible if targetCellSize
is too large).
[中]如果请求的targetSize
的映像可以保存在ArrayImg中,则创建ArrayImgFactory。否则,返回单元格大小为targetCellSize
的CellImgFactory(如果targetCellSize
太大,则返回尽可能大的CellImgFactory)。
代码示例来源:origin: net.imglib2/imglib2
/**
* Create an appropriate {@link ImgFactory} for the requested
* {@code targetSize} and {@code type}. If the type is a {@link NativeType},
* then {@link #getArrayOrCellImgFactory(Dimensions, NativeType)} is used;
* if not, a {@link ListImgFactory} is returned.
*
* @param targetSize
* size of image that the factory should be able to create.
* @param type
* type of the factory.
* @return an {@link ArrayImgFactory}, {@link CellImgFactory} or
* {@link ListImgFactory} as appropriate.
*/
public static < T > ImgFactory< T > getSuitableImgFactory( final Dimensions targetSize, final T type )
{
if ( type instanceof NativeType )
{
// NB: Eclipse does not demand the cast to ImgFactory< T >, but javac does.
@SuppressWarnings( { "cast", "rawtypes", "unchecked" } )
final ImgFactory< T > arrayOrCellImgFactory = ( ImgFactory< T > ) getArrayOrCellImgFactory( targetSize, ( NativeType ) type );
return arrayOrCellImgFactory;
}
return new ListImgFactory<>( type );
}
代码示例来源:origin: imglib/imglib2
/**
* Create an appropriate {@link ImgFactory} for the requested
* {@code targetSize} and {@code type}. If the type is a {@link NativeType},
* then {@link #getArrayOrCellImgFactory(Dimensions, NativeType)} is used;
* if not, a {@link ListImgFactory} is returned.
*
* @param targetSize
* size of image that the factory should be able to create.
* @param type
* type of the factory.
* @return an {@link ArrayImgFactory}, {@link CellImgFactory} or
* {@link ListImgFactory} as appropriate.
*/
public static < T > ImgFactory< T > getSuitableImgFactory( final Dimensions targetSize, final T type )
{
if ( type instanceof NativeType )
{
// NB: Eclipse does not demand the cast to ImgFactory< T >, but javac does.
@SuppressWarnings( { "cast", "rawtypes", "unchecked" } )
final ImgFactory< T > arrayOrCellImgFactory = ( ImgFactory< T > ) getArrayOrCellImgFactory( targetSize, ( NativeType ) type );
return arrayOrCellImgFactory;
}
return new ListImgFactory<>( type );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
/**
* Build a component tree from an input image. Calls
* {@link #buildComponentTree(RandomAccessibleInterval, RealType, ImgFactory, boolean)}
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @param input
* the input image.
* @param type
* a variable of the input image type.
* @param darkToBright
* whether to apply thresholds from dark to bright (true) or
* bright to dark (false)
* @return component tree of the image.
*/
public static < T extends RealType< T > > PixelListComponentTree< T > buildComponentTree( final RandomAccessibleInterval< T > input, final T type, final boolean darkToBright )
{
final ImgFactory< LongType > factory = Util.getArrayOrCellImgFactory( input, new LongType() );
return buildComponentTree( input, type, factory, darkToBright );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
/**
* Build a component tree from an input image. Calls
* {@link #buildComponentTree(RandomAccessibleInterval, Type, Comparator, ImgFactory)}
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @param input
* the input image.
* @param maxValue
* a value (e.g., grey-level) greater than any occurring in the
* input image.
* @param comparator
* determines ordering of threshold values.
* @return component tree of the image.
*/
public static < T extends Type< T > > PixelListComponentTree< T > buildComponentTree( final RandomAccessibleInterval< T > input, final T maxValue, final Comparator< T > comparator )
{
final ImgFactory< LongType > factory = Util.getArrayOrCellImgFactory( input, new LongType() );
return buildComponentTree( input, maxValue, comparator, factory );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
/**
* Build a MSER tree from an input image. Calls
* {@link #buildMserTree(RandomAccessibleInterval, RealType, long, long, double, double, ImgFactory, boolean)}
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @param input
* the input image.
* @param delta
* delta for computing instability score.
* @param minSize
* minimum size (in pixels) of accepted MSER.
* @param maxSize
* maximum size (in pixels) of accepted MSER.
* @param maxVar
* maximum instability score of accepted MSER.
* @param minDiversity
* minimal diversity of adjacent accepted MSER.
* @param darkToBright
* whether to apply thresholds from dark to bright (true) or
* bright to dark (false)
* @return MSER tree of the image.
*/
public static < T extends RealType< T > > MserTree< T > buildMserTree( final RandomAccessibleInterval< T > input, final T delta, final long minSize, final long maxSize, final double maxVar, final double minDiversity, final boolean darkToBright )
{
final ImgFactory< LongType > factory = Util.getArrayOrCellImgFactory( input, new LongType() );
return buildMserTree( input, delta, minSize, maxSize, maxVar, minDiversity, factory, darkToBright );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
/**
* Build a MSER tree from an input image. Calls
* {@link #buildMserTree(RandomAccessibleInterval, ComputeDelta, long, long, double, double, ImgFactory, Type, Comparator)}
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @param input
* the input image.
* @param computeDelta
* to compute (value - delta).
* @param minSize
* minimum size (in pixels) of accepted MSER.
* @param maxSize
* maximum size (in pixels) of accepted MSER.
* @param maxVar
* maximum instability score of accepted MSER.
* @param minDiversity
* minimal diversity of adjacent accepted MSER.
* @param maxValue
* a value (e.g., grey-level) greater than any occurring in the
* input image.
* @param comparator
* determines ordering of threshold values.
* @return MSER tree of the image.
*/
public static < T extends Type< T > > MserTree< T > buildMserTree( final RandomAccessibleInterval< T > input, final ComputeDelta< T > computeDelta, final long minSize, final long maxSize, final double maxVar, final double minDiversity, final T maxValue, final Comparator< T > comparator )
{
final ImgFactory< LongType > factory = Util.getArrayOrCellImgFactory( input, new LongType() );
return buildMserTree( input, computeDelta, minSize, maxSize, maxVar, minDiversity, factory, maxValue, comparator );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
private static < T extends NativeType< T > > RandomAccessibleInterval< T > createImage( final T targetType, final Interval targetInterval )
{
final long[] dimensions = Intervals.dimensionsAsLongArray( targetInterval );
final Img< T > ts = Util.getArrayOrCellImgFactory( targetInterval, targetType ).create( dimensions );
return Views.translate( ts, Intervals.minAsLongArray( targetInterval ) );
}
代码示例来源:origin: fiji/TrackMate
@Override
public boolean process()
{
final long start = System.currentTimeMillis();
final T type = source.randomAccess().get().createVariable();
final ImgFactory< T > factory = Util.getArrayOrCellImgFactory( source, type );
this.output = factory.create( source );
if ( source.numDimensions() > 2 )
{
final long nz = source.dimension( 2 );
for ( long z = 0; z < nz; z++ )
{
final IntervalView< T > slice = Views.hyperSlice( source, 2, z );
final IntervalView< T > outputSlice = Views.hyperSlice( output, 2, z );
processSlice( slice, outputSlice );
}
}
else
{
processSlice( source, output );
}
this.processingTime = System.currentTimeMillis() - start;
return true;
}
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public boolean process()
{
final long start = System.currentTimeMillis();
final T type = source.randomAccess().get().createVariable();
final ImgFactory< T > factory = Util.getArrayOrCellImgFactory( source, type );
this.output = factory.create( source, type );
if ( source.numDimensions() > 2 )
{
final long nz = source.dimension( 2 );
for ( long z = 0; z < nz; z++ )
{
final IntervalView< T > slice = Views.hyperSlice( source, 2, z );
final IntervalView< T > outputSlice = Views.hyperSlice( output, 2, z );
processSlice( slice, outputSlice );
}
}
else
{
processSlice( source, output );
}
this.processingTime = System.currentTimeMillis() - start;
return true;
}
代码示例来源:origin: fiji/TrackMate
final ImgFactory< FloatType > factory = Util.getArrayOrCellImgFactory( interval, new FloatType() );
Img< FloatType > floatImg = DetectionUtils.copyToFloatImg( img, interval, factory );
for ( int d = 0; d < kernel.numDimensions(); d++ )
fftinterval = Intervals.expand( fftinterval, kernel.dimension( d ), d );
final ImgFactory< ComplexFloatType > imgFactory = Util.getArrayOrCellImgFactory( fftinterval, new ComplexFloatType() );
fftconv.setFFTImgFactory( imgFactory );
代码示例来源:origin: net.imglib2/imglib2-algorithm
final Img< T > g1 = Util.getArrayOrCellImgFactory( dog, type ).create( dog );
final long[] translation = new long[ dog.numDimensions() ];
dog.min( translation );
代码示例来源:origin: sc.fiji/TrackMate_
final ImgFactory< FloatType > factory = Util.getArrayOrCellImgFactory( interval, new FloatType() );
Img< FloatType > floatImg = DetectionUtils.copyToFloatImg( img, interval, factory );
for ( int d = 0; d < kernel.numDimensions(); d++ )
fftinterval = Intervals.expand( fftinterval, kernel.dimension( d ), d );
final ImgFactory< ComplexFloatType > imgFactory = Util.getArrayOrCellImgFactory( fftinterval, new ComplexFloatType() );
fftconv.setFFTImgFactory( imgFactory );
代码示例来源:origin: sc.fiji/TrackMate_
final RandomAccessibleInterval< FloatType > dog = Views.offset( Util.getArrayOrCellImgFactory( interval, type ).create( interval, type ), min );
final RandomAccessibleInterval< FloatType > dog2 = Views.offset( Util.getArrayOrCellImgFactory( interval, type ).create( interval, type ), min );
代码示例来源:origin: fiji/TrackMate
final RandomAccessibleInterval< FloatType > dog = Views.offset( Util.getArrayOrCellImgFactory( interval, type ).create( interval ), min );
final RandomAccessibleInterval< FloatType > dog2 = Views.offset( Util.getArrayOrCellImgFactory( interval, type ).create( interval ), min );
代码示例来源:origin: fiji/TrackMate
final Img< T > downsampled = Util.getArrayOrCellImgFactory( interval, type ).create( dimensions );
代码示例来源:origin: sc.fiji/TrackMate_
final Img< T > downsampled = Util.getArrayOrCellImgFactory( interval, type ).create( dimensions, type );
内容来源于网络,如有侵权,请联系作者删除!