Code Monkey home page Code Monkey logo

Comments (3)

scholi avatar scholi commented on June 11, 2024

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)

from pyspm.

 avatar commented on June 11, 2024

Sorry I usually normalise images by total to remove any topography issues with the sample.

Thanks I will try your recommendation

from pyspm.

scholi avatar scholi commented on June 11, 2024

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']

from pyspm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.