本文整理汇总了Java中net.imglib2.RealInterval.realMin方法的典型用法代码示例。如果您正苦于以下问题:Java RealInterval.realMin方法的具体用法?Java RealInterval.realMin怎么用?Java RealInterval.realMin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.RealInterval
的用法示例。
在下文中一共展示了RealInterval.realMin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyTranslation
import net.imglib2.RealInterval; //导入方法依赖的package包/类
public static FinalRealInterval applyTranslation(RealInterval img, TranslationGet translation, boolean[] ignoreDims){
// get number of dimensions we actually use
int n = 0;
for (int d = 0; d < ignoreDims.length; ++d)
if (!ignoreDims[d])
n++;
final double [] min = new double [n];
final double [] max = new double [n];
int i2 = 0;
for (int i = 0; i< img.numDimensions();++i)
{
if (!ignoreDims[i])
{
min[i2] = img.realMin(i) + translation.getTranslation(i);
max[i2] = img.realMax(i) + translation.getTranslation(i);
i2++;
}
}
return new FinalRealInterval(min, max);
}
示例2: printRealInterval
import net.imglib2.RealInterval; //导入方法依赖的package包/类
public static String printRealInterval( final RealInterval interval )
{
String out = "(Interval empty)";
if ( interval == null || interval.numDimensions() == 0 )
return out;
out = "[" + interval.realMin( 0 );
for ( int i = 1; i < interval.numDimensions(); i++ )
out += ", " + interval.realMin( i );
out += "] -> [" + interval.realMax( 0 );
for ( int i = 1; i < interval.numDimensions(); i++ )
out += ", " + interval.realMax( i );
out += "]";
return out;
}
示例3: intervalDimensions
import net.imglib2.RealInterval; //导入方法依赖的package包/类
static public final long[] intervalDimensions(final RealInterval iri) {
final long[] dim = new long[iri.numDimensions()];
for (int d=0; d<dim.length; ++d)
dim[d] = (long) (iri.realMax(d) - iri.realMin(d) + 1);
return dim;
}
示例4: transformPSF
import net.imglib2.RealInterval; //导入方法依赖的package包/类
/**
* Transforms the extracted PSF using the affine transformation of the corresponding view
*
* @param psf - the extracted psf (NOT z-scaling corrected)
* @param model - the transformation model
* @return the transformed psf which has odd sizes and where the center of the psf is also the center of the transformed psf
*/
protected static < T extends RealType< T > & NativeType< T > > ArrayImg< T, ? > transformPSF(
final RandomAccessibleInterval< T > psf,
final AffineTransform3D model )
{
// here we compute a slightly different transformation than the ImageTransform does
// two things are necessary:
// a) the center pixel stays the center pixel
// b) the transformed psf has a odd size in all dimensions
final int numDimensions = psf.numDimensions();
final RealInterval minMaxDim = model.estimateBounds( psf );
final double[] size = new double[ numDimensions ];
final long[] newSize = new long[ numDimensions ];
final double[] offset = new double[ numDimensions ];
// the center of the psf has to be the center of the transformed psf as well
// this is important!
final double[] center = new double[ numDimensions ];
final double[] tmp = new double[ numDimensions ];
for ( int d = 0; d < numDimensions; ++d )
center[ d ] = psf.dimension( d ) / 2;
model.apply( center, tmp );
for ( int d = 0; d < numDimensions; ++d )
{
size[ d ] = minMaxDim.realMax( d ) - minMaxDim.realMin( d );
newSize[ d ] = (int)size[ d ] + 1;
if ( newSize[ d ] % 2 == 0 )
++newSize[ d ];
// the offset is defined like this:
// the transformed coordinates of the center of the psf
// are the center of the transformed psf
offset[ d ] = tmp[ d ] - newSize[ d ]/2;
}
return transform( psf, model, newSize, offset );
}