Login  Register

Re: Converting ROIs

Posted by Andy Weller on Aug 04, 2006; 10:20am
URL: http://imagej.273.s1.nabble.com/Converting-ROIs-tp3701905p3701906.html

One thought with this, is it possible to do something like:

   run("Create Selection");
   select = roi.getType();
   select = Roi.POLYLINE;

This is probably completely wrong and demonstrating my lack of
programming skills (!), but hopefully somebody should know what I am
after...?

Thanks, Andy

On Wed, 2 Aug 2006 14:16:33 +0200, Andy Weller <[hidden email]> wrote:

>Dear all,
>
>Is there a macro way to convert between different ROI types?
>
>I am using the run("Create Selection") command that creates a composite
>ROI but I need a "Polygonal or point selection" required. My previous
>get-out clause was to do the following:
>
>   run("Enlarge...", "enlarge=0");
>   run("Fit Spline");
>
>which seemed to work... Sometimes... I guess there's a 'clean' way to do
>it as I've seen the various saving methods in class RoiWriter
>(http://rsb.info.nih.gov/ij/developer/source/ij/plugin/filter/RoiWriter.java.html).
>
>   case Roi.POLYGON: name="Polygon.roi"; break;
>   case Roi.FREEROI: name="Freehand.roi"; break;
>   case Roi.TRACED_ROI: name="TracedRoi.roi"; break;
>   case Roi.OVAL: name="Oval.roi"; break;
>   etc
>
>Thanks, Andy