本文整理匯總了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 );
}
}