本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}