Re: print Roi?

Posted by Kenneth Sloan-2 on
URL: http://imagej.273.s1.nabble.com/print-Roi-tp5024487p5024506.html

After solving my initial problem by manually pushing .roi files through ImageJ and writing a simple macro to output x,y coordinates - I cleared the motivating project from my queue.

So…I took up the task of adapting ij.io <http://ij.io/>.RoiDecoder.java to produce a version which works as a stand-alone Java Class, with no external dependencies.

This was relatively simple to do, if a bit time-consuming.  The result is still quite crude, but it is at the stage where it *would have* served to solve my initial problem - which was to extract x,y coordinates from POLYGON and RECTANGLE .roi files.

Many thanks to those who helped me understand where to start.

If anyone has similar needs, I’m happy to share my code. [contact me off-list and I’ll send the code.  It should fit as an attachment in e-mail].

The implementation attempts to handle every possibility (according to my limited understanding).  The test program only fully handles POLYGON and RECTANGLE .roi files - and has lots of stubs which apologize for not being implemented, yet.

Even for RECTANGLE ROIs, I don’t understand how a “ShapeArray” works.
POLYGON ROIs appear to be fully implemented and tested.

Question: is there a test suite of .roi files which exhibits the full range of options?

Failing that, and left to my own devices, I am likely to stop working on this - using it for problems that come up for me and extending/testing as new .roi files cross my path.

Question 2 (very low level): ij.io <http://ij.io/>.RoiDecoder defines a method: getShort(), which appears to allow negative values only down to -5000 - values lower than that are treated as UNSIGNED Shorts.  This looks unhealthy to me (especially since there is a perfectly fine method : getUnsignedShort().  I suspect this may have been written very early on, and has been propagated forward (without breaking anything…yet).  I’m tempted to rewrite this to be a proper getShort() method - but first I’ll ask: is there actually a case where ij.io <http://ij.io/>.RoiDecoder would break if this change were made?

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html