LumiSpy / lumispy

Luminescence data analysis with HyperSpy.
https://lumispy.org
GNU General Public License v3.0
26 stars 18 forks source link

Dealing with SEM/HAADF complementary data with their respective luminescence #73

Open jordiferrero opened 3 years ago

jordiferrero commented 3 years ago

I have recently been wondering on what the best strategy would be to do the following:

All of my CL-SEM data always comes with SE images with it (I suppose for CL-TEM the equivalent would be a HAADF image). These SE images are acquired at the same time as the luminescence. However, they are not integrated with hyperspy at all. While it is true that you can load the SE image separately (as s) and the use this s object as navigation_axis for the cl object, this all needs to be done manually. What's worse is that when I do some processing on the cl object (e.g. crop or subindex some of the navigation axes) the s SE image does not link with the cl object in anyway. Ideally, i would like to link these 2 datasets together.

I have an idea to do that, but I wanted too quickly discuss the approach before I get into the coding. One way would be to keep the SE image array in the metadata and, every time you apply a certain operation that modifies the navigation axis, then those changes are also applied to the SE metadata (e.g. crop pixels). Moreover, I would like to have an option when plotting where we can specify to use the SE image as navigation axis instead of the default "panchromatic".

Can you think of any better ways to implement such feature?

ericpre commented 3 years ago

The management of the different signals is taken care by the workflow: the python script or the notebook.

In the case of the navigator, it would be worth considering improving support signal navigator if this is thought in a generic fashion and in a way that it doesn't too much burden to other functions. Maybe it is worth continuing this part of the discussion at https://github.com/hyperspy/hyperspy/issues/2639?

jordiferrero commented 3 years ago

So you mean I should stick to keeping track of the changes in the navigation axis of the cl signal and manually applying the same changes to the s SE image file? That's what I am doing, but I still think there must be a better way...

jlaehne commented 3 years ago

@jordiferrero - I understand your point. In principle it applies also for EELS and EDX data and might be of more general interest. Though in many cases the spectral maps will have a lower resolution than proper HAADF or SE images of the same region, and a direct linking of this data is of limited value.

For example, our CL system does not record the SE signal in parallel. I usually have a corresponding SE image taken beforehand and the spectral image corresponds to only a ROI on that image. That SE image usually has a better resolution than the spectral image as I hardly ever use step sizes below 20 nm.

The main issue I see with your approach is that quite a number of functions would need to be adapted directly in hyperspy (e.g. crop, inav, rebin). What you want to do is basically stacking of signals. But I am not sure if stacking two signals with the same navigation dimensions, but different signal dimensions (e.g. 1024 and 1) is possible @ericpre, I do not have enough experience with that function. It might be worth thinking along the lines of adding such a functionality instead of adding an additional signal to the metadata.

ericpre commented 3 years ago

Indeed, there is room for improvement for the navigator and it would good to discuss how to improve it with others who are interested in this and this is why I put the link to the other issue!