[vtkusers] Set ImageData to zero

Dominique Töpfer dominique at toepfer-web.de
Tue Sep 27 09:59:11 EDT 2011


Hi,

a similar question was discussed here:
http://vtk.1045678.n5.nabble.com/Fast-element-access-of-vtkImageData-td4640137.html#none

HTH
Dominique

On 27.09.2011 15:47, speedy wrote:
> Sorry if this question actually has a simple answer, but what is the fastest
> way to set every pixel of a vtkImageData to zero (or any other value fitting
> in its pixeltype)?
> I've tried vtkImageThreshold, but it doesn't seem to do anything or maybe I
> am using it wrong:
>
>    threshold = vtkSmartPointer<vtkImageThreshold>::New();
>    threshold->SetInput(Image);
>    threshold->ReplaceOutOn();
>    threshold->SetOutValue(Value);
>    threshold->ThresholdByLower(maximum_image_value);
>    threshold->Update();
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Set-ImageData-to-zero-tp4845442p4845442.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


-- 
Thus spake the master programmer:
     "After three days without programming, life becomes meaningless."

-- The Tao of Programming by Geoffry James

Dominique Töpfer, Dipl.-Inform.
Institute of Medical Physics
University of Erlangen




More information about the vtkusers mailing list