diff --git a/maxrf4u/warp.py b/maxrf4u/warp.py index 716594a..9b32ab5 100644 --- a/maxrf4u/warp.py +++ b/maxrf4u/warp.py @@ -3,7 +3,7 @@ # %% auto 0 __all__ = ['ImageRegistrationHelper', 'warp', 'xy_to_latlon', 'latlon_to_xy'] -# %% ../notebooks/30_spatial-verus-spectral.ipynb 36 +# %% ../notebooks/30_spatial-verus-spectral.ipynb 35 from ipywidgets import Layout, HBox, VBox #import ipywidgets @@ -26,7 +26,7 @@ import numpy as np import cv2 -# %% ../notebooks/30_spatial-verus-spectral.ipynb 37 +# %% ../notebooks/30_spatial-verus-spectral.ipynb 36 class ImageRegistrationHelper(object): '''Create interactive image registration. ''' diff --git a/notebooks/30_spatial-verus-spectral.ipynb b/notebooks/30_spatial-verus-spectral.ipynb index 946ed85..1c3190e 100644 --- a/notebooks/30_spatial-verus-spectral.ipynb +++ b/notebooks/30_spatial-verus-spectral.ipynb @@ -27,18 +27,6 @@ "> Lasagna versus spaghetti " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#|hide \n", - "%load_ext autoreload\n", - "%autoreload 2 \n", - "%matplotlib notebook" - ] - }, { "cell_type": "code", "execution_count": null, @@ -75,9 +63,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In the previous sections we have converted and calibrated the original `.raw` spectral image data file into an analysis ready `.datastack` file. We will now gently start to learn how this three dimensional data cube is structured. Basically there are two ways to look at this data. One perspective is to think of the data cube as a stack of gray scale images. Every image has a different energy associated with it. If you remember from the previous section, these energies are the X-ray photon energies, expressed in kilo electron Volts (keV). Each image in the stack contains a distribution of intensities (photon counts). This is the lasagna view. \n", + "In the previous sections we have converted and calibrated the original `.raw` spectral image data file into an analysis ready `.datastack` file. We will now gently start to learn how this three dimensional data cube is structured. Basically there are two ways to look at this data. One perspective is to think of the data cube as a stack of gray scale images. Every image has a different energy associated with it. If you remember from the previous section, these energies are the X-ray photon energies, expressed in kilo electron Volts (keV). Each image in the stack contains a distribution of intensities (photon counts). This is the *lasagna view*. \n", "\n", - "Another way to think of the same data cube is to describe it as a rectangular bundle of spectra. At each spatial *(x,y)* location the data cube contains a spectrum with varying intensity along the third dimension *(z)* of the cube. This is the spaghetti view. We will come back to this in the next section.\n", + "Another way to think of the same data cube is to describe it as a rectangular bundle of spectra. At each spatial *(x,y)* location the data cube contains a spectrum with varying intensity along the third dimension *(z)* of the cube. This is the *spaghetti view*. We will come back to this in the next section.\n", "\n", "Very roughly speaking, the spatial intensity distribution within a slice located at a specific peak energy band represents the spatial distribution of a certain chemical element. For a start we can take a look at the largest peak in the max spectrum. This peak in the energy range of 6.1-6.7 keV is caused by the presence of the chemical element iron in the drawing. Because it is the largest peak, is is called the Fe_Ka (alpha) peak. Without prior knowledge of XRF physics (we will get to this topic later on) we can compute peak slice map for this energy band. \n", "\n", @@ -185,7 +173,7 @@ "metadata": {}, "outputs": [], "source": [ - "FeKa_slice = cube[:,:,is_iron_Ka_band].compute() # load only this slice into memory \n", + "FeKa_slice = cube[:,:,is_iron_Ka_band].compute() # load only this slice into memory (take 20 seconds)\n", "FeKa_map = FeKa_slice.sum(axis=2) / 60 # average over number of channels in the Fe_Ka band " ] },