use of net.imglib2.ops.pointset.RoiPointSet in project imagej-plugins-commands by imagej.
the class MeasurementDemo method calc.
// -- private helpers --
private void calc() {
PointSet points;
Overlay overlay = oSrv.getActiveOverlay(display);
if (overlay != null) {
points = new RoiPointSet(overlay.getRegionOfInterest());
} else {
long[] dims = Intervals.dimensionsAsLongArray(display);
// 1st plane only
for (int i = 2; i < dims.length; i++) {
dims[i] = 1;
}
points = new HyperVolumePointSet(dims);
}
DoubleType output = new DoubleType();
mSrv.measure(function, points, output);
sSrv.showStatus(funcName + " of selected region is " + output.getRealDouble());
}
use of net.imglib2.ops.pointset.RoiPointSet in project imagej-plugins-commands by imagej.
the class StatisticsDemo method getRegion.
private PointSet getRegion() {
Overlay overlay = oSrv.getActiveOverlay(display);
if (overlay != null) {
return new RoiPointSet(overlay.getRegionOfInterest());
}
long[] pt1 = new long[display.numDimensions()];
long[] pt2 = new long[display.numDimensions()];
// current plane only
pt1[0] = 0;
pt1[1] = 0;
pt2[0] = display.dimension(0) - 1;
pt2[1] = display.dimension(1) - 1;
for (int i = 2; i < display.numDimensions(); i++) {
pt1[i] = pt2[i] = display.getLongPosition(i);
}
return new HyperVolumePointSet(pt1, pt2);
}
Aggregations