Skip to content

Commit 2883c73

Browse files
committed
add "Center of Mass" to the list of features managed by the IntensityMeasures3D plugin
1 parent 448e5be commit 2883c73

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/main/java/inra/ijpb/plugins/IntensityMeasures3D.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,21 @@ public class IntensityMeasures3D implements PlugIn{
4545
static int labelsIndex = 1;
4646

4747

48-
static String[] measureLabels = new String[]{ "Mean", "StdDev", "Max",
49-
"Min", "Median", "Mode", "Skewness", "Kurtosis",
50-
"NumberOfVoxels", "Volume", "NeighborsMean", "NeighborsStdDev",
51-
"NeighborsMax", "NeighborsMin", "NeighborsMedian",
52-
"NeighborsMode", "NeighborsSkewness", "NeighborsKurtosis" };
48+
static String[] measureLabels = new String[]{
49+
"Mean", "StdDev",
50+
"Max", "Min",
51+
"Median", "Mode",
52+
"Skewness", "Kurtosis",
53+
"NumberOfVoxels", "Volume",
54+
"NeighborsMean", "NeighborsStdDev",
55+
"NeighborsMax", "NeighborsMin",
56+
"NeighborsMedian", "NeighborsMode",
57+
"NeighborsSkewness", "NeighborsKurtosis",
58+
"CenterOfMass"};
5359

5460
static boolean[] measureStates = new boolean[]{ true, true, true, true,
5561
true, true, true, true, true, true, true, true, true, true, true,
56-
true, true, true };
62+
true, true, true, false };
5763

5864
@Override
5965
public void run(String arg)
@@ -284,6 +290,14 @@ public void run(String arg)
284290
Tables.appendColumns(table, im.getNeighborsKurtosis());
285291
calculated++;
286292
}
293+
294+
if (measureStates[18]) // center of mass
295+
{
296+
IJ.showStatus("Calculating center of mass...");
297+
IJ.showProgress(calculated, numMeasures);
298+
Tables.appendColumns(table, IntensityMeasures.getCenterOfMassInPixels(inputImage, labelImage));
299+
calculated++;
300+
}
287301
IJ.showStatus("Done");
288302
IJ.showProgress(calculated, numMeasures);
289303

0 commit comments

Comments
 (0)