Thanks, I will try that!:)Abraço,Prof. Guilherme Chagas Kurtz
Cursos de Ciência da Computação e Sistemas de Informação
UNIFRA - Centro Universitário Franciscano
Rua dos Andradas 1614 - 97010-032 - Centro - Santa Maria - RS
+55 55 3220 1200
2014-08-23 14:06 GMT-03:00 Rasband, Wayne (NIH/NIMH) [E] [via ImageJ] <[hidden email]>:
On Aug 21, 2014, at 10:18 PM, guitarro17 wrote:Set the width of the segmented line selection and the Edit>Selection>Line to Area command will work as expected. The following JavaScript example creates a segmented line selection, sets its width to 35 pixels and then uses "Line to Area" to convert it into an area selection. There is a screenshot of the output at <http://wsr.imagej.net/images/LineToArea.png>.
> Hi!
>
> I use ImageJ as library in my application, and I have a sequence of points
> that form a segmented line.
> I'm having some trouble in turning this segmented line into an area
> selection/roi (Like the menu Edit -> Selection -> Line to Area), and then
> crop the image.IJ.run(imp, "Crop", "");
-wayne
imp = IJ.createImage("Untitled","8-bit black",300,200,1);
xpoints = [55,105,164,209,229,217];
ypoints = [111,137,132,102,62,25];
line = new PolygonRoi(xpoints,ypoints,Roi.POLYLINE);
imp.setRoi(line);
IJ.run(imp, "Fit Spline", "");
IJ.setForegroundColor(255,255,255);
IJ.run(imp, "Draw","");
line.setStrokeWidth(35);
IJ.run(imp, "Line to Area","");
imp.show();
> My code until now, but that doesn't work:
>
> ImagePlus imp = new ImagePlus("", ip);
> PolygonRoi s = new PolygonRoi(xPoints, yPoints, nPoints, Roi.POLYLINE);
> imp.setRoi(s);
> IJ.run(imp, "Line to Area", "");
> IJ.run(imp, "Crop", "");
> ImageProcessor ip2 = imp.getProcessor();
>
> What should I do? thanks!
>> --
> View this message in context: http://imagej.1557.x6.nabble.com/Execute-Line-to-Area-from-segmented-line-roi-tp5009299.html
> Sent from the ImageJ mailing list archive at Nabble.com.
If you reply to this email, your message will be added to the discussion below:http://imagej.1557.x6.nabble.com/Execute-Line-to-Area-from-segmented-line-roi-tp5009299p5009317.html
Free forum by Nabble | Disable Popup Ads | Edit this page |