Login  Register

Re: ImageProcessor/drawPolyline???

Posted by Michael Schmid on Jun 30, 2019; 2:39pm
URL: http://imagej.273.s1.nabble.com/ImageProcessor-drawPolyline-tp5022297p5022298.html

Hi Kenneth,

you can create a PolygonRoi (with type polyline) and use
roi.drawPixels(ip) or (equivalent) ip.draw(roi). This is how the ImageJ
'Draw' command does it:
 
https://github.com/imagej/imagej1/blob/master/ij/plugin/filter/Filler.java#L108
   https://github.com/imagej/imagej1/blob/master/ij/gui/PolygonRoi.java#L301

Of course, you can also copy the drawPolygon code and just omit the last
line that closes the polygon
 
https://github.com/imagej/imagej1/blob/master/ij/process/ImageProcessor.java#L1246

Michael
__________________________________________________

On 29/06/2019 11:26 PM, Kenneth Sloan wrote:
> I need to draw a polyline on an ImageProcessor.  I see drawPolygon(), but no drawPolyline().
>
> Is this intentional?
>
> Do I lose anything by writing my own to use multiple drawLine() calls?
> --
> Kenneth Sloan

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