Draw line with vtk

classic Classic list List threaded Threaded
7 messages Options
ran
Reply | Threaded
Open this post in threaded view
|

Draw line with vtk

ran
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

Sankhesh Jhaveri-2

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
ran
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

ran
Hello, 
Thanks very much for the help.
What is the difference between vtk line widgets "vtkLineWidget" and "vtkLineWidget2 "?
I have to draw the lines above a dicom image displayed in an vtkImageViewer2 

 

On Fri, Sep 15, 2017 at 6:15 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

Sankhesh Jhaveri-2

Hi,

vtkLineWidget2 follows the new widget <-> representation model of widgets in VTK; where the representation determines how the widget is drawn on screen and the widget is responsible for interactions with the representation.

Hope that helps.
Sankhesh


On Mon, Sep 18, 2017 at 6:36 AM K O ranjith <[hidden email]> wrote:
Hello, 
Thanks very much for the help.
What is the difference between vtk line widgets "vtkLineWidget" and "vtkLineWidget2 "?
I have to draw the lines above a dicom image displayed in an vtkImageViewer2 

 

On Fri, Sep 15, 2017 at 6:15 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
ran
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

ran
Hello,
I used vtkLineWidget2 to draw the lines.
I'm using a vtkImageViewer2 for displaying dicom images and the lines should be rendered over the images .
But vtkLineWidget2  lines are rendering below the image displayed in the vtkImageViewer2. 
I need to render the lines over the displayed image, have any solution for this?, have any method to control the rendering order(like bottom to top)?
I also using vtkAngleWidget and vtkDistanceWidget, but these are displaying above the image, only vtkLineWidget2 (and vtkLineWidget)  have the issue. 
please help....
(attached screenshot of the viewer, line rendered is marked inside the red circle) 

On Mon, Sep 18, 2017 at 5:50 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

vtkLineWidget2 follows the new widget <-> representation model of widgets in VTK; where the representation determines how the widget is drawn on screen and the widget is responsible for interactions with the representation.

Hope that helps.
Sankhesh


On Mon, Sep 18, 2017 at 6:36 AM K O ranjith <[hidden email]> wrote:
Hello, 
Thanks very much for the help.
What is the difference between vtk line widgets "vtkLineWidget" and "vtkLineWidget2 "?
I have to draw the lines above a dicom image displayed in an vtkImageViewer2 

 

On Fri, Sep 15, 2017 at 6:15 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

Untitled.png (248K) Download Attachment
Untitled1.png (331K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

Sankhesh Jhaveri-2

Hi,

The issue is that vtkLineRepresentation is a 3D representation; whereas vtkDistanceWidget and vtkAngleWidget have 2D counterparts.
A workaround would be to add an observer to the InteractionEvent and explicitly set the display position Z coordinate to 0.

Hope that helps.

Thanks,
Sankhesh


On Wed, Sep 20, 2017 at 12:18 AM K O ranjith <[hidden email]> wrote:
Hello,
I used vtkLineWidget2 to draw the lines.
I'm using a vtkImageViewer2 for displaying dicom images and the lines should be rendered over the images .
But vtkLineWidget2  lines are rendering below the image displayed in the vtkImageViewer2. 
I need to render the lines over the displayed image, have any solution for this?, have any method to control the rendering order(like bottom to top)?
I also using vtkAngleWidget and vtkDistanceWidget, but these are displaying above the image, only vtkLineWidget2 (and vtkLineWidget)  have the issue. 
please help....
(attached screenshot of the viewer, line rendered is marked inside the red circle) 

On Mon, Sep 18, 2017 at 5:50 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

vtkLineWidget2 follows the new widget <-> representation model of widgets in VTK; where the representation determines how the widget is drawn on screen and the widget is responsible for interactions with the representation.

Hope that helps.
Sankhesh


On Mon, Sep 18, 2017 at 6:36 AM K O ranjith <[hidden email]> wrote:
Hello, 
Thanks very much for the help.
What is the difference between vtk line widgets "vtkLineWidget" and "vtkLineWidget2 "?
I have to draw the lines above a dicom image displayed in an vtkImageViewer2 

 

On Fri, Sep 15, 2017 at 6:15 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
ran
Reply | Threaded
Open this post in threaded view
|

Re: Draw line with vtk

ran
Hi,

I'm using vtkImageViewer2 for rendering both image and line and custom vtkInteractorStyleImage for event handling. In this case how o set the set the display position Z coordinate to 0. Actually I don’t know in which vtk object need to set display position Z coordinate. In renderer or in vtkLineRepresentation?


Thanks



On Wed, Sep 20, 2017 at 6:21 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

The issue is that vtkLineRepresentation is a 3D representation; whereas vtkDistanceWidget and vtkAngleWidget have 2D counterparts.
A workaround would be to add an observer to the InteractionEvent and explicitly set the display position Z coordinate to 0.

Hope that helps.

Thanks,
Sankhesh


On Wed, Sep 20, 2017 at 12:18 AM K O ranjith <[hidden email]> wrote:
Hello,
I used vtkLineWidget2 to draw the lines.
I'm using a vtkImageViewer2 for displaying dicom images and the lines should be rendered over the images .
But vtkLineWidget2  lines are rendering below the image displayed in the vtkImageViewer2. 
I need to render the lines over the displayed image, have any solution for this?, have any method to control the rendering order(like bottom to top)?
I also using vtkAngleWidget and vtkDistanceWidget, but these are displaying above the image, only vtkLineWidget2 (and vtkLineWidget)  have the issue. 
please help....
(attached screenshot of the viewer, line rendered is marked inside the red circle) 

On Mon, Sep 18, 2017 at 5:50 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

vtkLineWidget2 follows the new widget <-> representation model of widgets in VTK; where the representation determines how the widget is drawn on screen and the widget is responsible for interactions with the representation.

Hope that helps.
Sankhesh


On Mon, Sep 18, 2017 at 6:36 AM K O ranjith <[hidden email]> wrote:
Hello, 
Thanks very much for the help.
What is the difference between vtk line widgets "vtkLineWidget" and "vtkLineWidget2 "?
I have to draw the lines above a dicom image displayed in an vtkImageViewer2 

 

On Fri, Sep 15, 2017 at 6:15 PM, Sankhesh Jhaveri <[hidden email]> wrote:

Hi,

You should use the widget if you think you would like to interactively place/draw and edit the line. If your goal is to just display a line given a set of parameters and update it without interaction, a simple cell based approach should work. See https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/LongLine/

Hope that helps.
Sankhesh


On Fri, Sep 15, 2017 at 7:19 AM K O ranjith <[hidden email]> wrote:
Hello,
I need to draw a couple of lines in an image viewer (vtkImageViewer2) for MRI slice planning application. Also should have to perform few operations (move, roatate)on the lines with mouse interactions and need to retrieve line properties (new coordinates after movement, width etc).
I have found examples with  two methods while searching 
with vtkLineWidget2 and with vtkLine 
which approach will be more suitable?
 what is the difference?have any difficulties for manipulation operations  if use vtkLineWidget2?
Please help

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" target="_blank">(518) 881-4417

--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers