use of net.imglib2.ops.function.real.RealMaxFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method example2.
// a basic measurement with out of bounds data handling
private void example2() {
Dataset ds = getTestData();
DoubleType output = new DoubleType();
OutOfBoundsFactory<UnsignedByteType, RandomAccessibleInterval<UnsignedByteType>> oobFactory = getOobFactory();
@SuppressWarnings("unchecked") RealImageFunction<?, DoubleType> imgFuncWithOOB = new RealImageFunction<UnsignedByteType, DoubleType>((Img<UnsignedByteType>) ds.getImgPlus(), oobFactory, output);
RealMaxFunction<DoubleType> maxFunc = new RealMaxFunction<DoubleType>(imgFuncWithOOB);
PointSet region = new HyperVolumePointSet(Intervals.dimensionsAsLongArray(ds));
mSrv.measure(maxFunc, region, output);
System.out.println("max is " + output.getRealDouble());
}
use of net.imglib2.ops.function.real.RealMaxFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method max.
protected void max() {
RealImageFunction<?, DoubleType> imgFunc = mSrv.imgFunction(dataset, new DoubleType());
function = new RealMaxFunction<DoubleType>(imgFunc);
funcName = "Max";
calc();
}
use of net.imglib2.ops.function.real.RealMaxFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method example4.
// measuring multiple things at a time
private void example4() {
Dataset ds = getTestData();
DoubleType output = new DoubleType();
RealImageFunction<?, DoubleType> imgFunc = mSrv.imgFunction(ds, output);
RealArithmeticMeanFunction<DoubleType> meanFunc = new RealArithmeticMeanFunction<DoubleType>(imgFunc);
RealMinFunction<DoubleType> minFunc = new RealMinFunction<DoubleType>(imgFunc);
RealMaxFunction<DoubleType> maxFunc = new RealMaxFunction<DoubleType>(imgFunc);
List<Function<PointSet, DoubleType>> funcList = new ArrayList<Function<PointSet, DoubleType>>();
List<DoubleType> outputList = new ArrayList<DoubleType>();
funcList.add(meanFunc);
funcList.add(minFunc);
funcList.add(maxFunc);
outputList.add(new DoubleType());
outputList.add(new DoubleType());
outputList.add(new DoubleType());
PointSet region = new HyperVolumePointSet(Intervals.dimensionsAsLongArray(ds));
mSrv.measure(funcList, region, outputList);
System.out.println("mean = " + outputList.get(0).getRealDouble());
System.out.println("min = " + outputList.get(1).getRealDouble());
System.out.println("max = " + outputList.get(2).getRealDouble());
}
Aggregations