MorphoLibJ Intensity Measurements Input Not Valid

Continuing the discussion from Using Read and Write Excel with 3D Manager Results:

Hi Everyone!
I’m still having issues with automating my analysis with MorphoLibJ.
I have segmented an ROI (WholeSpheroid) and wish to quantify the intensity of a protein of interest (ImageName) within that region, before saving those results with the Read and Write Excel plugin.

However, when I run my code I still get an error telling me that the image I wish to quantify is “not a valid choice for input” when running the Intensity Measurements 2D/3D analysis.
I have tried removing the file extension among other things but the window names match perfectly, so I’m a little stuck.

I think I have linked my previous post above, but just to be safe, here is the code that throws an error:

selectWindow("C2-" + ImageName);
run("Intensity Measurements 2D/3D", "input=[C2-" + ImageName + "] labels=[" + WholeSpheroid + "] mean stddev max min median mode numberofvoxels volume");
Table.rename("C2-" + ImageName + "-intensity-measurements", "Results");
run("Read and Write Excel", "file_mode=queue_write dataset_label=[Paxillin Quantification]");

I’ve used print statements to check the variables are accurate and they are - as you can see in my previous post (hopefully!). Selecting the window beforehand also doesn’t make a difference. : (

Any ideas on what constitutes a “valid input” for Intensity Measurements 2D/3D? Or what I could change/try to get it accepting my input images?

Any and all suggestions are greatly appreciated!


And thanks for reporting!
I have to admit this bug seems mysterious to me. I will try to have a look. Maybe @iarganda may have some idea too.
Anyway, it’s on the list!


1 Like

Thanks for the response @dlegland!
I will continue to try things my end as well!
I look forward to a solution : )

Hey @dlegland
If I rename my input and label images instead of using variable names, everything works perfectly.
I thought I may as well share a temporary workaround!

selectWindow("C2-" + ImageName);
run("Intensity Measurements 2D/3D", "input=C2Image labels=WholeSpheroidROI mean stddev max min median mode numberofvoxels volume");
Table.rename("C2Image-intensity-measurements", "Results");


Hi Sebastian,
glad you could find a workaround, even if temporary!
I could not find time to investigate, but this is still on the list!

1 Like

Reminded me of this thread in case it’s useful!

1 Like