net.imglib2.img.Img.factory()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中net.imglib2.img.Img.factory()方法的一些代码示例,展示了Img.factory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Img.factory()方法的具体详情如下:
包路径:net.imglib2.img.Img
类名称:Img
方法名:factory

Img.factory介绍

[英]Get a ImgFactory that creates Imgs of the same kind as this one. This is useful to create Imgs for temporary storage in generic methods where the specific Img type is unknown. Note, that the factory can be used even if all references to this Img have been invalidated.
[中]获取一个IMG工厂,该工厂创建与此相同类型的IMG。这对于在特定Img类型未知的通用方法中为临时存储创建Img非常有用。请注意,即使对本Img的所有引用均无效,也可以使用工厂。

代码示例

代码示例来源:origin: net.imglib2/imglib2

@Override
public ImgFactory< LongType > factory()
{
  return counts.factory();
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

/**
 * Contructor of ExplicitDiffusionScheme, calls contructor
 * {@code ExplicitDiffusionScheme(RandomAccessibleInterval<T>,
 * RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>)} and uses the
 * {@link ImgFactory} of the second Img as third parameter.
 * 
 * @param input the input Img
 * @param D the diffusion tensor
 */
public ExplicitDiffusionScheme(final Img<T> input, final Img<FloatType> D) {
  this( input, D, D.factory() );
}

代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl

/**
 * Computes a convolution in Fourier space.
 * 
 * @param image - the input {@link Img} to be convolved
 * @param kernel - the kernel {@link Img} for the convolution operation
 * @param fftImgFactory - the {@link ImgFactory} that is used to create the FFT's
 */
public FourierConvolution( final Img<T> image, final Img<S> kernel, final ImgFactory<ComplexFloatType> fftImgFactory )
{
  this( image, kernel, image.factory(), kernel.factory(), fftImgFactory );
}

代码示例来源:origin: net.imglib2/imglib2-algorithms

/**
 * Computes a Gaussian convolution with double precision on an entire {@link Img}
 * 
 * @param sigma - the sigma for the convolution
 * @param input - the input {@link Img}
 * @param outOfBounds - the {@link OutOfBoundsFactory} to use
 */
public GaussDouble( final double[] sigma, final Img<DoubleType> input, final OutOfBoundsFactory< DoubleType, Img<DoubleType> > outOfBounds )
{
  this( sigma, Views.extend( input, outOfBounds ), input, input.factory() );
}

代码示例来源:origin: net.imglib2/imglib2-algorithms

/**
 * Computes a Gaussian convolution with float precision on an entire {@link Img}
 * 
 * @param sigma - the sigma for the convolution
 * @param input - the input {@link Img}
 * @param outOfBounds - the {@link OutOfBoundsFactory} to use
 */
public GaussFloat( final double[] sigma, final Img<FloatType> input, final OutOfBoundsFactory< FloatType, Img<FloatType> > outOfBounds )
{
  this( sigma, Views.extend( input, outOfBounds ), input, input.factory() );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

public FourierTransform( final Img<T> input, final S complexType ) throws IncompatibleTypeException
{
  this ( input, input.factory().imgFactory( complexType ), complexType, PreProcessing.EXTEND_MIRROR_FADING, Rearrangement.REARRANGE_QUADRANTS, 
      FFTOptimization.SPEED, 0.25f, 0.25f, 12 ); 
}

代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl

/**
 * This inverse FFT can be only done in place, if desired. All parameters need to be set using the set() methods of this class.
 * 
 * @param fftImage - the input as {@link Img}
 * @param type - a Type instance for the output
 */
public InverseFourierTransform( final Img<S> fftImage, final T type ) throws IncompatibleTypeException
{
  this( fftImage, fftImage.factory().imgFactory( type ), type, Rearrangement.REARRANGE_QUADRANTS, true, false, null, null );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

/**
 * This inverse FFT can be only done in place, if desired. All parameters need to be set using the set() methods of this class.
 * 
 * @param fftImage - the input as {@link Img}
 * @param type - a Type instance for the output
 */
public InverseFourierTransform( final Img<S> fftImage, final T type ) throws IncompatibleTypeException
{
  this( fftImage, fftImage.factory().imgFactory( type ), type, Rearrangement.REARRANGE_QUADRANTS, true, false, null, null );
}

代码示例来源:origin: net.imagej/imagej-deprecated

/**
 * @deprecated This is for compatability with old API only.
 */
@Deprecated
public RandomAccessibleInterval< O > compute( Img< I > img, Img< O > r )
{
  m_outFactory = r.factory();
  return compute(img, r);
}

代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl

public FourierTransform( final Img<T> input, final S complexType, final Rearrangement rearrangement ) throws IncompatibleTypeException 
{ 
  this ( input, input.factory().imgFactory( complexType ), complexType );
  setRearrangement( rearrangement );
}

代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl

public FourierTransform( final Img<T> input, final S complexType, final OutOfBoundsFactory<T, RandomAccessibleInterval<T>> outOfBounds ) throws IncompatibleTypeException 
{ 
  this ( input, input.factory().imgFactory( complexType ), complexType );
  this.outOfBounds = outOfBounds;
  setPreProcessing( PreProcessing.USE_GIVEN_OUTOFBOUNDSSTRATEGY );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

public FourierTransform( final Img<T> input, final S complexType, final Rearrangement rearrangement ) throws IncompatibleTypeException 
{ 
  this ( input, input.factory().imgFactory( complexType ), complexType );
  setRearrangement( rearrangement );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

public FourierTransform( final Img<T> input, final S complexType, final FFTOptimization fftOptimization ) throws IncompatibleTypeException 
{ 
  this ( input, input.factory().imgFactory( complexType ), complexType );
  setFFTOptimization( fftOptimization );
}

代码示例来源:origin: net.imglib2/imglib2-script

static private final <T extends RealType<T>> RandomAccessibleInterval<T> process(final Img<T> img, final int beginRadius, final int endRadius) throws Exception {
    net.imglib2.algorithm.fft.Bandpass<T> bp = new net.imglib2.algorithm.fft.Bandpass<T>(img, beginRadius, endRadius,  img.factory());
    if (!bp.checkInput() || !bp.process()) {
      throw new Exception(bp.getClass().getSimpleName() + " failed: " + bp.getErrorMessage());
    }
    return bp.getResult();
  }
}

代码示例来源:origin: net.imglib2/imglib2-algorithms

/**
 * Computes a Gaussian convolution with any precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary
 * 
 * @param sigma - the sigma for the convolution
 * @param input - the input {@link Img}
 */
public GaussNativeType( final double[] sigma, final Img<T> input, final OutOfBoundsFactory< T, Img<T> > outOfBounds )
{
  this( sigma, Views.extend( input, outOfBounds ), input, input.factory(), input.firstElement().createVariable() );
}

代码示例来源:origin: net.imglib2/imglib2-ops

@Override
public Img< O > createEmptyOutput( Img< I > in )
{
  try
  {
    return in.factory().imgFactory( m_outType ).create( in, m_outType );
  }
  catch ( IncompatibleTypeException e )
  {
    return new ArrayImgFactory< O >().create( in, m_outType );
  }
}

代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl

/**
 * This inverse FFT can be only done in place, if desired.
 * 
 * @param fftImage - the input as {@link Img}
 * @param forwardTransform - the ForwardTransform ({@link FourierTransform}) which still has all parameters
 * @param type - a Type instance for the output
 */
public InverseFourierTransform( final Img<S> fftImage, final FourierTransform<?,?> forwardTransform, final T type ) throws IncompatibleTypeException
{
  this ( fftImage, fftImage.factory().imgFactory( type ), type, forwardTransform.getRearrangement(), true, true, forwardTransform.getFFTInputSize(), forwardTransform.getFFTInputOffset() );
}

代码示例来源:origin: net.imglib2/imglib2-roi

@Override
  public Labeling< LL > create( final long[] dim )
  {
    return new NativeImgLabeling< LL, I >( img.factory().create( dim, img.firstElement().createVariable() ) );
  }
};

代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl

/**
 * This inverse FFT can be only done in place, if desired.
 * 
 * @param fftImage - the input as {@link Img}
 * @param forwardTransform - the ForwardTransform ({@link FourierTransform}) which still has all parameters
 */
public InverseFourierTransform( final Img<S> fftImage, final FourierTransform<T,?> forwardTransform ) throws IncompatibleTypeException
{
  this ( fftImage, fftImage.factory().imgFactory( forwardTransform.getImageType() ), forwardTransform.getImageType(), forwardTransform.getRearrangement(), true, true, forwardTransform.getFFTInputSize(), forwardTransform.getFFTInputOffset() );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm

protected < T extends BooleanType< T > > Img< T > calculate( final Img< T > source )
{
  final Img< T > target = source.factory().create( source );
  final T extendedVal = source.firstElement().createVariable();
  extendedVal.set( getExtendedValue() );
  final ExtendedRandomAccessibleInterval< T, Img< T > > extended = Views.extendValue( source, extendedVal );
  calculate( extended, target );
  return target;
}

相关文章