draw a line between Point 1 (X,Y) and Point 2 (X,Y)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

draw a line between Point 1 (X,Y) and Point 2 (X,Y)

chil
Dear all,

I have X,Y values of two points in my image and need to draw a line between this two points, how can this be done?

I´m happy for any help

jana
Reply | Threaded
Open this post in threaded view
|

Re: draw a line between Point 1 (X,Y) and Point 2 (X,Y)

ctrueden
Hi Jana,

> I have X,Y values of two points in my image and need to draw a line
> between this two points, how can this be done?

Use the drawLine macro command:
  http://rsbweb.nih.gov/ij/developer/macro/functions.html#drawLine

-Curtis


On Tue, Oct 30, 2012 at 11:55 AM, jana <[hidden email]> wrote:

> Dear all,
>
> I have X,Y values of two points in my image and need to draw a line between
> this two points, how can this be done?
>
> I´m happy for any help
>
> jana
>
>
>
> --
> View this message in context:
> http://imagej.1557.n6.nabble.com/draw-a-line-between-Point-1-X-Y-and-Point-2-X-Y-tp5000591.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: draw a line between Point 1 (X,Y) and Point 2 (X,Y)

Yuekan Jiao-2
Hi,

In plugin programming I have used the following code:

Overlay overlay = new Overlay();
Roi roi = new Line(startX, startY, endX, endY);
overlay.add(roi);
imp.setOverlay(overlay);

Yuekan


On Tue, Oct 30, 2012 at 10:53 AM, Curtis Rueden <[hidden email]> wrote:

> Hi Jana,
>
>> I have X,Y values of two points in my image and need to draw a line
>> between this two points, how can this be done?
>
> Use the drawLine macro command:
>   http://rsbweb.nih.gov/ij/developer/macro/functions.html#drawLine
>
> -Curtis
>
>
> On Tue, Oct 30, 2012 at 11:55 AM, jana <[hidden email]> wrote:
>
>> Dear all,
>>
>> I have X,Y values of two points in my image and need to draw a line between
>> this two points, how can this be done?
>>
>> I´m happy for any help
>>
>> jana
>>
>>
>>
>> --
>> View this message in context:
>> http://imagej.1557.n6.nabble.com/draw-a-line-between-Point-1-X-Y-and-Point-2-X-Y-tp5000591.html
>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: draw a line between Point 1 (X,Y) and Point 2 (X,Y)

chil
This post was updated on .
In reply to this post by ctrueden

Hey all,

 problem is solved, thanks for help, the image was scaled so my x y values did not work.............

thanks for help

"Hey Curtis,
thanks for the fast replay. Stilll I have the problem that there is a macro error (undefined variable in line 2)?

when I tryed this one:

macro "drawline" {
       drawLine(x1, y1, x2, y2);
    }

sorry I am new to programming macros.............

thanks for hepl jana"
Reply | Threaded
Open this post in threaded view
|

Re: draw a line between Point 1 (X,Y) and Point 2 (X,Y)

ctrueden
Hi Jana,

> thanks for the fast replay. Stilll I have the problem that there is a
> macro error (undefined variable in line 2)?

You have to actually specify the coordinates you want for your line. E.g.:

drawLine(23, 34, 45, 56);

If you need further assistance, please describe in more detail what you are
trying to do.

Regards,
Curtis


On Fri, Nov 2, 2012 at 4:05 PM, jana <[hidden email]> wrote:

> Hey Curtis,
> thanks for the fast replay. Stilll I have the problem that there is a macro
> error (undefined variable in line 2)?
>
> when I tryed this one:
>
> macro "drawline" {
>        drawLine(x1, y1, x2, y2);
>     }
>
> sorry I am new to programming macros.............
>
> thanks for hepl jana
>
>
>
> --
> View this message in context:
> http://imagej.1557.n6.nabble.com/draw-a-line-between-Point-1-X-Y-and-Point-2-X-Y-tp5000591p5000652.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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