sitk::Image adding / multiplying

Hello. I saw here a little python code: https://itk.org/SimpleITKDoxygen/html/Python_2BoarderSegmentation_8py-example.html

And I want to try it, in C++. How can convert this code:

image = image * ~boundary
image = image + ( boundary * replaceValue )

in C++ from Python ?

You can look at this example for two ways to change pixel intensities. You need to change it.Set(std::log(1 + it.Get())); to suit your needs.

I expected that SimpleITK library to know this operation … or doesn’t ?

The SimpleITK Image operators are located in the sitkImageOperators.h file for C++.

1 Like