use of net.imglib2.ops.function.real.RealArithmeticMeanFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method mean.
// -- MeasureTest methods --
protected void mean() {
RealImageFunction<?, DoubleType> imgFunc = mSrv.imgFunction(dataset, new DoubleType());
function = new RealArithmeticMeanFunction<DoubleType>(imgFunc);
funcName = "Mean";
calc();
}
use of net.imglib2.ops.function.real.RealArithmeticMeanFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method example1.
// -- Other examples --
// standard ways of measuring various values.
// a basic measurement
private void example1() {
Dataset ds = getTestData();
DoubleType output = new DoubleType();
RealImageFunction<?, DoubleType> imgFunc = mSrv.imgFunction(ds, output);
RealArithmeticMeanFunction<DoubleType> meanFunc = new RealArithmeticMeanFunction<DoubleType>(imgFunc);
PointSet region = new HyperVolumePointSet(Intervals.dimensionsAsLongArray(ds));
mSrv.measure(meanFunc, region, output);
System.out.println("arithmetic mean is " + output.getRealDouble());
}
use of net.imglib2.ops.function.real.RealArithmeticMeanFunction 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