本文整理了Java中net.imglib2.util.Util.getArrayFromValue()
方法的一些代码示例,展示了Util.getArrayFromValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getArrayFromValue()
方法的具体详情如下:
包路径:net.imglib2.util.Util
类名称:Util
方法名:getArrayFromValue
暂无
代码示例来源:origin: net.preibisch/multiview-reconstruction
public void fuseGroups()
{
this.downsampledBB = fuseGroups(
spimData,
images,
unnormalizedWeights,
models,
groups,
bb,
downsampling,
useWeightsFusion ? Util.getArrayFromValue( blendingRangeFusion, 3 ) : null,
useWeightsFusion ? Util.getArrayFromValue( blendingBorderFusion, 3 ) : null,
useWeightsDecon ? Util.getArrayFromValue( blendingRangeDeconvolution, 3 ) : null,
useWeightsDecon ? Util.getArrayFromValue( blendingBorderDeconvolution, 3 ) : null,
intensityAdjustments );
}
代码示例来源:origin: net.imglib2/imglib2-algorithms-legacy
public static <T extends RealType<T>, S extends RealType<S>> double testCrossCorrelation( final long[] shift, final Img<T> image1, final Img<S> image2, final int minOverlapPx, final long[] numPixels )
{
return testCrossCorrelation( shift, image1, image2, Util.getArrayFromValue( minOverlapPx, image1.numDimensions()), numPixels );
}
代码示例来源:origin: net.preibisch/multiview-simulation
public RealInterval getTilesExtent()
{
final Dimensions dims = intervalRender;
double[] mins = Util.getArrayFromValue( Double.MAX_VALUE, dims.numDimensions() );
double[] maxs = Util.getArrayFromValue( -Double.MAX_VALUE, dims.numDimensions() );
for (AffineTransform3D tt : tileTransforms.values())
{
for (int d = 0; d < dims.numDimensions(); d++)
{
mins[d] = Math.min( mins[d], -tt.getTranslation()[d] );
maxs[d] = Math.max( maxs[d], -tt.getTranslation()[d] + dims.dimension( d ) );
}
}
return new FinalRealInterval( mins, maxs );
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
public static enum ImgDataType { VIRTUAL, CACHED, PRECOMPUTED };
public static String[] imgDataTypeChoice = new String[]{ "Virtual", "Cached", "Precompute Image" };
代码示例来源:origin: fiji/TrackMate
public static double[] getSpatialCalibration( final ImagePlus imp )
{
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;
}
return calibration;
}
代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl
/**
* Return the xyz calibration stored in an {@link Metadata} in a 3-elements
* double array. Calibration is ordered as X, Y, Z. If one axis is not found,
* then the calibration for this axis takes the value of 1.
*/
public static final double[] getSpatialCalibration(final Metadata img) {
final double[] calibration = Util.getArrayFromValue(1d, 3);
for (int d = 0; d < img.numDimensions(); d++) {
if (img.axis(d).equals(Axes.X)) {
calibration[0] = img.calibration(d);
} else if (img.axis(d).equals(Axes.Y)) {
calibration[1] = img.calibration(d);
} else if (img.axis(d).equals(Axes.Z)) {
calibration[2] = img.calibration(d);
}
}
return calibration;
}
代码示例来源:origin: sc.fiji/TrackMate_
public static double[] getSpatialCalibration( final ImagePlus imp )
{
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;
}
return calibration;
}
代码示例来源:origin: net.preibisch/multiview-simulation
public static void main( String[] args )
{
new ImageJ();
final double overlap = 0.2;
final float snr = 8;
final SimulateTileStitching sts = new SimulateTileStitching( new Random( System.currentTimeMillis() ), true, Util.getArrayFromValue( overlap, 3 ) );
IJ.log( "Known shift (right relative to left): " + Util.printCoordinates( sts.getCorrectTranslation() ) );
final Pair< Img< FloatType >, Img< FloatType > > pair = sts.getNextPair( snr );
show( pair.getA(), "left" );
show( pair.getB(), "right" );
}
}
代码示例来源:origin: net.imglib2/imglib2-algorithm
public static final Neighborhood< BitType > getNeighborhood( final Shape shape, final EuclideanSpace space )
{
final int numDims = space.numDimensions();
final long[] dimensions = Util.getArrayFromValue( 1l, numDims );
final ArrayImg< BitType, LongArray > img = ArrayImgs.bits( dimensions );
final IterableInterval< Neighborhood< BitType >> neighborhoods = shape.neighborhoods( img );
final Neighborhood< BitType > neighborhood = neighborhoods.cursor().next();
return neighborhood;
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
Gauss3.gauss( Util.getArrayFromValue( sigma, psi.numDimensions() ), Views.extendMirrorSingle( psi ), psi, service );
代码示例来源:origin: net.preibisch/multiview-reconstruction
final float[] blending = Util.getArrayFromValue( FusionTools.defaultBlendingRange, 3 );
final float[] border = Util.getArrayFromValue( FusionTools.defaultBlendingBorder, 3 );
代码示例来源:origin: net.preibisch/multiview-reconstruction
public static void testContentBased( final Img< FloatType > img )
{
final double[] sigma1 = Util.getArrayFromValue( FusionTools.defaultContentBasedSigma1, 3 );
final double[] sigma2 = Util.getArrayFromValue( FusionTools.defaultContentBasedSigma2 / 10, 3 );
final double scaling = 2.0;
sigma1[ 0 ] /= scaling;
sigma2[ 0 ] /= scaling;
sigma1[ 1 ] /= scaling;
sigma2[ 1 ] /= scaling;
sigma1[ 2 ] /= scaling * 5.0;
sigma2[ 2 ] /= scaling * 5.0;
IOFunctions.println( "Computing ... " + Util.printCoordinates( sigma1 ) + ", " + Util.printCoordinates( sigma2 ) );
ContentBasedRealRandomAccessible< FloatType > cb = new ContentBasedRealRandomAccessible< FloatType >( img, img.factory().imgFactory( new ComplexFloatType() ), sigma1, sigma2 );
IOFunctions.println( "Done ... " );
final ImagePlus imp = DisplayImage.getImagePlusInstance( cb.getContentBasedImg(), true, "brain", Double.NaN, Double.NaN );
imp.show();
}
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
final RandomAccessibleInterval transformedInput = TransformView.transformView( inputImg, model, bb, 0, 1 );
final float[] blending = Util.getArrayFromValue( FusionTools.defaultBlendingRange, 3 );
final float[] border = Util.getArrayFromValue( FusionTools.defaultBlendingBorder, 3 );
System.out.println( "Default blending = " + Util.printCoordinates( blending ) );
System.out.println( "Default border = " + Util.printCoordinates( border ) );
final RandomAccessibleInterval< FloatType > transformedBlending = TransformWeight.transformBlending( inputImg, border, blending, model, bb );
final double[] sigma1 = Util.getArrayFromValue( FusionTools.defaultContentBasedSigma1, 3 );
final double[] sigma2 = Util.getArrayFromValue( FusionTools.defaultContentBasedSigma2, 3 );
System.out.println( "Default sigma1 = " + Util.printCoordinates( sigma1 ) );
System.out.println( "Default sigma2 = " + Util.printCoordinates( sigma2 ) );
代码示例来源:origin: net.imglib2/imglib2-algorithm
final long[] dimensions = Util.getArrayFromValue( 1l, dimensionality );
randomAccess.setPosition( Util.getArrayFromValue( 0, dimensions.length ) );
randomAccess.get().set( true );
neighborhood = Dilation.dilateFull( img, shape, 1 );
代码示例来源:origin: net.preibisch/multiview-reconstruction
c.getName(),
fusion.getDownsampledBoundingBox(),
new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ),
new Tile( newTileId ),
c,
channels.get( c ).getName() + "_" + illums.get( i ).getName(),
fusion.getDownsampledBoundingBox(),
new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ),
new Tile( newTileId ),
channels.get( newChannelId ),
"Fused",
fusion.getDownsampledBoundingBox(),
new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ),
new Tile( newTileId ),
new Channel( newChannelId ),
vs.getName(),
fusion.getDownsampledBoundingBox(),
new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ),
vs.getTile(),
vs.getChannel(),
代码示例来源:origin: sc.fiji/TrackMate_
/**
* Return the xyz calibration stored in an {@link ImgPlusMetadata} in a
* 3-elements double array. Calibration is ordered as X, Y, Z. If one axis
* is not found, then the calibration for this axis takes the value of 1.
*/
public static final double[] getSpatialCalibration( final ImgPlusMetadata img )
{
final double[] calibration = Util.getArrayFromValue( 1d, 3 );
for ( int d = 0; d < img.numDimensions(); d++ )
{
if ( img.axis( d ).type() == Axes.X )
{
calibration[ 0 ] = img.averageScale( d );
}
else if ( img.axis( d ).type() == Axes.Y )
{
calibration[ 1 ] = img.averageScale( d );
}
else if ( img.axis( d ).type() == Axes.Z )
{
calibration[ 2 ] = img.averageScale( d );
}
}
return calibration;
}
代码示例来源:origin: fiji/TrackMate
/**
* Return the xyz calibration stored in an {@link ImgPlusMetadata} in a
* 3-elements double array. Calibration is ordered as X, Y, Z. If one axis
* is not found, then the calibration for this axis takes the value of 1.
*/
public static final double[] getSpatialCalibration( final ImgPlusMetadata img )
{
final double[] calibration = Util.getArrayFromValue( 1d, 3 );
for ( int d = 0; d < img.numDimensions(); d++ )
{
if ( img.axis( d ).type() == Axes.X )
{
calibration[ 0 ] = img.averageScale( d );
}
else if ( img.axis( d ).type() == Axes.Y )
{
calibration[ 1 ] = img.averageScale( d );
}
else if ( img.axis( d ).type() == Axes.Z )
{
calibration[ 2 ] = img.averageScale( d );
}
}
return calibration;
}
代码示例来源:origin: net.imglib2/imglib2-algorithms
final Img<FloatType> kernel = factory.create( Util.getArrayFromValue( 3L, numDimensions), new FloatType() );
final Cursor<FloatType> cursor = kernel.cursor();
代码示例来源:origin: net.imglib2/imglib2-algorithm
final Img< FloatType > kernel = factory.create( Util.getArrayFromValue( 3L, numDimensions ) );
final Cursor< FloatType > cursor = kernel.cursor();
内容来源于网络,如有侵权,请联系作者删除!