net.imglib2.Dimensions.dimensions()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(135)

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

Dimensions.dimensions介绍

[英]Write the number of pixels in each dimension into long[].
[中]将每个维度中的像素数写入long[]。

代码示例

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

private static long[] dimensions( final Dimensions img )
  {
    final long[] dimensions = new long[ img.numDimensions() ];
    img.dimensions( dimensions );
    return dimensions;
  }
}

代码示例来源:origin: imglib/imglib2

private static long[] dimensions( final Dimensions img )
  {
    final long[] dimensions = new long[ img.numDimensions() ];
    img.dimensions( dimensions );
    return dimensions;
  }
}

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

/**
 * Gets the dimensions of a {@link Dimensions}.
 */
public static long[] getDims(final Dimensions dimensions) {
  final long[] dims = new long[dimensions.numDimensions()];
  dimensions.dimensions(dims);
  return dims;
}

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

/**
 * Gets the dimensions of a {@link Dimensions}.
 * 
 * @deprecated Use {@link net.imglib2.util.Intervals#dimensionsAsLongArray}
 *             instead.
 */
@Deprecated
public static long[] getDims(final Dimensions dimensions) {
  final long[] dims = new long[dimensions.numDimensions()];
  dimensions.dimensions(dims);
  return dims;
}

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

private static long[] dims(Dimensions d) {
  final long[] dims = new long[d.numDimensions()];
  d.dimensions(dims);
  return dims;
}

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

/**
 * Create a <code>long[]</code> with the dimensions of a {@link Dimensions}.
 * 
 * <p>
 * Keep in mind that creating arrays wildly is not good practice and
 * consider using the interval directly. See
 * {@link Dimensions#dimensions(long[])}.
 * </p>
 * 
 * @param dimensions
 *            something which has dimensions
 * 
 * @return dimensions as a new <code>long[]</code>
 */
public static long[] dimensionsAsLongArray( final Dimensions dimensions )
{
  final long[] dims = new long[ dimensions.numDimensions() ];
  dimensions.dimensions( dims );
  return dims;
}

代码示例来源:origin: imglib/imglib2

/**
 * Create a <code>long[]</code> with the dimensions of a {@link Dimensions}.
 * 
 * <p>
 * Keep in mind that creating arrays wildly is not good practice and
 * consider using the interval directly. See
 * {@link Dimensions#dimensions(long[])}.
 * </p>
 * 
 * @param dimensions
 *            something which has dimensions
 * 
 * @return dimensions as a new <code>long[]</code>
 */
public static long[] dimensionsAsLongArray( final Dimensions dimensions )
{
  final long[] dims = new long[ dimensions.numDimensions() ];
  dimensions.dimensions( dims );
  return dims;
}

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

static long[][] getTempImageDimensions( final Dimensions targetsize, final double[][] halfkernels )
{
  final int n = targetsize.numDimensions();
  final long[][] tmpdims = new long[ n ][];
  tmpdims[ n - 1 ] = new long[ n ];
  targetsize.dimensions( tmpdims[ n - 1 ] );
  for ( int d = n - 2; d >= 0; --d )
  {
    tmpdims[ d ] = tmpdims[ d + 1 ].clone();
    tmpdims[ d ][ d + 1 ] += 2 * halfkernels[ d + 1 ].length - 2;
  }
  return tmpdims;
}

代码示例来源:origin: imglib/imglib2

/**
 * Create an {@code Img<T>} with the specified {@code dimensions}.
 *
 * @return new image with the specified {@code dimensions}.
 */
public Img< T > create( final Dimensions dimensions )
{
  final long[] size = new long[ dimensions.numDimensions() ];
  dimensions.dimensions( size );
  return create( size );
}

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

/**
 * Create an {@code Img<T>} with the specified {@code dimensions}.
 *
 * @return new image with the specified {@code dimensions}.
 */
public Img< T > create( final Dimensions dimensions )
{
  final long[] size = new long[ dimensions.numDimensions() ];
  dimensions.dimensions( size );
  return create( size );
}

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

@Deprecated
public Img< T > create( final Dimensions dim, final T type )
{
  final long[] size = new long[ dim.numDimensions() ];
  dim.dimensions( size );
  cache( type );
  return create( size, type );
}

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

@Override
public Dataset create(final Dimensions dimensions) {
  final long[] size = new long[dimensions.numDimensions()];
  dimensions.dimensions(size);
  return create(size);
}

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

static long[][] getTempImageDimensions( final Dimensions targetsize, final double[][] halfkernels )
{
  final int n = targetsize.numDimensions();
  final long[][] tmpdims = new long[ n ][];
  tmpdims[ n - 1 ] = new long[ n ];
  targetsize.dimensions( tmpdims[ n - 1 ] );
  for( int d = n - 2; d >= 0; --d )
  {
    tmpdims[ d ] = tmpdims[ d + 1 ].clone();
    tmpdims[ d ][ d + 1 ] += 2 * halfkernels[ d + 1 ].length;
  }
  return tmpdims;
}

代码示例来源:origin: imglib/imglib2

@Deprecated
public Img< T > create( final Dimensions dim, final T type )
{
  final long[] size = new long[ dim.numDimensions() ];
  dim.dimensions( size );
  cache( type );
  return create( size, type );
}

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

@Override
public ImagePlusImg< T, ? > create( final Dimensions dim, final T type )
{
  final long[] size = new long[ dim.numDimensions() ];
  dim.dimensions( size );
  return create( size, type );
}

代码示例来源:origin: imagej/imagej-ops

@Override
  @SuppressWarnings("unchecked")
  public O calculate(final I input, final Dimensions paddedDimensions) {

    final long[] paddedSize = new long[paddedDimensions.numDimensions()];
    paddedDimensions.dimensions(paddedSize);

    O inputInterval = (O) FFTMethods.paddingIntervalCentered(input,
      FinalDimensions.wrap(paddedSize));

    return inputInterval;
  }
}

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

private K binaryop( ConnectedType type, final K r, final K op, final boolean erode, final int count )
  r.dimensions( dim );
  switch ( r.numDimensions() )

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

FloodFill< BitType, K > ff = new FloodFill< BitType, K >( m_connectedType );
long[] dim = new long[ r.numDimensions() ];
r.dimensions( dim );
Cursor< BitType > rc = r.cursor();
Cursor< BitType > opc = op.localizingCursor();

代码示例来源:origin: net.preibisch/multiview-reconstruction

@SuppressWarnings("unchecked")
public <T extends RealType< T > & NativeType< T >> RandomAccessibleInterval< T > createVirtual(
    final IFormatReader reader,
    final File file,
    final int series,
    final int channel,
    final int timepoint,
    T type,
    Dimensions dim) throws IncompatibleTypeException
{
  setReaderFileAndSeriesIfNecessary( reader, file, series );
  final boolean isLittleEndian = reader.isLittleEndian();		
  final long[] dims = new long[]{reader.getSizeX(), reader.getSizeY(), reader.getSizeZ()};
  if (dim != null)
    dim.dimensions( dims );
  final int pixelType = reader.getPixelType();
  if (pixelType == FormatTools.UINT8)
    return new VirtualRandomAccessibleIntervalLOCI< T >( reader, file, dims, series, channel, timepoint, type == null ? (T) new UnsignedByteType() : type, (t, buf, i) -> {t.setReal( (int) buf[i] & 0xff);} );
  else if (pixelType == FormatTools.UINT16)
    return new VirtualRandomAccessibleIntervalLOCI< T >( reader, file, dims, series, channel, timepoint, type == null ? (T) new UnsignedShortType() : type, (t, buf, i) -> {t.setReal( LegacyStackImgLoaderLOCI.getShortValueInt( buf, i*2, isLittleEndian ) );} );
  else if (pixelType == FormatTools.INT16)
    return new VirtualRandomAccessibleIntervalLOCI< T >( reader, file, dims, series, channel, timepoint, type == null ? (T) new ShortType() : type, (t, buf, i) -> {t.setReal( LegacyStackImgLoaderLOCI.getShortValue( buf, i*2, isLittleEndian ) );} );
  else if (pixelType == FormatTools.UINT32)
    return new VirtualRandomAccessibleIntervalLOCI< T >( reader, file, dims, series, channel, timepoint, type == null ? (T) new UnsignedIntType() : type, (t, buf, i) -> {t.setReal( LegacyStackImgLoaderLOCI.getIntValue( buf, i*4, isLittleEndian ) );} );
  else if (pixelType == FormatTools.FLOAT)
    return new VirtualRandomAccessibleIntervalLOCI< T >( reader, file, dims, series, channel, timepoint, type == null ? (T) new FloatType() : type, (t, buf, i) -> {t.setReal( LegacyStackImgLoaderLOCI.getFloatValue( buf, i*4, isLittleEndian ) );} );
  else
    throw new IncompatibleTypeException( this, "cannot create virtual image for this pixel type" );
}

代码示例来源:origin: net.preibisch/multiview-reconstruction

dim.dimensions( dims );

相关文章