本文整理了Java中net.imglib2.img.Img.dimensions()
方法的一些代码示例,展示了Img.dimensions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Img.dimensions()
方法的具体详情如下:
包路径:net.imglib2.img.Img
类名称:Img
方法名:dimensions
暂无
代码示例来源:origin: imglib/imglib2
@Override
public void dimensions( final long[] dimensions )
{
counts.dimensions( dimensions );
}
代码示例来源:origin: net.imglib2/imglib2-script
@Override
public void dimensions(long[] dimensions) {
img.dimensions(dimensions);
}
代码示例来源:origin: net.imglib2/imglib2-algorithms-legacy
public void setInputImage( final Img<T> image )
{
this.input = image;
if ( input != null )
image.dimensions( this.imgSize );
else
this.imgSize = null;
}
代码示例来源:origin: net.imglib2/imglib2
@Override
public void dimensions( final long[] dimensions )
{
counts.dimensions( dimensions );
}
代码示例来源:origin: net.imagej/imagej-deprecated
@Override
public void dimensions(final long[] dimensions) {
img.dimensions(dimensions);
}
代码示例来源:origin: net.imagej/imagej-common
@Override
public void dimensions(final long[] dimensions) {
img.dimensions(dimensions);
}
代码示例来源:origin: net.imglib2/imglib2-meta
@Override
public void dimensions(final long[] dimensions) {
img.dimensions(dimensions);
}
代码示例来源:origin: sc.fiji/Image_Expression_Parser
/**
* Check that all images have the same dimensions.
*/
private boolean dimensionsAreValid()
{
if ( image_map.size() == 1 ) { return true; }
final Collection< Img< T > > images = image_map.values();
final Iterator< Img< T > > it = images.iterator();
Img< T > img = it.next();
long[] previous_dims = new long[ img.numDimensions() ];
img.dimensions( previous_dims );
long[] dims;
while ( it.hasNext() )
{
img = it.next();
dims = new long[ img.numDimensions() ];
img.dimensions( dims );
if ( previous_dims.length != dims.length ) { return false; }
for ( int j = 0; j < dims.length; j++ )
{
if ( dims[ j ] != previous_dims[ j ] ) { return false; }
}
previous_dims = dims;
}
return true;
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
/**
* Returns the bounding box so that all images can fit in there
* or null if input is null or input.size is 0
*
* @param images input images
* @param <T> pixel type
* @return largest size in every dimension or null
*/
public static < T extends Type< T > > long[] commonSize( final List< Img< T > > images )
{
if ( images == null || images.size() == 0 )
return null;
final long[] size = new long[ images.get( 0 ).numDimensions() ];
images.get( 0 ).dimensions( size );
for ( final Img< T > image : images )
for ( int d = 0; d < image.numDimensions(); ++d )
size[ d ] = Math.max( size[ d ], image.dimension( d ) );
return size;
}
}
代码示例来源:origin: net.imglib2/imglib2-ops
private static long[] determineSharedExtents( Img< ? >... imgs )
{
if ( imgs.length == 0 )
throw new IllegalArgumentException(
"at least one image must be provided" );
int numDims = imgs[ 0 ].numDimensions();
long[] commonRegion = new long[ numDims ];
imgs[ 0 ].dimensions( commonRegion );
for ( int i = 1; i < imgs.length; i++ )
{
if ( imgs[ i ].numDimensions() != numDims )
throw new IllegalArgumentException(
"images do not have compatible dimensions" );
for ( int d = 0; d < numDims; d++ )
{
commonRegion[d] = Math.min( imgs[i].dimension(d), commonRegion[d] );
}
}
return commonRegion;
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
@SuppressWarnings("unchecked")
public ArrayImg< FloatType, ? > getPSFCopyArrayImg()
{
final ArrayImg< FloatType, ? > arrayImg;
if ( img == null )
{
img = arrayImg = IOFunctions.openAs32BitArrayImg( new File( new File( xmlBasePath, subDir ), file ) );
}
else if ( ArrayImg.class.isInstance( img ) )
{
arrayImg = (ArrayImg< FloatType, ? >)img;
}
else
{
final long[] size = new long[ img.numDimensions() ];
img.dimensions( size );
arrayImg = new ArrayImgFactory< FloatType >().create( size, new FloatType() );
FusionTools.copyImg( img, arrayImg, null );
}
return arrayImg;
}
代码示例来源:origin: net.imglib2/imglib2-ops
/**
* Creates an output image by applying a UnaryOperation to an input image.
* The size of the output image matches the size of the input image.
*
* @param op
* The UnaryOperation used to generate the output image from the
* input image.
* @param input
* The input Img.
* @param imgFactory
* The factory used to create the output image.
* @param type
* The type of the output image.
* @return The computed pixel output image of specified type.
*/
public static < I extends RealType< I >, O extends RealType< O >>
Img< O > applyOp(
UnaryOperation< I, O > op, Img< I > input, ImgFactory< O > imgFactory,
O type )
{
long[] span = new long[ input.numDimensions() ];
input.dimensions( span );
Img< O > output = imgFactory.create( span, type );
unaryAssign( op, input, output, span );
return output;
}
代码示例来源:origin: net.imglib2/imglib2-algorithms-legacy
public DownSample( final Img<T> image, final long[] newSize, final float sourceSigma, final float targetSigma )
{
this.input = image;
this.newSize = newSize.clone();
setSourceSigma( sourceSigma );
setTargetSigma( targetSigma );
if ( input != null )
{
this.imgSize = new long[ input.numDimensions() ];
image.dimensions( imgSize );
this.scaling = new float[ image.numDimensions() ];
for ( int d = 0; d < image.numDimensions(); ++d )
this.scaling[ d ] = (float)imgSize[ d ] / (float)newSize[ d ];
}
else
{
this.imgSize = null;
this.scaling = null;
}
setNumThreads();
this.processingTime = -1;
}
代码示例来源:origin: imagej/imagej-ops
/** Test basic properties of the op's output */
@Test
public void testOutput() throws Exception {
// SETUP
final long[] inputDims = { 3, 3, 3 };
final Img<BitType> img = ArrayImgs.bits(inputDims);
// EXECUTE
final Img<BitType> result = (Img<BitType>) ops.morphology().outline(img,
Boolean.TRUE);
// VERIFY
assertNotNull(result);
final long[] outputDims = new long[result.numDimensions()];
result.dimensions(outputDims);
assertArrayEquals(inputDims, outputDims);
}
代码示例来源:origin: imglib/imglib2
int[] getImgAsInts( final Img< IntType > img )
{
final RandomAccess< IntType > a = img.randomAccess();
final int N = ( int ) img.size();
final int[] data = new int[ N ];
final long[] dim = new long[ img.numDimensions() ];
final long[] pos = new long[ img.numDimensions() ];
img.dimensions( dim );
for ( int i = 0; i < N; ++i )
{
IntervalIndexer.indexToPosition( i, dim, pos );
a.setPosition( pos );
data[ i ] = a.get().get();
}
return data;
}
代码示例来源:origin: imglib/imglib2
static int[] getImgAsInts( final Img< IntType > img )
{
final RandomAccess< IntType > a = img.randomAccess();
final int N = ( int ) img.size();
final int[] data = new int[ N ];
final long[] dim = new long[ img.numDimensions() ];
final long[] pos = new long[ img.numDimensions() ];
img.dimensions( dim );
for ( int i = 0; i < N; ++i )
{
IntervalIndexer.indexToPosition( i, dim, pos );
a.setPosition( pos );
data[ i ] = a.get().get();
}
return data;
}
代码示例来源:origin: imglib/imglib2
int[] getImgAsInts( final Img< IntType > img )
{
final RandomAccess< IntType > a = img.randomAccess();
final int N = ( int ) img.size();
final int[] data = new int[ N ];
final long[] dim = new long[ img.numDimensions() ];
final long[] pos = new long[ img.numDimensions() ];
img.dimensions( dim );
for ( int i = 0; i < N; ++i )
{
IntervalIndexer.indexToPosition( i, dim, pos );
a.setPosition( pos );
data[ i ] = a.get().get();
}
return data;
}
代码示例来源:origin: imglib/imglib2
int[] getImgAsInts( final Img< IntType > img )
{
final RandomAccess< IntType > a = img.randomAccess();
final int N = ( int ) img.size();
final int[] data = new int[ N ];
final long[] dim = new long[ img.numDimensions() ];
final long[] pos = new long[ img.numDimensions() ];
img.dimensions( dim );
for ( int i = 0; i < N; ++i )
{
IntervalIndexer.indexToPosition( i, dim, pos );
a.setPosition( pos );
data[ i ] = a.get().get();
}
return data;
}
代码示例来源:origin: fiji/Stitching
img.dimensions( dimensions );
final float percentScaling = 0.2f;
final double[] border = new double[ numDimensions ];
代码示例来源:origin: imglib/imglib2
int[] getImgAsInts( final Img< IntType > img )
{
final RandomAccess< IntType > a = img.randomAccess();
final int N = ( int ) img.size();
final int[] data = new int[ N ];
final long[] dim = new long[ img.numDimensions() ];
final long[] pos = new long[ img.numDimensions() ];
img.dimensions( dim );
for ( int i = 0; i < N; ++i )
{
IntervalIndexer.indexToPosition( i, dim, pos );
a.setPosition( pos );
data[ i ] = a.get().get();
}
return data;
}
内容来源于网络,如有侵权,请联系作者删除!