Posted by
lechristophe on
Apr 01, 2014; 7:45am
URL: http://imagej.273.s1.nabble.com/Line-ROIs-and-Fit-a-few-how-to-questions-in-ImageJ-Javascript-tp5007161.html
Hi,
I'm trying to convert a macro into javascript. On a side note, this is
mainly because:
- the macro loops on ROIs in the ROI manager, which prevents benefiting
from the speed of the macro batch mode,
- the macro gathers new images iteratively into a stack during processing,
which is only doable via copy/paste ( I think), and is painfully slow
without batch mode.
In a word, the macro takes thick straight lines from the Roi Manager
(several dozens of them), fits a gaussian along the line profile, reports
the fit parameters and collect all fits (Fit windows) as a stack. So, there
are a few things I'm trying to do and I'm not sure how to do them
efficiently and elegantly (leveraging direct access to the ImageJ API via
javascript).
1- I have the ROI manager filled with straight line, 20-pixels wide ROIs.
I'd like to get them as Line objects, in order to use the getPixels method
and get the profiles along the thick line. getPixels does not seem to exist
for general ROI objects, that are retrieved from the RoiManager with
methods such as getRoisAsArray. How can I get Line objects? For now I use a
ProfilePlot object to retrieve the pixel values along the lines, which
seems a bit of an overkill.
2- How can I retrieve the Fit plot window from a script, ideally without
displaying it, similar to what can be done with getPlot method of the
PlotProfile object? That would allow to rapidly collect them into a stack,
but seems to be absent from the CurveFitter or Fitter classes.
Alternatively, if I want to build the fit plot by myself, how can I
retrieve the fit curve (as an x and y array of points) from a CurveFitter
object? Do I have to calculate them manually from the fit equation?
Thanks for your help,
Christophe
--
Christophe Leterrier
Researcher
Axonal Domains Architecture Team
CRN2M CNRS UMR 7286
Aix Marseille University, France
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html