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


Java RandomAccessibleInterval.randomAccess方法代码示例

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


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

示例1: copy

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private static <T extends RealType<T>> void copy(
	final RandomAccessibleInterval<T> source,
	final IterableInterval<T> dest)
{
	final RandomAccess<T> sourceAccess = source.randomAccess();
	final Cursor<T> destCursor = dest.localizingCursor();
	while (destCursor.hasNext()) {
		destCursor.fwd();
		sourceAccess.setPosition(destCursor);
		destCursor.get().set(sourceAccess.get());
	}
}
 
开发者ID:imagej,项目名称:imagej-tensorflow,代码行数:13,代码来源:Tensors.java

示例2: sampleIntercepts

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private static <B extends BooleanType<B>> long sampleIntercepts(
	final RandomAccessibleInterval<B> interval, final Section section,
	final double increment, final Random random)
{
	// Add a random offset so that sampling doesn't always start from the same
	// plane
	final double startT = section.tMin + random.nextDouble() * increment;
	if (startT > section.tMax) {
		return -1;
	}
	final Vector3d samplePoint = new Vector3d(section.direction);
	samplePoint.scale(startT);
	samplePoint.add(section.origin);
	final Vector3d gap = new Vector3d(section.direction);
	gap.scale(increment);
	long intercepts = 0;
	long samples = 0;
	final RandomAccess<B> access = interval.randomAccess();
	boolean previous = sampleVoxel(access, samplePoint);
	final long iterations = (long) Math.ceil((section.tMax - startT) /
		increment);
	for (long i = 0; i < iterations; i++) {
		final boolean current = sampleVoxel(access, samplePoint);
		if (current != previous) {
			intercepts++;
		}
		previous = current;
		samplePoint.add(gap);
		samples++;
	}
	return samples >= 2 ? intercepts : -1;
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:33,代码来源:MILGrid.java

示例3: computeInverseHessian

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
/**
 * Compute the inverse Hessian matrix from the the steepest descent images.
 * @param descent descent image
 * @param <T> pixel type
 * @return Hessian
 */
public static <T extends RealType< T >> double[][] computeInverseHessian(
		final RandomAccessibleInterval< T > descent)
{
	final int n = descent.numDimensions() - 1;
	final int numParameters = (int) descent.dimension( n );
	final long[] dim = new long[n + 1];
	descent.dimensions( dim );
	dim[n] = 1;
	final LocalizingIntervalIterator pos = new LocalizingIntervalIterator( dim );
	final RandomAccess< T > r = descent.randomAccess();
	final double[] deriv = new double[numParameters];
	final double[][] H = new double[numParameters][numParameters];
	while ( pos.hasNext() )
	{
		pos.fwd();
		r.setPosition( pos );
		for ( int p = 0; p < numParameters; ++p )
		{
			deriv[p] = r.get().getRealDouble();
			r.fwd( n );
		}
		for ( int i = 0; i < numParameters; ++i )
			for ( int j = 0; j < numParameters; ++j )
				H[i][j] += deriv[i] * deriv[j];
	}
	return new Matrix( H ).inverse().getArray();
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:34,代码来源:Align.java

示例4: copyRealImage

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
public static <T extends RealType<T>, S extends RealType<S>> void copyRealImage(IterableInterval<T> source, RandomAccessibleInterval<S> dest) {
	RandomAccess<S> destRA = dest.randomAccess();
	Cursor<T> srcC = source.cursor();
	
	
	while (srcC.hasNext()){
		srcC.fwd();
		destRA.setPosition(srcC);
		destRA.get().setReal(srcC.get().getRealDouble());
	}
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:12,代码来源:ImgLib2Util.java

示例5: createNewStoreAndCopyOldContents

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private synchronized void createNewStoreAndCopyOldContents()
{
	RandomAccessibleInterval< T > newStore = this.factory.createStore( this.min, this.max, t );
	Cursor< T > cursor = Views.iterable( this.store ).cursor();
	RandomAccess< T > access = newStore.randomAccess();
	while ( cursor.hasNext() )
	{
		T val = cursor.next();
		access.setPosition( cursor );
		access.get().set( val );
	}
	this.store = newStore;
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:14,代码来源:GrowingStoreRandomAccessible.java

示例6: createNewStoreAndCopyOldContents

import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private void createNewStoreAndCopyOldContents()
{
	RandomAccessibleInterval< T > newStore = this.factory.createStore( this.min, this.max, t );
	Cursor< T > cursor = Views.iterable( this.store ).cursor();
	RandomAccess< T > access = newStore.randomAccess();
	while ( cursor.hasNext() )
	{
		T val = cursor.next();
		access.setPosition( cursor );
		access.get().set( val );
	}
	this.store = newStore;
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:14,代码来源:GrowingStoreRandomAccessibleSingletonAccess.java


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