[vtkusers] Clip Volume using freehand 2D Curve ROI

Simon ESNEAULT simon.esneault at gmail.com
Wed Mar 30 10:48:49 EDT 2016


Hello,

I don't think vtkImageTracerWidget will work on a Volume Rendering. The doc
says "3D widget for tracing on planar props".

I did exactly this, but the ugly way, using Qt to draw on top of the volume
rendering. The pipeline is as follow :

- Capture a screenshot of the current volume rendering (
using GetRenderWindow()->GetRGBACharPixelData( ... ) )
- Load a QPixmap of the screenshot on top the volume rendering's QVTKWidget
- Enable the user to draw using Qt's Scribble example :
http://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html
- When the user has finished to draw, convert all points from
Qt coordinate system to VTK coordinate system.
- Generate a 3D conic-like mesh using the list of coordinate, the camera
position and direction in order to respect the perspective view (not that
easy ;) )
- Cap-Clip the mesh with the volume bounding box (
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/CapClip )
- Generate a mask using vtkPolyDataToImageStencil
- Mask out the part that is below the free hand curve in the volume
( vtkImageMask or an equivalent )
- Remove the QPixmap to restore the volume rendering interaction ...

That is really ugly, and there might be a lot of better way to do this. But
the thing is : it just works ;-)

HTH
Simon


2016-03-30 15:54 GMT+02:00 longbowzhang <longbowzhangchina at gmail.com>:

> "freehand 2D curve": I think vtkImageTracerWidget will do the job.
> Together with vtkPolyDataToImageStencil, it is likely that you will get a
> stencil, which could be employed to clip the 3D volume.
>
> I am not sure whether this will finally work or not. But give it a try.
>
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737447.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>



-- 
------------------------------------------------------------------
Simon Esneault
Rennes, France
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160330/e3e90064/attachment.html>


More information about the vtkusers mailing list