Posted by
Kenneth Sloan-2 on
URL: http://imagej.273.s1.nabble.com/print-Roi-tp5024487p5024502.html
Yes - that does help - thank you.
In the current case, the problem was exacerbated by the fact that the
original data collection protocol saved all of this simply to document the
polygon boundary. They created ROIs to outline cells, and then cleared the
outside of the ROI and cropped a rectangular piece of the image to create
separate images (actually volumes) for each cell. They then proceeded to
annotate THOSE images, marking the locations and types of inclusions The
original Images were calibrated - but the scale and global Origin was lost
in translation. The inclusions were marked in pixel coordinates in the
separate image tiles, and the ROIs were described in pixel coordinates in
the original image. ROIs were stored in .roi files and the inclusion
coordinates were stored in .csv files.
And then...they wanted figures showing all the inclusions (stylized and
color coded) along with all the ROIs.
The required bookkeeping was straightforward, if a bit tedious - with the
added speed bump of reading the .roi files to both draw the polygons but
also extract the x, y offsets for the many local coordinate systems.
Lessons learned: maintain Calibration when carving large images into tiles,
and write data in calibrated coordinates rather than pixels. Don’t save an
ROI when a list of x,y pairs will do. Don’t use binary formats. if
possible.
The ease of saving everything in pixels was too attractive for them to
avoid.
In any case, I now have a plugin tool to convert the polygon information in
a .roi file to easily readable x,y pairs, and they kept excellent records
so the Calibration could be recreated. I’ll probably write a stand alone
Java version...realSoonNow. I’m having flashbacks to the days when I
maintained C code for readers and writers for all known image formats
(plus, of course, my own).
The resulting figures are awesome!
Well - the first one is. I have a full day of manual bookkeeping ahead of
me today to produce the other 20 figures.
One last question, which may reveal my age - are .roi files little-endian
or big-endian?
--
-Kenneth Sloan
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html