当前位置: 首页>>代码示例>>Java>>正文


Java RealInterval.realMax方法代码示例

本文整理汇总了Java中net.imglib2.RealInterval.realMax方法的典型用法代码示例。如果您正苦于以下问题:Java RealInterval.realMax方法的具体用法?Java RealInterval.realMax怎么用?Java RealInterval.realMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.imglib2.RealInterval的用法示例。


在下文中一共展示了RealInterval.realMax方法的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);
	}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:24,代码来源:TransformTools.java

示例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;
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:22,代码来源:TransformTools.java

示例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;
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:7,代码来源:Util.java

示例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 );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:51,代码来源:ExtractPSF.java


注:本文中的net.imglib2.RealInterval.realMax方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。