SCM

Discussion Forums: help

Monitor Forum | Start New Thread Start New Thread

 

RE: Draw lines on an image [ reply ]
By: Nicolas SAUBAT on 2016-01-27 17:09
[forum:3488]
Hello Guillaume,

Indeed, with my approach it would have been more complicated to keep the corresponding slice number between the two ImageComponent.
Claire's approach indeed is better! I'm glad it's a better workaround that works for you :)

See you,
Nicolas.

RE: Draw lines on an image [ reply ]
By: Guillaume Custillon on 2016-01-27 17:04
[forum:3487]
Thank you Nicolas !
I am not sure your workaround is suitable for my needs. Indeed, if I want to change the axial slice with the slider, I am not sure the slice will be updated on the duplicated component in the 3D viewer (maybe I'm wrong).
I have found another solution, thanks to Claire. I add my vtkProp to the render widget of the viewer, instead of the image component. As a consequence, the lines only display in the 2D viewers, and not in the 3D one.

Kind regards,

Guillaume

RE: Draw lines on an image [ reply ]
By: Nicolas SAUBAT on 2016-01-27 14:53
[forum:3486]
Hello Guillaume,

If I understand well, you are dealing with vtkProp, when you say "property".
Unfortunately, vtkProp are hold by each component and you can only set the visibility of a vtkProp from the vtkProp itself: you cannot tell a viewer to display a vtkProp or not (in fact, each viewer displays all the available vtkProp which are set as visible).

So, to answer both of you question, no this is not possible :-(.

However, we (the CamiTK team), took into consideration your need, and we are thinking of modifying some of our internal viewers methods to deal with that need in one of our future version.
Also, I have been thinking of a turnaround for your problem: you might duplicate your component in memory (with your lines as vtkProp) and display one only in the 3D viewer and the other only in the Axial, Coronal and Sagittal viewers.
To set the visibility of a component in a specific viewer, use Component::setVisibility(viewer*, bool)[1].
Last but not least, to avoid duplicating in memory your ImageComponent, choose the good ImageComponent(...)[2] constructor, which construct the ImageComponent on a already provided vtkImageData.

Let us know if that turnaround helps you.
Regards,
Nicolas.


[1] http://camitk.imag.fr/apidocumentation/3.4.0/classcamitk_1_1Component.html#af7dfd35605e010b8dbb8c98e6daed8bb
[2] http://camitk.imag.fr/apidocumentation/3.4.0/classcamitk_1_1ImageComponent.html#a70305363fd2e40c03f145e92cf92b382

Draw lines on an image [ reply ]
By: Guillaume Custillon on 2016-01-26 12:08
[forum:3479]
I want to draw some lines on an image. To do that, I add to my image component a property containing the lines I want to draw. The lines are expressed in the frame related to the image, and they are correctly displayed on the axial, coronal and sagittal slices.
However, the display is not correct in the 3D interactive viewer. Indeed, the properties associated to the images are the same, so the lines are expressed in the local frame (related to the image), but they are displayed in the world frame.
So this is my question: is it possible to hide my lines in the 3D viewer only, or is it possible to aplly a transformation on these lines in the 3D viewer only ?

Thank you for your help,

Guillaume

   
Powered By FusionForge