Macro or method to get at multiple profiles at once?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro or method to get at multiple profiles at once?

ldsdbomber
I have an image containing a field, and want to analyse 40 profiles across
it, i.e. looking along MLC travel directions on a linac. Is there not an
easy way or macro for me to be able to have a predefined set of 40 positions
such that I can open an image, load all 40 profile ROIs, and get the plot
profile data saved to a file, or at least opened so that i can copy it.
 
has anyone attempted such a thing?
Reply | Threaded
Open this post in threaded view
|

Re: Macro or method to get at multiple profiles at once?

Daniel Kalthoff
This macro will walk through all line ROIs in the ROI Manager and print the corresponding ROI name plus the profile values as a tab-separated text. Does this help you?


// walk through all ROIs in the ROI Manager
nROIs = roiManager("count");

for (iROI = 0; iROI < nROIs; iROI++) {
        roiManager("select", iROI);
        dProfile = getProfile();
        sLine = call("ij.plugin.frame.RoiManager.getName", iROI);
        for (i = 0; i < lengthOf(dProfile); i++) sLine = sLine + "\t" + dProfile[i];
        write(sLine);
}
Reply | Threaded
Open this post in threaded view
|

Re: Macro or method to get at multiple profiles at once?

ldsdbomber
Hi, thanks a lot for that. and it's possible to save a bunch of ROIs then and have them automatically open or load them with another macro first?
Reply | Threaded
Open this post in threaded view
|

Re: Macro or method to get at multiple profiles at once?

Daniel Kalthoff
ImageJ Macro Language supports also loading of ROIs into the ROI Manager:
roiManager("Open", fileName);

You'll find more information on the ImageJ Macro Functions site:
http://rsbweb.nih.gov/ij/developer/macro/functions.html

Best Regards,

Daniel