本文整理汇总了Java中net.imglib2.util.Util.getArrayFromValue方法的典型用法代码示例。如果您正苦于以下问题:Java Util.getArrayFromValue方法的具体用法?Java Util.getArrayFromValue怎么用?Java Util.getArrayFromValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.util.Util
的用法示例。
在下文中一共展示了Util.getArrayFromValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeXZProjection
import net.imglib2.util.Util; //导入方法依赖的package包/类
public static final AffineTransform3D makeXZProjection( final ImagePlus imp )
{
final AffineTransform3D transform = new AffineTransform3D();
final double[] calibration = Util.getArrayFromValue( 1d, 3 );
calibration[ 0 ] = imp.getCalibration().pixelWidth;
calibration[ 1 ] = imp.getCalibration().pixelHeight;
if ( imp.getNSlices() > 1 )
calibration[ 2 ] = imp.getCalibration().pixelDepth;
transform.set( 1 / calibration[ 0 ], 0, 0, 0, 0, 0, -1 / calibration[ 1 ], imp.getHeight(), 0, 1 / calibration[ 2 ], 0, 0 );
return transform;
}
示例2: makeYZProjection
import net.imglib2.util.Util; //导入方法依赖的package包/类
public static final AffineTransform3D makeYZProjection( final ImagePlus imp )
{
final AffineTransform3D transform = new AffineTransform3D();
final double[] calibration = Util.getArrayFromValue( 1d, 3 );
calibration[ 0 ] = imp.getCalibration().pixelWidth;
calibration[ 1 ] = imp.getCalibration().pixelHeight;
if ( imp.getNSlices() > 1 )
calibration[ 2 ] = imp.getCalibration().pixelDepth;
transform.set( 0, 0, 1 / calibration[ 0 ], 0, 0, 1 / calibration[ 1 ], 0, 0, -1 / calibration[ 2 ], 0, 0, imp.getNSlices() );
return transform;
}
示例3: getTransformFromCalibration
import net.imglib2.util.Util; //导入方法依赖的package包/类
public static final AffineTransform3D getTransformFromCalibration( final ImagePlus imp )
{
final AffineTransform3D transform = new AffineTransform3D();
final double[] calibration = Util.getArrayFromValue( 1d, 3 );
calibration[ 0 ] = imp.getCalibration().pixelWidth;
calibration[ 1 ] = imp.getCalibration().pixelHeight;
if ( imp.getNSlices() > 1 )
calibration[ 2 ] = imp.getCalibration().pixelDepth;
transform.set( 1 / calibration[ 0 ], 0, 0, 0, 0, 1 / calibration[ 1 ], 0, 0, 0, 0, 1 / calibration[ 2 ], 0 );
return transform;
}
示例4: openVirtuallyFused
import net.imglib2.util.Util; //导入方法依赖的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;
}