ijpb / MorphoLibJ

Collection of mathematical morphology methods and plugins for ImageJ
http://imagej.net/MorphoLibJ
GNU Lesser General Public License v3.0
98 stars 49 forks source link

Measure summary statistics of child objects #42

Open tischi opened 3 years ago

tischi commented 3 years ago

@dlegland @iarganda @haesleinhuepf @ssgpers

Again, I am quite sure I asked it before but could not find it back.

It is essentially about whether we have CellProfiler's RelateObjects module in Java? RelateObject measures per parent summary statistics for child objects (e.g. vesicles) measurements (e.g cells).

I think technically one would measure the (median?) intensity of the child label mask objects in the parent label masks image to determine which parent they belong to. Then one can loop through the child table and compute averages of all measured features, per parent object (think tapply in R).

Do we have a function like this already?

I think the API could be:

ResultsTable averageChildPerParentMeasurements = computeChildObjectsMeasurements(  ResultsTable childrenMeasurements, ImagePlus childrenLabelMask, ImagePlus parentLabelMask);

The nice thing about this is that one could (should) also add a UI function for this, to be used in daily life and in courses.

Related to that, is there already code to combine two resultsTables based on the labelIndex?

@haesleinhuepf, how do you report back object measurements? Also using a ResultsTable? If so, maybe we can join forces...

ssgpers commented 3 years ago

In many cases I like to run aggregation in R after exporting delailed children table. There user can actually decide which aggregation method to run or test several (I think one should be responsible yo make this choice per particular project).

One just needs to simply include parent object ID into children result table, e.g. by placing each child Roi on Parent count mask and measuring value there.

tischi commented 3 years ago

@ssgpers
You may have a point here. Maybe we just don't do the summary statistics in Java at all and leave that to dedicated software, like R.