Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Structure Analysis

Image Tools


Structure Analysis

OpenInColab

by

Gerd Duscher

Materials Science & Engineering
Joint Institute of Advanced Materials
The University of Tennessee, Knoxville

We us this notebook only for a stack of images.

Install pyTEMlib

If you have not done so in the Introduction Notebook, please install pyTEMlib with the code cell below.

done

Import the usual libraries

You’ll need at least pyTEMlib version 0.2020.04.2

You can load that library with the code cell above:

pyTEM version:  0.2026.9.0
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[805], line 14
     11 # all evaluated reciprocal_unit_cell points
     12 g_non_rot = np.dot(hkl_all, atoms.cell.reciprocal())
---> 14 ewald = pyTEMlib.diffraction_tools.ewald_sphere_center(acceleration_voltage_V, atoms, zone_hkl)
     16 k0_magnitude = np.linalg.norm(ewald)
     18 s = (k0_magnitude**2-np.linalg.norm(g_non_rot - ewald, axis=1)**2)/(2*k0_magnitude)

AttributeError: module 'pyTEMlib.diffraction_tools' has no attribute 'ewald_sphere_center'
mistilt
Of the 457 possible reflection 101 are allowed.
Of those, there are 82 in ZOLZ  and 19 in HOLZ
Of the 137 forbidden reflection in ZOLZ  27 can be dynamically activated.
dict_keys(['g_deficient', 'g_excess', 'FOLZ', 'SOLZ', 'HOLZ_plus', 'Laue_zones', 'hkl', 'intensities', 'kg'])
Loading...
Loading...
dict_keys(['g_deficient', 'g_excess', 'FOLZ', 'SOLZ', 'HOLZ_plus', 'laue_zones', 'hkl', 'intensities'])
Loading...
array([43.02786629, 45.89222924, 40.99504201, 40.05278821, 40.05278821, 41.55483294, 40.05278821, 45.89222924, 15.3132947 , 13.05949999])
((1330,), array([[0. , 0. , 0. ], [1.35772, 1.35772, 1.35772], [2.71544, 2.71544, 0. ], [4.07316, 4.07316, 1.35772], [2.71544, 0. , 2.71544], [4.07316, 1.35772, 4.07316], [0. , 2.71544, 2.71544], [1.35772, 4.07316, 4.07316]]), [(np.float64(0.0), array([-4., 2., -3.])), (np.float64(6.863), array([-4., 2., -2.])), (np.float64(0.0), array([-4., 2., -1.])), (np.float64(0.0), array([-4., 2., 0.])), (np.float64(0.0), array([-4., 2., 1.])), (np.float64(6.863), array([-4., 2., 2.])), (np.float64(0.0), array([-4., 2., 3.])), (np.float64(0.0), array([-4., 2., 4.])), (np.float64(0.0), array([-4., 2., 5.])), (np.float64(0.0), array([-4., 3., -5.]))])
(100, 3)
((100,), np.int64(26), array([2.52266416e-01, 1.90324689e-29, 2.65468873e-01, 1.32389370e-30, 2.78842547e-01, 4.28245150e-31, 2.92219600e-01, 6.47544388e-30, 3.05397735e-01, 2.03848420e-29, 3.18141974e-01, 6.30634198e-30, 3.30189489e-01, 1.81337630e-31, 3.41257987e-01, 6.00804879e-30, 3.51057766e-01, 8.52806732e-32, 3.59307062e-01, 5.57475538e-30, 3.65749628e-01, 2.20899480e-32, 3.70172856e-01, 5.01886469e-30, 3.72424299e-01, 0.00000000e+00, 3.72424299e-01, 4.37219918e-30, 3.70172856e-01, 2.20899480e-32, 3.65749628e-01, 3.68074603e-30, 3.59307062e-01, 8.52806732e-32, 3.51057766e-01, 2.99437138e-30, 3.41257987e-01, 1.81337630e-31, 3.30189489e-01, 2.35598775e-30, 3.18141974e-01, 1.97904336e-31, 3.05397735e-01, 1.35829638e-31, 2.92219600e-01, 8.69145577e-32, 2.78842547e-01, 5.01429595e-32, 2.65468873e-01, 2.43602942e-32, 2.52266416e-01, 1.90324689e-29, 1.25060525e-29, 5.89053333e-31, 1.68704638e-32, 6.19577356e-31, 1.77253444e-32, 6.50189018e-31, 1.44984703e-29, 2.31666805e-29, 1.51488141e-29, 8.28927548e-30, 3.66590283e-30, 7.37514065e-31, 3.80143985e-30, 8.91242994e-30, 1.68834611e-29, 9.17745945e-30, 4.03043073e-30, 9.40095186e-30, 4.11714429e-30, 8.19885784e-31, 4.18137083e-30, 9.69588502e-30, 1.81602782e-29, 9.75707563e-30, 4.23419298e-30, 9.75707563e-30, 4.22086440e-30, 8.30172050e-31, 4.18137083e-30, 9.57574793e-30, 9.72777949e-30, 3.92687780e-30, 4.03043073e-30, 9.17745945e-30, 9.27167103e-30, 3.72281698e-30, 3.80143985e-30, 8.61369830e-30, 8.66160907e-30, 5.61665026e-30, 5.66605553e-30, 5.38467566e-30, 5.42280982e-30, 5.14540765e-30, 5.17434973e-30, 4.90315582e-30, 4.92479458e-30, 4.66159754e-30]))
(array([0.01055248, 0.01074873, 0.01094646, ..., 0.01094646, 0.01074873, 0.01055248], shape=(357910,)), array([0.01055248]), np.float64(11.162422713245498))

Load an image stack :

Please, load an image stack.

A stack of images is used to reduce noise, but for an added image the images have to be aligned to compensate for drift and other microscope instabilities.

You select here (with the Select Main button,) a file of your image.

Note that the Add should only used for reference data

(array([[-0.24520622, -0.24520622, -0.24520622], [-0.24520622, -0.24520622, 0. ], [-0.24520622, -0.24520622, 0.24520622], [-0.24520622, 0. , -0.24520622], [-0.24520622, 0. , 0. ]]), array([[ 0. , 0. , -0.24520622], [ 0. , 0.24520622, 0. ], [-0.24520622, 0. , 0. ], [ 0. , 0. , 0.24520622], [ 0.24520622, 0. , 0. ]]), array([[ 0., 0., -1.], [ 0., 1., 0.], [-1., 0., 0.], [ 0., 0., 1.], [ 1., 0., 0.]]), array([[-1., -1., -1.], [-1., -1., 0.], [-1., -1., 1.], [-1., 0., -1.], [-1., 0., 0.]]))
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[44], line 1
----> 1 image2 = rigid_registered[:, 300:-212, 512:].sum(axis=0)
      2 image2 -= image2.max()/2
      3 image2[image2<0] = 0.

NameError: name 'rigid_registered' is not defined
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[43], line 1
----> 1 fft_image = pyTEMlib.image_tools.power_spectrum(image2)
      3 v = fft_image.plot()
      4 #, diffractogram_spots

NameError: name 'image2' is not defined
(array([-1.51791087e+02, 2.82089131e+01, 1.53127322e+02, -2.68726778e+01, -1.16872678e+02, 6.31273222e+01, -1.20141646e+02, 5.98583541e+01, -6.24845317e+01, 1.17515468e+02, 2.84217094e-14, -1.80000000e+02, -2.68726778e+01, 1.53127322e+02, 6.31273222e+01, -1.16872678e+02, -2.68726778e+01, 1.53127322e+02, -1.16872678e+02, 6.31273222e+01, 6.31273222e+01, -1.16872678e+02, 1.53127322e+02, -2.68726778e+01, -1.16872678e+02, 6.31273222e+01, 1.53127322e+02, -2.68726778e+01, -1.16872678e+02, 6.31273222e+01, -2.68726778e+01, 1.53127322e+02, -1.16872678e+02, 6.31273222e+01, 1.53127322e+02, -2.68726778e+01, -1.16872678e+02, 6.31273222e+01, -2.68726778e+01, 1.53127322e+02, -1.16872678e+02, 6.31273222e+01, -2.68726778e+01]), array([ 4.02421292, 4.02421292, 4.09510602, 4.09510602, 4.27742238, 4.27742238, 6.73261874, 6.73261874, 6.92608507, 6.92608507, 7.02975163, 7.02975163, 7.93426791, 7.93426791, 9.77696544, 9.77696544, 12.7972063 , 12.7972063 , 14.66544816, 14.66544816, 17.5985378 , 17.5985378 , 18.04406089, 18.04406089, 19.30950675, 19.30950675, 21.24336246, 21.24336246, 21.87596018, 21.87596018, 24.5706361 , 24.5706361 , 25.54232222, 25.54232222, 26.87413324, 26.87413324, 27.49771531, 27.49771531, 28.79371418, 28.79371418, 30.1863808 , 30.1863808 , 31.09721132]))
1.0127191128185802
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[164], line 2
      1 plt.figure()
----> 2 plt.scatter(angles, r = [6.92]*len(angles)) #np.linalg.norm(spots[1:, :2],axis=1))

File ~\AppData\Local\anaconda3\Lib\site-packages\matplotlib\_api\deprecation.py:453, in make_keyword_only.<locals>.wrapper(*args, **kwargs)
    447 if len(args) > name_idx:
    448     warn_deprecated(
    449         since, message="Passing the %(name)s %(obj_type)s "
    450         "positionally is deprecated since Matplotlib %(since)s; the "
    451         "parameter will become keyword-only in %(removal)s.",
    452         name=name, obj_type=f"parameter of {func.__name__}()")
--> 453 return func(*args, **kwargs)

TypeError: scatter() missing 1 required positional argument: 'y'
Loading...
mistilt
Of the 90 possible reflection 23 are allowed.
Of those, there are 18 in ZOLZ  and 5 in HOLZ
Of the 47 forbidden reflection in ZOLZ  0 can be dynamically activated.
Loading...
Loading...
Of the 29790 possible reflection 7470 are allowed.
here
Of the 7470 allowed reflection 153  have unique distances.


 [hkl]  	 1/d [1/nm] 	 d [nm] 	 F^2 
[1. 1. 1.] 	 4.25 	         0.2355 	 729.11 
[0. 0. 2.] 	 4.90 	         0.2039 	 599.47 
[2. 0. 2.] 	 6.94 	         0.1442 	 333.71 
[1. 1. 3.] 	 8.13 	         0.1230 	 241.36 
[2. 2. 2.] 	 8.49 	         0.1177 	 219.62 
[0. 4. 0.] 	 9.81 	         0.1020 	 158.02 
[3. 3. 1.] 	 10.69 	         0.0936 	 128.30 
[4. 2. 0.] 	 10.97 	         0.0912 	 120.38 
[4. 2. 2.] 	 12.01 	         0.0832 	 95.48 
[3. 3. 3.] 	 12.74 	         0.0785 	 81.88 
[4. 4. 0.] 	 13.87 	         0.0721 	 65.29 
[5. 1. 3.] 	 14.51 	         0.0689 	 57.83 
[2. 4. 4.] 	 14.71 	         0.0680 	 55.65 
[2. 0. 6.] 	 15.51 	         0.0645 	 48.14 
[3. 3. 5.] 	 16.08 	         0.0622 	 43.55 
[2. 2. 6.] 	 16.27 	         0.0615 	 42.17 
[4. 4. 4.] 	 16.99 	         0.0589 	 37.33 
[1. 5. 5.] 	 17.51 	         0.0571 	 34.26 
[6. 0. 4.] 	 17.68 	         0.0566 	 33.33 
[6. 2. 4.] 	 18.35 	         0.0545 	 29.98 
[5. 3. 5.] 	 18.83 	         0.0531 	 27.81 
[0. 0. 8.] 	 19.62 	         0.0510 	 24.72 
[7. 3. 3.] 	 20.07 	         0.0498 	 23.11 
[6. 4. 4.] 	 20.22 	         0.0495 	 22.62 
[2. 2. 8.] 	 20.81 	         0.0481 	 20.78 
[5. 5. 5.] 	 21.24 	         0.0471 	 19.56 
[6. 6. 2.] 	 21.38 	         0.0468 	 19.18 
[0. 4. 8.] 	 21.93 	         0.0456 	 17.76 
[3. 7. 5.] 	 22.34 	         0.0448 	 16.79 
[2. 8. 4.] 	 22.47 	         0.0445 	 16.49 
[6. 6. 4.] 	 23.00 	         0.0435 	 15.36 
[3. 1. 9.] 	 23.39 	         0.0428 	 14.59 
[4. 4. 8.] 	 24.03 	         0.0416 	 13.43 
[5. 5. 7.] 	 24.40 	         0.0410 	 12.80 
[8. 0. 6.] 	 24.52 	         0.0408 	 12.60 
[6. 8. 2.] 	 25.01 	         0.0400 	 11.85 
[7. 7. 3.] 	 25.36 	         0.0394 	 11.32 
[6. 6. 6.] 	 25.48 	         0.0392 	 11.16 
[3. 9. 5.] 	 26.30 	         0.0380 	 10.09 
[6. 8. 4.] 	 26.41 	         0.0379 	 9.95 
[ 2.  4. 10.] 	 26.86 	         0.0372 	 9.42 
[7. 7. 5.] 	 27.19 	         0.0368 	 9.05 
[0. 8. 8.] 	 27.74 	         0.0360 	 8.48 
[5. 5. 9.] 	 28.07 	         0.0356 	 8.16 
[10.  4.  4.] 	 28.17 	         0.0355 	 8.06 
[6. 6. 8.] 	 28.60 	         0.0350 	 7.67 
[7. 9. 3.] 	 28.91 	         0.0346 	 7.39 
[ 6. 10.  2.] 	 29.01 	         0.0345 	 7.31 
[8. 8. 4.] 	 29.42 	         0.0340 	 6.97 
[7. 7. 7.] 	 29.73 	         0.0336 	 6.73 
[ 0.  2. 12.] 	 29.83 	         0.0335 	 6.66 
[ 4.  6. 10.] 	 30.23 	         0.0331 	 6.36 
[9. 7. 5.] 	 30.53 	         0.0328 	 6.15 
[12.  0.  4.] 	 31.02 	         0.0322 	 5.83 
[9. 1. 9.] 	 31.31 	         0.0319 	 5.65 
[8. 6. 8.] 	 31.40 	         0.0318 	 5.59 
[ 2.  8. 10.] 	 31.78 	         0.0315 	 5.36 
[ 5. 11.  5.] 	 32.06 	         0.0312 	 5.20 
[ 6. 10.  6.] 	 32.16 	         0.0311 	 5.15 
[ 4.  4. 12.] 	 32.53 	         0.0307 	 4.94 
[7. 9. 7.] 	 32.81 	         0.0305 	 4.80 
[10.  8.  4.] 	 32.90 	         0.0304 	 4.75 
[ 2.  6. 12.] 	 33.26 	         0.0301 	 4.58 
[5. 9. 9.] 	 33.53 	         0.0298 	 4.45 
[8. 8. 8.] 	 33.98 	         0.0294 	 4.25 
[ 7. 11.  5.] 	 34.24 	         0.0292 	 4.13 
[12.  4.  6.] 	 34.33 	         0.0291 	 4.09 
[10.  6.  8.] 	 34.68 	         0.0288 	 3.95 
[ 1. 11.  9.] 	 34.94 	         0.0286 	 3.85 
[ 2. 10. 10.] 	 35.02 	         0.0286 	 3.81 
[ 0.  8. 12.] 	 35.36 	         0.0283 	 3.68 
[9. 7. 9.] 	 35.62 	         0.0281 	 3.59 
[ 2.  8. 12.] 	 35.70 	         0.0280 	 3.56 
[ 6.  6. 12.] 	 36.04 	         0.0277 	 3.44 
[ 7. 11.  7.] 	 36.29 	         0.0276 	 3.36 
[ 8. 12.  4.] 	 36.70 	         0.0272 	 3.23 
[ 9.  5. 11.] 	 36.94 	         0.0271 	 3.15 
[ 8.  8. 10.] 	 37.03 	         0.0270 	 3.13 
[ 0.  6. 14.] 	 37.35 	         0.0268 	 3.03 
[ 1.  3. 15.] 	 37.59 	         0.0266 	 2.96 
[10. 10.  6.] 	 37.67 	         0.0265 	 2.94 
[9. 9. 9.] 	 38.22 	         0.0262 	 2.79 
[ 8.  6. 12.] 	 38.30 	         0.0261 	 2.77 
[14.  6.  4.] 	 38.62 	         0.0259 	 2.69 
[ 9.  7. 11.] 	 38.85 	         0.0257 	 2.63 
[13.  3.  9.] 	 39.46 	         0.0253 	 2.48 
[ 4. 10. 12.] 	 39.54 	         0.0253 	 2.47 
[10. 10.  8.] 	 39.84 	         0.0251 	 2.40 
[11.  5. 11.] 	 40.07 	         0.0250 	 2.35 
[ 6. 14.  6.] 	 40.14 	         0.0249 	 2.33 
[ 8. 12.  8.] 	 40.44 	         0.0247 	 2.27 
[ 5. 13.  9.] 	 40.66 	         0.0246 	 2.23 
[ 4. 14.  8.] 	 40.74 	         0.0245 	 2.21 
[ 6. 12. 10.] 	 41.03 	         0.0244 	 2.15 
[ 9.  9. 11.] 	 41.25 	         0.0242 	 2.11 
[12.  0. 12.] 	 41.61 	         0.0240 	 2.05 
[11. 11.  7.] 	 41.83 	         0.0239 	 2.01 
[ 2. 12. 12.] 	 41.90 	         0.0239 	 2.00 
[ 8. 14.  6.] 	 42.19 	         0.0237 	 1.95 
[13.  7.  9.] 	 42.40 	         0.0236 	 1.91 
[10. 10. 10.] 	 42.47 	         0.0235 	 1.90 
[12. 12.  4.] 	 42.75 	         0.0234 	 1.85 
[15.  1.  9.] 	 42.96 	         0.0233 	 1.82 
[10.  8. 12.] 	 43.03 	         0.0232 	 1.81 
[14. 10.  4.] 	 43.31 	         0.0231 	 1.77 
[ 5. 13. 11.] 	 43.52 	         0.0230 	 1.74 
[11.  9. 11.] 	 44.07 	         0.0227 	 1.66 
[14.  8.  8.] 	 44.14 	         0.0227 	 1.65 
[13.  9.  9.] 	 44.61 	         0.0224 	 1.59 
[14. 10.  6.] 	 44.68 	         0.0224 	 1.58 
[11.  7. 13.] 	 45.15 	         0.0221 	 1.52 
[14. 12.  0.] 	 45.21 	         0.0221 	 1.51 
[10. 10. 12.] 	 45.48 	         0.0220 	 1.48 
[13.  3. 13.] 	 45.68 	         0.0219 	 1.46 
[12. 12.  8.] 	 46.00 	         0.0217 	 1.42 
[ 7.  9. 15.] 	 46.20 	         0.0216 	 1.40 
[12.  4. 14.] 	 46.27 	         0.0216 	 1.39 
[ 8. 14. 10.] 	 46.52 	         0.0215 	 1.36 
[11. 11. 11.] 	 46.72 	         0.0214 	 1.34 
[11. 13.  9.] 	 47.23 	         0.0212 	 1.29 
[ 6. 14. 12.] 	 47.55 	         0.0210 	 1.26 
[15.  9.  9.] 	 48.24 	         0.0207 	 1.19 
[12. 12. 10.] 	 48.30 	         0.0207 	 1.19 
[ 0. 14. 14.] 	 48.55 	         0.0206 	 1.17 
[ 7. 11. 15.] 	 48.73 	         0.0205 	 1.15 
[10. 10. 14.] 	 48.80 	         0.0205 	 1.14 
[ 3. 15. 13.] 	 49.22 	         0.0203 	 1.11 
[ 8. 14. 12.] 	 49.29 	         0.0203 	 1.10 
[14. 14.  4.] 	 49.53 	         0.0202 	 1.08 
[11. 13. 11.] 	 49.71 	         0.0201 	 1.07 
[ 9. 13. 13.] 	 50.19 	         0.0199 	 1.03 
[15. 11.  9.] 	 50.67 	         0.0197 	 1.00 
[ 6. 14. 14.] 	 50.73 	         0.0197 	 0.99 
[12. 12. 12.] 	 50.97 	         0.0196 	 0.98 
[10. 12. 14.] 	 51.43 	         0.0194 	 0.95 
[ 7. 15. 13.] 	 51.61 	         0.0194 	 0.93 
[ 1. 15. 15.] 	 52.07 	         0.0192 	 0.90 
[14.  8. 14.] 	 52.36 	         0.0191 	 0.89 
[13. 13. 11.] 	 52.53 	         0.0190 	 0.88 
[15. 11. 11.] 	 52.99 	         0.0189 	 0.85 
[15. 13.  9.] 	 53.44 	         0.0187 	 0.82 
[14. 12. 12.] 	 53.95 	         0.0185 	 0.80 
[14. 10. 14.] 	 54.39 	         0.0184 	 0.77 
[ 7. 15. 15.] 	 54.77 	         0.0183 	 0.75 
[13. 13. 13.] 	 55.21 	         0.0181 	 0.73 
[13. 11. 15.] 	 55.65 	         0.0180 	 0.71 
[15. 15.  9.] 	 56.50 	         0.0177 	 0.67 
[14. 14. 12.] 	 56.77 	         0.0176 	 0.66 
[13. 15. 13.] 	 58.18 	         0.0172 	 0.61 
[15. 11. 15.] 	 58.59 	         0.0171 	 0.59 
[14. 14. 14.] 	 59.46 	         0.0168 	 0.56 
[15. 13. 15.] 	 61.01 	         0.0164 	 0.51 
[15. 15. 15.] 	 63.71 	         0.0157 	 0.44 
(np.float64(17732.5), np.float64(311975.0), np.float64(25086.0), np.float64(155987.5), np.float64(0.0))
Loading...
Loading...
Loading...
Loading...
-60952
[      0   39338   78669  117989  157237  196576  235894  275245  314578
  353860  393154  432446  471759  511116  550399  589665  628940  668152
  707381  746598  785861  825122  864417  903674  942946  982206 1021462
 1060746 1099981 1139199 1178445 1217647 1256918 1296153 1335367 1374617
 1413836 1453061 1492242 1531462 1570657 1609873 1649126 1688291 1727463
 1766701 1805889 1845093 1884299 1923506 1962751 2001969 2041178 2080387
 2119505 2158702 2197869 2237021 2276166 2315345 2354514 2393669 2432796]
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[61], line 11
      8     for i in range(40):
      9         for j in range(pixels[i+frame],pixels[i+1+frame]):
     10             #print(i, j, data[j])
---> 11             if data[j] < 65535:
     12                 spectra[i, int(data[j]/2)] += 1
     13 plt.figure()

KeyError: 2414189
(38282, 38270)
{'Detector-0': {'DetectorName': 'BF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '51', 'Offset': '0', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-1': {'DetectorName': 'BM-Ceta', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-2': {'DetectorName': 'DF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '39.371789999999997', 'Offset': '-2.4570908548628407e-09', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-3': {'DetectorName': 'EF-CCD', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-4': {'DetectorName': 'Flucam', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Gain': '0.69999999999999996', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '256', 'top': '256', 'right': '768', 'bottom': '768'}, 'ExposureTime': '0.050000000000000003', 'Shutters': {'Shutter-0': {'Position': 'None', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '3'}, 'Detector-5': {'DetectorName': 'HAADF', 'DetectorType': 'ScanningDetector', 'Inserted': 'true', 'Enabled': 'true', 'Gain': '21', 'Offset': '-1.752', 'CollectionAngleRange': {'begin': '0.028128613800167915', 'end': '0.17011625824861207'}}, 'Detector-6': {'DetectorName': 'SuperXG21', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '0.78539816339744828', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279083749999999', 'LiveTime': '1.9127875249999999', 'InputCountRate': '518', 'OutputCountRate': '514', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.359999999999999', 'BeginEnergy': '120'}, 'Detector-7': {'DetectorName': 'SuperXG22', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '2.3561944901923448', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279108249999999', 'LiveTime': '1.9045893230846773', 'InputCountRate': '477', 'OutputCountRate': '471', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.170000000000002', 'BeginEnergy': '120'}, 'Detector-8': {'DetectorName': 'SuperXG23', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '3.9269908169872414', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279065', 'LiveTime': '1.7213450892857143', 'InputCountRate': '22', 'OutputCountRate': '19', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '24.350000000000001', 'BeginEnergy': '120'}, 'Detector-9': {'DetectorName': 'SuperXG24', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '5.497787143782138', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279071249999999', 'LiveTime': '1.9225814147099447', 'InputCountRate': '359', 'OutputCountRate': '357', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.460000000000001', 'BeginEnergy': '120'}}
{'Detector-0': {'DetectorName': 'BF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '51', 'Offset': '0', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-1': {'DetectorName': 'BM-Ceta', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-2': {'DetectorName': 'DF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '39.371789999999997', 'Offset': '-2.4570908548628407e-09', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-3': {'DetectorName': 'EF-CCD', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-4': {'DetectorName': 'Flucam', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Gain': '0.69999999999999996', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '256', 'top': '256', 'right': '768', 'bottom': '768'}, 'ExposureTime': '0.050000000000000003', 'Shutters': {'Shutter-0': {'Position': 'None', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '3'}, 'Detector-5': {'DetectorName': 'HAADF', 'DetectorType': 'ScanningDetector', 'Inserted': 'true', 'Enabled': 'true', 'Gain': '21', 'Offset': '-1.752', 'CollectionAngleRange': {'begin': '0.028128613800167915', 'end': '0.17011625824861207'}}, 'Detector-6': {'DetectorName': 'SuperXG21', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '0.78539816339744828', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279083749999999', 'LiveTime': '1.9127875249999999', 'InputCountRate': '518', 'OutputCountRate': '514', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.359999999999999', 'BeginEnergy': '120'}, 'Detector-7': {'DetectorName': 'SuperXG22', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '2.3561944901923448', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279108249999999', 'LiveTime': '1.9045893230846773', 'InputCountRate': '477', 'OutputCountRate': '471', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.170000000000002', 'BeginEnergy': '120'}, 'Detector-8': {'DetectorName': 'SuperXG23', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '3.9269908169872414', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279065', 'LiveTime': '1.7213450892857143', 'InputCountRate': '22', 'OutputCountRate': '19', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '24.350000000000001', 'BeginEnergy': '120'}, 'Detector-9': {'DetectorName': 'SuperXG24', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '5.497787143782138', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279071249999999', 'LiveTime': '1.9225814147099447', 'InputCountRate': '359', 'OutputCountRate': '357', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.460000000000001', 'BeginEnergy': '120'}}
{'Detector-0': {'DetectorName': 'BF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '51', 'Offset': '0', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-1': {'DetectorName': 'BM-Ceta', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-2': {'DetectorName': 'DF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '39.371789999999997', 'Offset': '-2.4570908548628407e-09', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-3': {'DetectorName': 'EF-CCD', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-4': {'DetectorName': 'Flucam', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Gain': '0.69999999999999996', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '256', 'top': '256', 'right': '768', 'bottom': '768'}, 'ExposureTime': '0.050000000000000003', 'Shutters': {'Shutter-0': {'Position': 'None', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '3'}, 'Detector-5': {'DetectorName': 'HAADF', 'DetectorType': 'ScanningDetector', 'Inserted': 'true', 'Enabled': 'true', 'Gain': '21', 'Offset': '-1.752', 'CollectionAngleRange': {'begin': '0.028128613800167915', 'end': '0.17011625824861207'}}, 'Detector-6': {'DetectorName': 'SuperXG21', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '0.78539816339744828', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.997004475', 'LiveTime': '1.9774643137964774', 'InputCountRate': '518', 'OutputCountRate': '514', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.359999999999999', 'BeginEnergy': '120'}, 'Detector-7': {'DetectorName': 'SuperXG22', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '2.3561944901923448', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9970115499999999', 'LiveTime': '1.9727071497971602', 'InputCountRate': '477', 'OutputCountRate': '471', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.170000000000002', 'BeginEnergy': '120'}, 'Detector-8': {'DetectorName': 'SuperXG23', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '3.9269908169872414', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.99701025', 'LiveTime': '1.8490835648148147', 'InputCountRate': '22', 'OutputCountRate': '19', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '24.350000000000001', 'BeginEnergy': '120'}, 'Detector-9': {'DetectorName': 'SuperXG24', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '5.497787143782138', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9970127499999999', 'LiveTime': '1.9859795303867402', 'InputCountRate': '359', 'OutputCountRate': '357', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.460000000000001', 'BeginEnergy': '120'}}
{'Detector-0': {'DetectorName': 'BF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '51', 'Offset': '0', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-1': {'DetectorName': 'BM-Ceta', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-2': {'DetectorName': 'DF-S', 'DetectorType': 'ScanningDetector', 'Inserted': 'false', 'Enabled': 'true', 'Gain': '39.371789999999997', 'Offset': '-2.4570908548628407e-09', 'CollectionAngleRange': {'begin': '0', 'end': '0'}}, 'Detector-3': {'DetectorName': 'EF-CCD', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '0', 'top': '0', 'right': '4096', 'bottom': '4096'}, 'ExposureTime': '0.5', 'Shutters': {'Shutter-0': {'Position': 'PostSpecimen', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '2'}, 'Detector-4': {'DetectorName': 'Flucam', 'DetectorType': 'ImagingDetector', 'ExposureMode': '', 'Gain': '0.69999999999999996', 'Binning': {'width': '1', 'height': '1'}, 'ReadOutArea': {'left': '256', 'top': '256', 'right': '768', 'bottom': '768'}, 'ExposureTime': '0.050000000000000003', 'Shutters': {'Shutter-0': {'Position': 'None', 'Type': 'Electrostatic'}}, 'DarkGainCorrectionType': '3'}, 'Detector-5': {'DetectorName': 'HAADF', 'DetectorType': 'ScanningDetector', 'Inserted': 'true', 'Enabled': 'true', 'Gain': '21', 'Offset': '-1.752', 'CollectionAngleRange': {'begin': '0.028128613800167915', 'end': '0.17011625824861207'}}, 'Detector-6': {'DetectorName': 'SuperXG21', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '0.78539816339744828', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279083749999999', 'LiveTime': '1.9127875249999999', 'InputCountRate': '518', 'OutputCountRate': '514', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.359999999999999', 'BeginEnergy': '120'}, 'Detector-7': {'DetectorName': 'SuperXG22', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '2.3561944901923448', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279108249999999', 'LiveTime': '1.9045893230846773', 'InputCountRate': '477', 'OutputCountRate': '471', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.170000000000002', 'BeginEnergy': '120'}, 'Detector-8': {'DetectorName': 'SuperXG23', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '3.9269908169872414', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279065', 'LiveTime': '1.7213450892857143', 'InputCountRate': '22', 'OutputCountRate': '19', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '24.350000000000001', 'BeginEnergy': '120'}, 'Detector-9': {'DetectorName': 'SuperXG24', 'DetectorType': 'AnalyticalDetector', 'Inserted': 'true', 'Enabled': 'true', 'ElevationAngle': '0.31415926999999999', 'AzimuthAngle': '5.497787143782138', 'CollectionAngle': '0.69999999999999996', 'Dispersion': '5', 'PulseProcessTime': '3.0000000000000001e-06', 'RealTime': '1.9279071249999999', 'LiveTime': '1.9225814147099447', 'InputCountRate': '359', 'OutputCountRate': '357', 'AnalyticalDetectorShutterState': '4', 'OffsetEnergy': '-250', 'ElectronicsNoise': '25.460000000000001', 'BeginEnergy': '120'}}
Loading...
(2466020,)
Loading...
1.0
Loading...

Some of the metadata is available in the metadata attribute of the dataset but all information can be found in original metadata.

Complete Registration

Takes a while, depending on your computer between 1 and 10 minutes

Rigid Registration

Using sub-pixel accuracy registration determination method of:

Manuel Guizar-Sicairos, Samuel T. Thurman, and James R. Fienup, “Efficient subpixel image registration algorithms,” Optics Letters 33, 156-158 (2008). DOI:10.1364/OL.33.000156

as implemented in phase_cross_correlation function by scikit-image in the registration package.

Non-Rigid Registration

Here we use the Diffeomorphic Demon Non-Rigid Registration as provided by simpleITK.

Please Cite:

Stack contains  25  images, each with 512  pixels in x-direction and  512  pixels in y-direction
Loading...
Loading...
Loading...
Loading...
:-)
You have successfully completed Diffeomorphic Demons Registration
Loading...
Loading...

Or do it all together

You will need to zoom in to see that the images are changing.

Compare this to the rigid registered stack

'C:\\Users\\gduscher\\Downloads\\0047 - 20250226 4.30 Mx STEM HAADF Diffraction 23.2 nm.'

Check Drift

Loading...

Find Atom Positions

Lucy -Richardson Deconvolution

Lucy - Richardson Deconvolution removes noise and convolutes the intensity back into the atom (columns).

Here we use a slightly modified Lucy - Richardson Deconvolution which stops when converged.

Ideally the atom_size should be as large as the atoms in the image.

A good Lucy-Richardson Deconvolution should result in an image with atoms of a radius of about 2 pixels.

The number of steps to convergence should be less than 300 for a good approximation of atom_size.

we use the non-rigid registered datset

3.7470220056147725
3.7470220056147725 0.06
Deconvolution of 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[62], line 21
     18 gauss_probe = pyTEMlib.probe_tools.make_gauss(image3.shape[0], image.shape[1], gauss_diameter)
     20 print('Deconvolution of ')# , dataset.title)
---> 21 LR_dataset = pyTEMlib.image_tools.decon_lr(image3, gauss_probe, verbose=False)
     23 extent = LR_dataset.get_extent([0,1])
     24 fig, ax = plt.subplots(1, 2, figsize=(8, 4), sharex=True, sharey=True)

File ~\OneDrive - University of Tennessee\GitHub\pyTEMlib\notebooks\Imaging\../..\pyTEMlib\image_tools\image_clean.py:131, in decon_lr(o_image, resolution, verbose)
    128 if len(o_image) < 1:
    129     return o_image
--> 131 image_dimensions = o_image.get_image_dims(return_axis=True)
    132 scale_x = image_dimensions[0].slope
    133 gauss_diameter = resolution/scale_x

AttributeError: 'numpy.ndarray' object has no attribute 'get_image_dims'

Log Deconvolution

{'analysis': {'Lucy_Richardson': {'notebook': 'Image_Registration', 'input': '20-3D Stack_10', 'probe_diameter': 3, 'kind_of_probe': 'Gauss', 'probe_width': 0.06}}, 'experiment': {'convergence_angle': 30, 'acceleration_voltage': 200000.0, 'wavelength': 0.0025079340436272276}, 'input_crop': [3, 509, 2, 507], 'input_shape': (512, 25), 'input_dataset': '20-3D Stack_10'}

Atom Detection with Blob-Finder

Choose threshold and atom size so that all atoms or at least all bright atoms of an unit cell are found

Loading...

Log Atom Positions

{'non-rigid demon registration': {}, 'atom_pixel': {'analysis': 'Atom Positions', 'atoms': array([[6.0000000e+00, 4.5000000e+01, 5.0000001e-02], [6.0000000e+00, 1.2100000e+02, 5.0000001e-02], [4.9800000e+02, 1.1000000e+01, 5.0000001e-02], ..., [5.0300000e+02, 1.4600000e+02, 5.0000001e-02], [4.4000000e+02, 2.0000000e+00, 1.5555555e-01], [5.0300000e+02, 5.7000000e+01, 5.0000001e-02]], dtype=float32), 'atom_size': 0.05, 'threshold': 20.7, 'pixel_size': 1, 'name': 'Atom finding', 'title': 'Atom finding'}}

Refine All Atom Positions

Fitting of a Gaussian into the center of an atom

There will be convergence errors if the atom_radius value is too large or too small

Loading...
sidpy.Dataset of type IMAGE_STACK with:
 dask.array<sub, shape=(506, 505), dtype=float64, chunksize=(506, 505), chunktype=numpy.ndarray>
 data contains: intensity (counts)
 and Dimensions: 
x:  Length (nm) of size (506,)
y:  Length (nm) of size (505,)
 with metadata: ['analysis', 'experiment', 'input_crop', 'input_shape', 'input_dataset']
using radius  3 pixels
Loading...
C:\Users\gduscher\OneDrive - University of Tennessee\GitHub\Image_Distortion\../pyTEMlib\pyTEMlib\probe_tools.py:17: RuntimeWarning: invalid value encountered in divide
  probe = g / g.sum() * intensity
Loading...

Log Refined Atom Positions

Analyse Atom Position

Find angles of all unit cells

Define Crystal and Zone-Axis

Au
projected atomic numbers
(array([5.76744575e+00, 5.76744575e+00, 1.11022302e-16]), array([3.60179102e+01, 3.60179102e+01, 6.93338351e-16]), array([90., 90., 60.]), array([0. , 2.88372288, 2.88372288, 4.99475453]), array([[ 0.00000000e+00, 0.00000000e+00, -1.16901319e-02], [ 0.00000000e+00, 5.00000000e-01, 5.00000000e-01], [ 5.00000000e-01, 1.08088567e-17, 5.00000000e-01], [ 5.00000000e-01, 5.00000000e-01, 1.01169013e+00]]))
CPU times: total: 1.48 s
Wall time: 1.59 s
Loading...
SrTiO3
projected atomic numbers
[90. 90. 90.]
(array([3.905268, 3.905268, 1.952634]), array([0.3905268, 0.3905268, 0.1952634]), array([90., 90., 90.]), array([0. , 2.76144149, 2.76144149, 1.952634 , 1.952634 ]), array([[0. , 0. , 0. ], [0.5, 0.5, 1. ], [0.5, 0.5, 0. ], [0. , 0.5, 1. ], [0.5, 0. , 1. ]]))

Analyse Angles of Unit Cells

1183
 Average unit cell angle 56.2 with standard deviation 1.55; from 50.9 to 60.9
Loading...
Loading...
Loading...

Rigid Angle Graph Hopping

924
0.95613337
Loading...
(545, 3)
1.0460007
Loading...

Structure Anlysis

Find all unit cells

extent [506. 505.   0.]
Find interstitials (finding centers for different elements takes a bit)
Loading...
(575, 512)
Loading...

Appendix

Demon Registration

Here we use the Diffeomorphic Demon Non-Rigid Registration as provided by simpleITK.

Please Cite:

This Non-Rigid Registration consists of the following steps:

  • determine reference image

    • For this we use the average of the rigid registered stack

    • this averaged stack is then smeared with a Gaussian of sigma 2 pixel to reduce noise

    • under the assumption that high frequency scan distortions cancel out over several images, we, therefore, obtained the center of mass of the atoms.

  • perform the demon registration filter to determine a distortion matrix

    • each single image of a stack is first smeared with a Gaussian of sigma of 2pixels

    • then the deformation matrix is determined for these images

    • the deformation matrix is a matrix where each pixel has a vector ( x, and y value) for the relative shift of this pixel.

  • This deformation matrix is used to transform the image

    • The transformation is performed on the original image.

    • Important, here, is to set the interpolator method, (the image needs to be interpolated because the new pixels are not on an integer grid.)

Let’s see what the different interpolators do.

MethodRMS contrastStandardMean
original0.19658060.077641140.3949583
Linear0.201593150.0794703660.39421165
BSpline0.201626060.07948310.39421043
Gaussian0.143105820.0564143020.39421389
Hamming0.201632930.079486720.39421496

The Gaussian interpolator as the only one seems to smear the signal.

We will use the Bspline method a fast and simple method that does not introduce spurious features and does not smear the signal.

Full Code of Demon registration