[vtkusers] Convert to binary image

David Doria daviddoria at gmail.com
Thu Apr 26 17:01:26 EDT 2012


On Thu, Apr 26, 2012 at 4:59 PM, bberkowi <benjamin-berkowitz at uiowa.edu> wrote:
> Hi, I'm trying to convert an image volume I have to binary values.  I would
> like all positive values to be 0 and all negative values to be 1.
>
> I've only worked with 3D poly data so far, and I don't have any experience
> with image volumes.  Does anyone have any experience with either
> pixel-by-pixel operations, or applying a logic condition over an entire
> image?

I'm not sure if there's a more automatic way, but one way to do it is
to iterate over the pixels like this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/IterateImageData

David



More information about the vtkusers mailing list