Change pixels in 2D/3D images

Similar to an older post. One can modify 2D/3D images in order to change specific pixels /voxels. This became useful recently while trying to remove a tissue from a segmented image. For something more complicated you may want to use Slicer, but for simple cases like this a python script enough. Appended you can also find the corresponding C++ code. Keep in mind that python handles all supported PixelTypes automatically while for the C++ one needs to update the PixelType typedef and the dimension variable.

[Read More]
itk