Closed ghost closed 5 years ago
I don't understand the point to normalize an image. The colorscale is automatically stretch to fit the min/max value, so normalizing the values won't change the color that you see. This can be tuned by using the vmax argument in order to specify the upper range of the colormap which is useful to compare several images. So as an example if you have an image A and B you can show them as follow:
max_ = max(np.max(A.pixels), np.max(B.pixels))
A.show(vmax=max_)
B.show(vmax=max_)
Is it what you were asking?
EDIT: Otherwise you can access directly the values of the images with .pixels and do the normalization you like with it. You can then plot it with matplotlib as a normal array. Or do the following trick:
import copy
A_normalized = copy.deepcopy(A)
A_normalized.pixels = A_normalized.pixels / normalization_value
A_normalized.show(vmax=some_value_you_like)
Sorry I usually normalise images by total to remove any topography issues with the sample.
Thanks I will try your recommendation
For your info, you can retrieve the total number of counts and the primary ions shots of the ITA object X as follow:
X.get_value("Analysis.SICount")['float']
X.get_value("Analysis.PIShots")['float']
Hi Scholi,
Is it possible to normalise images, either by total count or by another image?
Thanks Mat