[vtkusers] existing filter to perform replace value on vtkImage
Dominik Szczerba
dominik at itis.ethz.ch
Tue Feb 16 14:58:36 EST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Calculator filter?
David Doria wrote:
> On Tue, Feb 16, 2010 at 1:59 PM, Michael Jackson
> <mike.jackson at bluequartz.net> wrote:
>> Is there an existing filter where I can replace a value in the image if the
>> value does not meet some criteria? Something like:
>>
>> if (value < 255 ) value = 0;
>>
>> Thanks
>> _________________________________________________________
>> Mike Jackson mike.jackson at bluequartz.net
>
> Two things come to mind -
>
> 1) You can identify those regions with vtkImageThreshold:
> http://www.vtk.org/Wiki/VTK/Examples/Images/ImageThreshold
> http://www.vtk.org/doc/nightly/html/classvtkImageThreshold.html
>
> 2) Maybe you can set all the pixels found in (1) to some specific
> value, and then you can use
> vtkImageMathematics::SetOperationToReplaceCByK to replace that
> specific value with 0 (as your original question suggested you want to
> do).
>
> Hope that helps,
>
> David
> _______________________________________________
> 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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkt6+OQACgkQ/EBMh9bUuzLPEQCfRLjsW2mayVcVb0C1tQQ70tDw
VdkAnj7po4WRk8b99bmfuEbs77k/euEh
=pkio
-----END PGP SIGNATURE-----
More information about the vtkusers
mailing list