[vtkusers] vtkVolume - Is there a way to use clipping planes on it?

Amy Henderson amy.henderson at kitware.com
Thu Nov 18 08:35:34 EST 2004


Hi Ramzy,

Clipping planes for volume rendering in VTK are set on the 
vtkVolumeMapper.  (I assume the mapper you are using is 
vtkVolumeTextureMapper2D, a subclass of vtkVolumeMapper.)  The clipping 
planes must be axis-aligned.  There are 3 methods you need to call on the 
volume mapper to set up clip planes.

mapper->CroppingOn();
mapper->SetCroppingRegionPlanes( Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
mapper->SetCroppingRegionFlagsTo*****();

For a description of the CroppingRegionFlags, see 
VTK/Rendering/vtkVolumeMapper.h or 
http://www.vtk.org/doc/nightly/html/classvtkVolumeMapper.html.  You 
probably want to use SetCroppingRegionFlagsToSubVolume(), which is the 
default.  (See the constructor of vtkVolumeMapper.)

- Amy

At 06:52 PM 11/17/2004, Ramzy Darwish wrote:
>Hello All,
>I have been using VTK in school for a little more than a year now, and I 
>am having some problems.
>
>Don't worry, I am not asking anyone to do my homework.
>
>I am doing an independent study continuing some work with medical volume 
>rendering using the bruce gooch data set: 
><http://www.cs.utah.edu/~bgooch/BruceBrain.html>http://www.cs.utah.edu/~bgooch/BruceBrain.html 
>
>
>
>Now, the data file he gives out is a simple list of densities.
>I was not allowed to use any vtkReaders, so I loaded the data in by hand, 
>swapping byte-order and all that good stuff.
>
>So I got a rendering of the head, but because I had no other information 
>other than density, I was only able to somewhat get the brain isolated was 
>by using the vtkVolume object with texture mapping.
>
>This produced some nice (although not greatly useful) images, but I have 
>always wanted to get the brain by itself.
>
>I tried using the vtkContourFilter, which didn't seem to want to work 
>right. Instead of leaving values all through the head in my ranges, it 
>left sections of the entire head (i.e. I would get from the neck/chin to 
>the nose instead of the whole head with only say, the skin removed).
>
>I tried using a combination of vtkClipPolyData with scalar values and 
>implicit planes, but this didn't work because after cutting, the resulting 
>geometry would be full of holes. I think I was using it wrong.
>
>So I went back to the drawing board and I have decided to look at the 
>densities in the file and ignore those outside of the brain wherever 
>possible. So now I have a range of values within to use, but I still have 
>some extraneous (sp) pieces laying about that I might be able to remove, 
>but I can't figure out how. Is there a way to remove chunks out of a 
>volume? Not by scalar though. I could use a sphere or other builtin 
>implicit function if necessary, but it seems that the other methods of 
>doing stuff like this are not set up to work with vtkVolume's (as they are 
>derived from vtkProp).
>
>Can anyone point me in the direction of some more objects that I can use 
>to interact with or modify vtkVolume objects?
>
>Sorry this was so long, this is my first post here.
>
>thanks,
>ramzy
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>&lt;http://www.vtk.org/Wiki/VTK_FAQ&gt;
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041118/fa3b6f04/attachment.htm>


More information about the vtkusers mailing list