ijpb / MorphoLibJ

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

Assign measure to label macro recording #26

Open tischi opened 6 years ago

tischi commented 6 years ago

The macro recording for Assign Measure to Label does not record the user selection, but only run("Assign Measure to Label");

tischi commented 2 years ago

@dlegland Could this be fixed soon-ish? We need this for teaching material for a course in a couple of weeks.

dlegland commented 2 years ago

Hi @tischi , quite busy at the current time, I will try to have a look but can not promise too much...

dlegland commented 2 years ago

Hi @tischi , I made a beta release that seems to work on some common images; https://github.com/ijpb/MorphoLibJ/releases/tag/v1.5.1.beta01

can you check if it works for you?

tischi commented 2 years ago

It seems to work, but the recording is a bit non-standard (is this intended)?

run("Particles");
close();
run("Blobs (25K)");
setAutoThreshold("Default dark");
//run("Threshold...");
//setThreshold(107, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Close");
run("Connected Components Labeling", "connectivity=4 type=[16 bits]");
run("Analyze Regions", "area perimeter circularity euler_number bounding_box centroid equivalent_ellipse ellipse_elong. convexity max._feret oriented_box oriented_box_elong. geodesic tortuosity max._inscribed_disc average_thickness geodesic_elong.");

call("inra.ijpb.plugins.LabelToValuePlugin.process", "Table=blobs-lbl-Morphometry", "Column=Area", "Min=7.0", "Max=948.0");
run("Assign Measure to Label");
dlegland commented 2 years ago

Hi,

good to know that it works!

For the recording format, I used the same approach @iarganda developed for the Morphological Segmentation plugin. It seems that for complex plugins, the auto-recording of parameters from GenericDialog class does not work anymore... then it is necessary to use alternative methods. The magical of recording is still not totally clear for me!

best, David