Search in sources :

Example 1 with RealArithmeticMeanFunction

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();
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType)

Example 2 with RealArithmeticMeanFunction

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());
}
Also used : PointSet(net.imglib2.ops.pointset.PointSet) HyperVolumePointSet(net.imglib2.ops.pointset.HyperVolumePointSet) RoiPointSet(net.imglib2.ops.pointset.RoiPointSet) RealArithmeticMeanFunction(net.imglib2.ops.function.real.RealArithmeticMeanFunction) Dataset(net.imagej.Dataset) DoubleType(net.imglib2.type.numeric.real.DoubleType) HyperVolumePointSet(net.imglib2.ops.pointset.HyperVolumePointSet)

Example 3 with RealArithmeticMeanFunction

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());
}
Also used : RealMaxFunction(net.imglib2.ops.function.real.RealMaxFunction) Dataset(net.imagej.Dataset) ArrayList(java.util.ArrayList) PointSet(net.imglib2.ops.pointset.PointSet) HyperVolumePointSet(net.imglib2.ops.pointset.HyperVolumePointSet) RoiPointSet(net.imglib2.ops.pointset.RoiPointSet) BasicStatsFunction(net.imagej.measure.BasicStatsFunction) RealMaxFunction(net.imglib2.ops.function.real.RealMaxFunction) RealAdaptiveMedianFunction(net.imglib2.ops.function.real.RealAdaptiveMedianFunction) RealArithmeticMeanFunction(net.imglib2.ops.function.real.RealArithmeticMeanFunction) RealMinFunction(net.imglib2.ops.function.real.RealMinFunction) RealImageFunction(net.imglib2.ops.function.real.RealImageFunction) Function(net.imglib2.ops.function.Function) RealMedianFunction(net.imglib2.ops.function.real.RealMedianFunction) RealPointCountFunction(net.imglib2.ops.function.real.RealPointCountFunction) RealArithmeticMeanFunction(net.imglib2.ops.function.real.RealArithmeticMeanFunction) DoubleType(net.imglib2.type.numeric.real.DoubleType) RealMinFunction(net.imglib2.ops.function.real.RealMinFunction) HyperVolumePointSet(net.imglib2.ops.pointset.HyperVolumePointSet)

Aggregations

DoubleType (net.imglib2.type.numeric.real.DoubleType)3 Dataset (net.imagej.Dataset)2 RealArithmeticMeanFunction (net.imglib2.ops.function.real.RealArithmeticMeanFunction)2 HyperVolumePointSet (net.imglib2.ops.pointset.HyperVolumePointSet)2 PointSet (net.imglib2.ops.pointset.PointSet)2 RoiPointSet (net.imglib2.ops.pointset.RoiPointSet)2 ArrayList (java.util.ArrayList)1 BasicStatsFunction (net.imagej.measure.BasicStatsFunction)1 Function (net.imglib2.ops.function.Function)1 RealAdaptiveMedianFunction (net.imglib2.ops.function.real.RealAdaptiveMedianFunction)1 RealImageFunction (net.imglib2.ops.function.real.RealImageFunction)1 RealMaxFunction (net.imglib2.ops.function.real.RealMaxFunction)1 RealMedianFunction (net.imglib2.ops.function.real.RealMedianFunction)1 RealMinFunction (net.imglib2.ops.function.real.RealMinFunction)1 RealPointCountFunction (net.imglib2.ops.function.real.RealPointCountFunction)1