3
votes

I have some DICOM images. I want to rescale them using IntensityWindowingImageFilter, but first, I need to know initial values of maximum and minimum intensities.

Right now, I am building WPF UI, with which I want to have some sliders to allow user to interactively input parameters for this operation. However, to have best user experience available, I need to limit scale on sliders to have maximimum and minimum that is maximum and minimum of intensity of image. In ITK, I could use MinimumMaximumImageCalculator, but I can't seem to find it in SimpleITK.

Of course, I could simply use Image.GetBufferAsXXX() and simply iterate over each pixel to find those values, but I am almost sure this is not a right way to go.

1
And, BTW. can somebody add SimpleITK tag? I do not have enough reputation yet.Paweł Mach

1 Answers

5
votes

One can use MinimumMaximumImageFilter. I am not sure why thing used to get minimum and maximum is a filter, but well...

Usage:

MinimumMaximumImageFilter filter = new MinimumMaximumImageFilter();
filter.Execute(image);
this.ImageHighestIntensity = filter.GetMaximum();
this.ImageLowestIntensity = filter.GetMinimum();
filter.Dispose();