本文整理汇总了Java中net.imglib2.algorithm.stats.ComputeMinMax类的典型用法代码示例。如果您正苦于以下问题:Java ComputeMinMax类的具体用法?Java ComputeMinMax怎么用?Java ComputeMinMax使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComputeMinMax类属于net.imglib2.algorithm.stats包,在下文中一共展示了ComputeMinMax类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Histogram
import net.imglib2.algorithm.stats.ComputeMinMax; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Histogram(final Object fn, final int nBins) throws Exception {
this.img = AlgorithmUtil.wrap(fn);
T min = img.firstElement().createVariable();
T max = min.copy();
min.setReal( min.getMinValue() );
max.setReal( max.getMinValue() );
ComputeMinMax<T> cmm = new ComputeMinMax<T>(this.img, min, max);
cmm.process();
this.min = cmm.getMin().getRealDouble();
this.max = cmm.getMax().getRealDouble();
this.increment = process(this, img, nBins, this.min, this.max);
}
示例2: computeMinMax
import net.imglib2.algorithm.stats.ComputeMinMax; //导入依赖的package包/类
private void computeMinMax(){
if( min.getRealFloat() > max.getRealFloat() )
ComputeMinMax.computeMinMax(imgIN, min, max);
}
示例3: ImagePlusImgLoader
import net.imglib2.algorithm.stats.ComputeMinMax; //导入依赖的package包/类
protected < S extends RealType< S > & NativeType< S > > ImagePlusImgLoader( final ImagePlus imp,
final TypedBasicImgLoader< S > loader,
final MinMaxOption minMaxOption,
final double min,
final double max,
final T type,
final ConverterFactory< T > converterFactory )
{
this.imp = imp;
this.loader = loader;
this.type = type;
this.converterFactory = converterFactory;
final int numSetups = imp.getNChannels();
setupImgLoaders = new ArrayList<>();
for ( int setupId = 0; setupId < numSetups; ++setupId )
setupImgLoaders.add( new SetupImgLoader<>( loader.getSetupImgLoader( setupId ) ) );
if ( loader instanceof VirtualStackImageLoader )
this.loadercache = ( ( VirtualStackImageLoader< ?, ?, ? > ) loader ).getCacheControl();
else
this.loadercache = null;
if ( minMaxOption == MinMaxOption.COMPUTE )
{
impMin = Double.POSITIVE_INFINITY;
impMax = Double.NEGATIVE_INFINITY;
final S minT = loader.getSetupImgLoader( 0 ).getImageType().createVariable();
final S maxT = minT.createVariable();
final int numTimepoints = imp.getNFrames();
for ( int t = 0; t < numTimepoints; t++ )
for ( int s = 0; s < numSetups; ++s )
{
ComputeMinMax.computeMinMax( loader.getSetupImgLoader( s ).getImage( t ), minT, maxT );
impMin = Math.min( minT.getRealDouble(), impMin );
impMax = Math.max( maxT.getRealDouble(), impMax );
if ( loadercache != null )
loadercache.clearCache();
}
System.out.println( "COMPUTE" );
System.out.println( impMin + " " + impMax );
}
else if ( minMaxOption == MinMaxOption.TAKE_FROM_IMAGEPROCESSOR )
{
impMin = imp.getDisplayRangeMin();
impMax = imp.getDisplayRangeMax();
System.out.println( "TAKE_FROM_IMAGEPROCESSOR" );
System.out.println( impMin + " " + impMax );
}
else
{
impMin = min;
impMax = max;
System.out.println( "SET" );
System.out.println( impMin + " " + impMax );
}
}