[Insight-users] Draw a line on the window

Luis Ibanez luis.ibanez at kitware.com
Sat Apr 17 19:15:23 EDT 2010


Hi Erkang,

The LiverTumorSegmentation application uses VTK.

Therefore, you may want to use the class:

http://www.vtk.org/doc/nightly/html/classvtkLineWidget.html

Note that you can force the line to
be aligned with a plane by using the
methods

    void SetAlignToXAxis<http://www.vtk.org/doc/nightly/html/classvtkLineWidget.html#aaa561f1a3cc726fdc7441a485959570a>()
    void SetAlignToYAxis<http://www.vtk.org/doc/nightly/html/classvtkLineWidget.html#a669f7f3a4c912311b03d4c61b93d5469>()
    void SetAlignToZAxis<http://www.vtk.org/doc/nightly/html/classvtkLineWidget.html#a73ed44c5ba19db4c1ee99c8f259c63bd>()



   Regards,


         Luis



---------------------------------------------------
On Thu, Apr 15, 2010 at 10:20 AM, Erkang Cheng <ekyaya at gmail.com> wrote:

> Hi all:
>
> Could anyone help me? I follow the example in InsightApplication titled
> "LiverTumorSegmentation". I want to draw a line one the window.
>
> The story is that, I want to interact the window which display a image or
> one slice of 3D data (like DICOM).
>
> The operation is that when I click one point, and mouse move on the window,
> then LeftButtonUp. These action could related to a line.
>
> I want to save the positions of all the points on the line and draw this
> line on the window.
>
> I follow the example in InsightApplication titled "LiverTumorSegmentation".
> In this application, I can get the point when I click on the window, also, I
> can get the points when mouse move.
>
> So, I want to draw this line on the window. How to do this?
>
> My idea is that, suppose that there are two points p1 and p2, p1 is the
> point I click on the window, when mouse move, p2 is current point, I want to
> draw a line from p1 to p2. Then update p1 as p2. This could turn into a
> line. I use this method in MFC which can draw a line.
>
> But, I don't know how to draw a line in a vtkRenderWindow? what's the
> coordinate of the vtkRenderWindow?
>
> Is there is example similar to my question?
>
> Thanks a lot.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100417/2fe7c448/attachment.htm>


More information about the Insight-users mailing list