use of net.imagej.measure.BasicStatsFunction in project imagej-plugins-commands by imagej.
the class MeasurementDemo method example5.
// measuring a custom set of data using an aggregating class
private void example5() {
Dataset ds = getTestData();
DoubleType output = new DoubleType();
RealImageFunction<?, DoubleType> imgFunc = mSrv.imgFunction(ds, output);
BasicStatsFunction<DoubleType> statFunc = new BasicStatsFunction<DoubleType>(imgFunc, new DoubleType());
PointSet region = new HyperVolumePointSet(Intervals.dimensionsAsLongArray(ds));
BasicStats stats = new BasicStats();
mSrv.measure(statFunc, region, stats);
System.out.println("mean = " + stats.getXBar());
System.out.println("var = " + stats.getS2n1());
}
Aggregations