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


Java Interval.dimensions方法代码示例

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


在下文中一共展示了Interval.dimensions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initIntervals

import net.imglib2.Interval; //导入方法依赖的package包/类
private static Interval initIntervals(final Interval src, final int[] axesOfInterest) {

		final long[] dimensionsToIterate = new long[src.numDimensions()];
		src.dimensions(dimensionsToIterate);

		// determine axis to iterate
		for (int i = 0; i < src.numDimensions(); i++) {
			for (int j = 0; j < axesOfInterest.length; j++) {

				if (axesOfInterest[j] == i) {
					dimensionsToIterate[i] = 1;
					break;
				}
			}
		}

		return new FinalInterval(dimensionsToIterate);
	}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:19,代码来源:SlicesII.java

示例2: copyToImageStack

import net.imglib2.Interval; //导入方法依赖的package包/类
public static < T extends NumericType< T > & NativeType< T > > ImagePlus copyToImageStack( final RealRandomAccessible< T > rai, final Interval itvl )
{
	final long[] dimensions = new long[ itvl.numDimensions() ];
	itvl.dimensions( dimensions );

	// create the image plus image
	final T t = rai.realRandomAccess().get();
	final ImagePlusImgFactory< T > factory = new ImagePlusImgFactory< T >();
	final ImagePlusImg< T, ? > target = factory.create( itvl, t );

	double k = 0;
	final long N = dimensions[ 0 ] * dimensions[ 1 ] * dimensions[ 2 ];

	final net.imglib2.Cursor< T > c = target.cursor();
	final RealRandomAccess< T > ra = rai.realRandomAccess();
	while ( c.hasNext() )
	{
		c.fwd();
		ra.setPosition( c );
		c.get().set( ra.get() );

		if ( k % 10000 == 0 )
		{
			IJ.showProgress( k / N );
		}
		k++;
	}

	IJ.showProgress( 1.1 );
	try
	{
		return target.getImagePlus();
	}
	catch ( final ImgLibException e )
	{
		e.printStackTrace();
	}

	return null;
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:41,代码来源:BigWarpRealExporter.java

示例3: SlicesIICursor

import net.imglib2.Interval; //导入方法依赖的package包/类
public SlicesIICursor(final RandomAccessibleInterval<T> src, final Interval fixedAxes, final Interval slice) {
	super(fixedAxes);

	this.src = src;
	this.tmpPosition = new long[fixedAxes.numDimensions()];
	this.sliceDims = new long[slice.numDimensions()];
	this.sliceOffset = new long[slice.numDimensions()];

	slice.dimensions(sliceDims);
	slice.min(sliceOffset);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:12,代码来源:SlicesII.java

示例4: CrossNeighborhoodSkipCenter

import net.imglib2.Interval; //导入方法依赖的package包/类
CrossNeighborhoodSkipCenter( final long[] position, final long[] currentMin, final long[] currentMax, final Interval span, final RandomAccess< T > sourceRandomAccess )
{
	super( position );
	this.currentMin = currentMin;
	this.currentMax = currentMax;
	dimensions = new long[ n ];
	span.dimensions( dimensions );

	size = dimensions[ 0 ];
	for ( int d = 1; d < n; ++d )
		size *= dimensions[ d ];

	this.sourceRandomAccess = sourceRandomAccess;
	this.structuringElementBoundingBox = span;
}
 
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:16,代码来源:CrossNeighborhoodSkipCenter.java

示例5: openVirtuallyFused

import net.imglib2.Interval; //导入方法依赖的package包/类
public static <S extends AbstractSequenceDescription< ?,? extends BasicViewDescription<? extends BasicViewSetup>, ?  >>
	List<RandomAccessibleInterval< FloatType >> openVirtuallyFused(
			S sd,
			ViewRegistrations vrs,
			Collection<? extends Collection<ViewId>> views,
			Interval boundingBox,
			double[] downsamplingFactors)
{
	final BasicImgLoader imgLoader = sd.getImgLoader();
	
	final List<RandomAccessibleInterval< FloatType >> openImgs = new ArrayList<>();
	final Interval bbSc = TransformVirtual.scaleBoundingBox( new FinalInterval( boundingBox ), inverse( downsamplingFactors ));
	
	final long[] dim = new long[ bbSc.numDimensions() ];
	bbSc.dimensions( dim );
	
	
	for (Collection<ViewId> viewGroup : views)
	{
		final ArrayList< RandomAccessibleInterval< FloatType > > images = new ArrayList<>();
		final ArrayList< RandomAccessibleInterval< FloatType > > weights = new ArrayList<>();
		
		for ( final ViewId viewId : viewGroup )
		{
			final ViewRegistration vr = vrs.getViewRegistration( viewId );
			vr.updateModel();
			AffineTransform3D model = vr.getModel();

			final float[] blending = Util.getArrayFromValue( FusionTools.defaultBlendingRange, 3 );
			final float[] border = Util.getArrayFromValue( FusionTools.defaultBlendingBorder, 3 );

			model = model.copy();
			TransformVirtual.scaleTransform( model, inverse(downsamplingFactors) );

			final RandomAccessibleInterval inputImg = DownsampleTools.openDownsampled( imgLoader, viewId, model );

			System.out.println( model.inverse() );

			FusionTools.adjustBlending( sd.getViewDescriptions().get( viewId ), blending, border, model );

			images.add( TransformView.transformView( inputImg, model, bbSc, 0, 1 ) );
			weights.add( TransformWeight.transformBlending( inputImg, border, blending, model, bbSc ) );
		}
		
		openImgs.add( new FusedRandomAccessibleInterval( new FinalInterval( dim ), images, weights ) );
		
	}		
	
	return openImgs;
	
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:52,代码来源:DisplayOverlapTestPopup.java


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