[vtkusers] How to render separate objects in different colors

Jake Nickel jake.nickel at gmail.com
Sun Dec 9 23:48:57 EST 2007


That works great!  Now I would like to take the objects that I have and be
able to control their rendered color through user interaction.  I have a
vtkCellPicker that is used to get the 3D point selected by the user.  What
is the best way of getting the scalar value associated to that point?  In
other words, if I have an (x, y, z) location that should be a part of object
9 (whose scalar value is 9), is there a method that I can call with (x, y,
z) that will return '9' or some sort of a vtkObject that I can extract the
scalar value from?

Thanks!
-Jake

On Nov 28, 2007 7:41 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:

> Jake,
>
> vtkDiscreteMarchingCubes will extract one or more labeled structures from
> a vtk image.
>
> http://www.vtk.org/doc/nightly/html/classvtkDiscreteMarchingCubes.html
>
> There is a short example of usage in:
>
> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/TestDiscreteMarchingCubes.tcl?root=VTK&content-type=text/plain
>
>
> Bill
>
> On Nov 28, 2007 1:11 AM, Jake Nickel <jake.nickel at gmail.com> wrote:
>
> > Hi All,
> >
> > I have an Analyze image that is segmented into different objects in the
> > following manner:  All voxels associated with object 1 are assigned value =
> > 1, voxels associated with object 2 are assigned value = 2, etc.  (Background
> > voxel values = 0)
> >
> > I would like to visualize the entire data set and have a single object
> > stand out by rendering it with a different color than the rest of the
> > objects.  For example, I would like object 1 to be red and objects 2 and up
> > to be white (black background).
> >
> > The data set is large enough to where volume rendering performance is
> > very slow, so I have been surface rendering instead.  I am able to read the
> > image in using ITK and get the voxel values.  In order to render the
> > surface, I've used the itkImageToVTKImageFilter to convert the image to VTK.
> >
> >
> > Is there a special filter that would be good for doing this?  Or does
> > anyone have any insight as to how I should approach this?
> >
> > Thanks in advance for any help!
> > -Jake
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > 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/20071209/3a7c8d9a/attachment.htm>


More information about the vtkusers mailing list