Closed lazypoet closed 7 years ago
This might well be the expected behavior. To avoid information loss, the method stretches the intensity range. There's no mechanism to force a passive range. If you require positive values, you can simply shift them by the global min.
You might want to take a look if the resulting transformed images look correct. Is that the case?
And are the original image values all positive or bound between 0 and 255? What are the global min and max values over ask images? I don't remember how Bjorn published his data right now. Although this doesn't really matter.
Though the original image has a far greater range than just 0-255, the mask that I used ensures that the data is positive(you can see that in the code). Also, why would the method stretch it into negative if you are using auto? But yes, the transformed images do look okay.
You are using the L4 percentile model. It's defined as L4 = [10, 20, 30, 40, 50, 60, 70, 80, 90]
The linear slope between the 10 and 20 percentile is applied to the lower outlier values. If it is steep enough, this might result in negative values.
At this short glance into the code I can't be sure, but you might achieve the desired effect with the model
[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
If that makes sense I can't say.
Okay, but listen to this. I was using SimpleITK to read the images. As you might know, for some reason(high dynamic range?), the images read by SimpleITK have intensity values in the range of upto a few thousands. Now, when I ran your method on those, the negative values go as much as -3000 or even more. I don't know if the slope can be that much
I was using MICCAI BRATS 2015 training dataset. I took a list of images and their respective masks.
When i checked for some generic output o: