[vtkusers] How to change Input data with vtkImageStencil

Michael Knopke Michael.Knopke at gmx.de
Fri Mar 30 08:35:13 EDT 2007


Hello,

 

I know that this is a big NoNo for any filter in VTK but still, this is  a
necessary procedure.
What I want to do is use the class vtkImageStencil to permanently setting
selected pixels blank (=0).
I already have a working pipeline that does this on the output which is ok,
but I need it to simultaneously do this with the corresponding input data,
so that I can redo the filtering without loosing  the results from the step
before.

I think I located the piece of code that does sets the pixel in the output:

 

In vtkImageStencil.cxx

 

Row 277:

 

for (idX = cr1; idX <= cr2; idX++)

          {

          vtkCopyPixel(outPtr, tempPtr, numscalars);

          

                          tempPtr += inIncX;

          }

 

Where tempPtr is set to the desired background value (e.g. 0)
Using the same thing with inPtr will not work, since it would increment the
pointer and later getting out of range.
Can anybody help with this please?



Regards



Michaeö

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070330/d7f799c4/attachment.htm>


More information about the vtkusers mailing list