[vtkusers] Splitting ImageData

Ross Cockburn rcockbur at ualberta.ca
Wed May 20 15:35:17 EDT 2015


Hey everyone, I'm pretty new to VTK, and I'm using python. I'm try to
develop a program where a volume can be split in two to view the interior
of both halves. Specifically, I am working with ImageData from a DICOM
file, and would like to be able to use a cursor plane to set up a cut.
Then, I would like to split the volume along the plane and be left with two
independently movable volumes.

I have taken two approaches so far and run into problems with both of them.

1. My first idea was to use a plane widget to get a cut location, then
duplicate the volume, and clip them in opposite directions. The result
would be two volumes based on the same ImageData, but with opposite
clipping planes for their respective mappers. I am using a TrackballActor
interactor style, and the problem is that when I move one of the volumes
(which I need to do to see the interior face), the clipping plane stays in
the same place, rather than following it's volume. I tried using assemblies
to connect the clipping planes with the volumes, but assemblies only accept
instances of 3DProp.

2. My second idea starts the same as the first. I use a planewidget to
define a cut location, then create an ImageMask using the ImageData and
plane as input. Since ImageMasks must be the same extent as their target(my
ImageData), I figured I would create a custom ImageData with the same
extent as my ImageData, and set the scalars to either 1 (if they are on one
side of the plane), or 0 (if they are on the other side). I am not sure how
I can create a custom ImageData however, or how I would use a plane (which
is in the graphics pipeline) to affect the scalars of the ImageData (which
is in the visualization pipeline).

Any feedback I could get on either of these approaches (or another approach
for splitting volumes), would be greatly appreciated.

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150520/2b923d96/attachment.html>


More information about the vtkusers mailing list