How to changes the values of itk::Image?

I have the ground truth label files with integer values. I need to remove all values except those voxels that have value==1. How can I do this? How to know the unique values of itk::Image type?

Sorry for basic question

This example should be very helpful:

1 Like

Thank you for sharing the link,

I could perform it with itk::ImageRegionIterator. Appreciate your help.