pyTEMlib 0.2025.4.0__py3-none-any.whl → 0.2025.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyTEMlib might be problematic. Click here for more details.
- pyTEMlib/file_tools.py +29 -3
- pyTEMlib/image_tools.py +15 -2
- pyTEMlib/version.py +2 -2
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/METADATA +1 -1
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/RECORD +9 -9
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/WHEEL +0 -0
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/entry_points.txt +0 -0
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/licenses/LICENSE +0 -0
- {pytemlib-0.2025.4.0.dist-info → pytemlib-0.2025.4.2.dist-info}/top_level.txt +0 -0
pyTEMlib/file_tools.py
CHANGED
|
@@ -1457,10 +1457,12 @@ def read_adorned_metadata(image):
|
|
|
1457
1457
|
root = ET.fromstring(xml_str)
|
|
1458
1458
|
metadata_dict = etree_to_dict(root)
|
|
1459
1459
|
detector = 'detector'
|
|
1460
|
-
|
|
1461
|
-
|
|
1460
|
+
|
|
1461
|
+
if 'Detectors' in metadata_dict['Metadata']:
|
|
1462
|
+
if 'ScanningDetector' in metadata_dict['Metadata']['Detectors']:
|
|
1462
1463
|
detector = metadata_dict['Metadata']['Detectors']['ScanningDetector']['DetectorName']
|
|
1463
|
-
|
|
1464
|
+
elif 'ImagingDetector' in metadata_dict['Metadata']['Detectors']:
|
|
1465
|
+
detector = metadata_dict['Metadata']['Detectors']['ImagingDetector']['DetectorName']
|
|
1464
1466
|
segment = ''
|
|
1465
1467
|
if 'CustomPropertyGroup' in metadata_dict['Metadata']:
|
|
1466
1468
|
if 'CustomProperties' in metadata_dict['Metadata']['CustomPropertyGroup']:
|
|
@@ -1476,6 +1478,29 @@ def read_adorned_metadata(image):
|
|
|
1476
1478
|
segment = '_'+item['@value']
|
|
1477
1479
|
return detector+segment, metadata_dict['Metadata']
|
|
1478
1480
|
|
|
1481
|
+
|
|
1482
|
+
def get_metadata_from_adorned(ds):
|
|
1483
|
+
ds.metadata['experiment']= {}
|
|
1484
|
+
if 'Optics' in ds.original_metadata:
|
|
1485
|
+
if 'LastMeasuredScreenCurrent' in ds.original_metadata['Optics']:
|
|
1486
|
+
ds.metadata['experiment']['current'] = float(ds.original_metadata['Optics']['LastMeasuredScreenCurrent'])
|
|
1487
|
+
if 'ConvergenceAngle' in ds.original_metadata['Optics']:
|
|
1488
|
+
ds.metadata['experiment']['convergence_angle'] = float(ds.original_metadata['Optics']['ConvergenceAngle'])
|
|
1489
|
+
if 'AccelerationVoltage' in ds.original_metadata['Optics']:
|
|
1490
|
+
ds.metadata['experiment']['acceleration_voltage'] = float(ds.original_metadata['Optics']['AccelerationVoltage'])
|
|
1491
|
+
if 'SpotIndex' in ds.original_metadata['Optics']:
|
|
1492
|
+
ds.metadata['experiment']['spot_size'] = ds.original_metadata['Optics']['SpotIndex']
|
|
1493
|
+
if' StagesSettings' in ds.original_metadata:
|
|
1494
|
+
if 'StagePosition' in ds.original_metadata['StagesSettings']:
|
|
1495
|
+
ds.metadata['experiment']['stage_position'] = ds.original_metadata['StagesSettings']['StagePosition']
|
|
1496
|
+
if 'Detectors' in ds.original_metadata:
|
|
1497
|
+
if 'ScanningDetector' in ds.original_metadata['Detectors']:
|
|
1498
|
+
ds.metadata['experiment']['detector'] = ds.original_metadata['Detectors']['ScanningDetector']['DetectorName']
|
|
1499
|
+
elif 'ImagingDetector' in ds.original_metadata['Detectors']:
|
|
1500
|
+
ds.metadata['experiment']['detector'] = ds.original_metadata['Detectors']['ImagingDetector']['DetectorName']
|
|
1501
|
+
ds.metadata['experiment']['exposure_time'] = ds.original_metadata['Detectors']['ImagingDetector']['ExposureTime']
|
|
1502
|
+
|
|
1503
|
+
|
|
1479
1504
|
def adorned_to_sidpy(images):
|
|
1480
1505
|
"""
|
|
1481
1506
|
Convert a list of adorned images to a dictionary of Sidpy datasets.
|
|
@@ -1519,6 +1544,7 @@ def adorned_to_sidpy(images):
|
|
|
1519
1544
|
ds.set_dimension(1, sidpy.Dimension(np.arange(image.data.shape[1]) * pixel_size_x_nm,
|
|
1520
1545
|
name='x', units='nm', quantity='Length', dimension_type='spatial'))
|
|
1521
1546
|
|
|
1547
|
+
get_metadata_from_adorned(ds)
|
|
1522
1548
|
return data_sets
|
|
1523
1549
|
|
|
1524
1550
|
|
pyTEMlib/image_tools.py
CHANGED
|
@@ -639,8 +639,21 @@ def rigid_registration(dataset, normalization=None):
|
|
|
639
639
|
normalization = None
|
|
640
640
|
|
|
641
641
|
if dataset.get_dimensions_by_type('TEMPORAL')[0] != 0:
|
|
642
|
-
|
|
643
|
-
|
|
642
|
+
x = dataset.x
|
|
643
|
+
y = dataset.y
|
|
644
|
+
z = dataset.z
|
|
645
|
+
metadata = dataset.metadata.copy()
|
|
646
|
+
original_metadata = dataset.original_metadata.copy()
|
|
647
|
+
arr = np.rollaxis(np.array(dataset), 2, 0)
|
|
648
|
+
dataset = sidpy.Dataset.from_array(arr, title=dataset.title, data_type='IMAGE_STACK',
|
|
649
|
+
quantity=dataset.quantity, units=dataset.units)
|
|
650
|
+
dataset.set_dimension(0, sidpy.Dimension(z.values, name='frame', units='frame', quantity='time',
|
|
651
|
+
dimension_type='temporal'))
|
|
652
|
+
dataset.set_dimension(1, x)
|
|
653
|
+
dataset.set_dimension(2, y)
|
|
654
|
+
dataset.metadata = metadata
|
|
655
|
+
dataset.original_metadata = original_metadata
|
|
656
|
+
|
|
644
657
|
stack_dim = dataset.get_dimensions_by_type('TEMPORAL', return_axis=True)[0]
|
|
645
658
|
image_dim = dataset.get_image_dims(return_axis=True)
|
|
646
659
|
if len(image_dim) != 2:
|
pyTEMlib/version.py
CHANGED
|
@@ -10,13 +10,13 @@ pyTEMlib/eds_tools.py,sha256=Ilof2Cars-1ILXx5g2RsU2G4BgrPwjOHgQ7-OabmbrU,28000
|
|
|
10
10
|
pyTEMlib/eels_dialog.py,sha256=QG_PU3uuzus_3I3zjfaxb2a9iYq8B053zYw-B52JklM,32595
|
|
11
11
|
pyTEMlib/eels_dialog_utilities.py,sha256=73W9jFbPx-eeLEiSaBptTgGLr40bIYYfSyzLnZbhfvo,51761
|
|
12
12
|
pyTEMlib/eels_tools.py,sha256=pl75ZDQHz1JngxD84T_595Kfrl5TEJSETPGgkXfBtrA,88688
|
|
13
|
-
pyTEMlib/file_tools.py,sha256=
|
|
13
|
+
pyTEMlib/file_tools.py,sha256=RniTJrcuiyt7PefE5SSY_z2pTZPTNhFRjb2oVXVa4nE,66373
|
|
14
14
|
pyTEMlib/file_tools_qt.py,sha256=tLZACS4JyGH_AOzNR_SGAhjA01y4VJB261opPhGMlm8,7223
|
|
15
15
|
pyTEMlib/graph_tools.py,sha256=VWuTgFGeu4gn4cfRgf-76kO6u2B1ZV_dz6gLfx2k4NY,46570
|
|
16
16
|
pyTEMlib/graph_viz.py,sha256=m5PwSn6l2r0bsaLWBDSHc9IGR3_PneG2BrZgnEdi07I,13644
|
|
17
17
|
pyTEMlib/image_dialog.py,sha256=F-ZgKq7UnMtPPd1b9eqb7t8MXDfWN-8hVKwB2Il0x28,6235
|
|
18
18
|
pyTEMlib/image_dlg.py,sha256=n5gradDiYOFGEQ3k_Wlk9RUYYzl4bl_hKLzNVcYteNE,5694
|
|
19
|
-
pyTEMlib/image_tools.py,sha256=
|
|
19
|
+
pyTEMlib/image_tools.py,sha256=g0P_r0Ygehadi-aVufQs0CahB1N7Teyrx2oTEOBChmA,53007
|
|
20
20
|
pyTEMlib/info_widget.py,sha256=lkzQOuNVlkaasiZDtc5UtYk541-plYNfnW4DQwQB_iA,53467
|
|
21
21
|
pyTEMlib/info_widget3.py,sha256=QSbdSj6m57KQTir2fNhulVgjOu9EQL31c-9SzTlghnE,55495
|
|
22
22
|
pyTEMlib/interactive_image.py,sha256=5PwypcA1OjLAD-fi8bmWWFHuOjdIPVY9Dh59V24WuDA,34
|
|
@@ -28,11 +28,11 @@ pyTEMlib/peak_dlg.py,sha256=qcjcnhwpGa4jBCeXzwQz9sCyX-tHsLLQ67ToqfKOiQY,11550
|
|
|
28
28
|
pyTEMlib/probe_tools.py,sha256=sDW9CW3SMwjvSHYcEufceismHv_LVkqxcS-gCtEklCg,37926
|
|
29
29
|
pyTEMlib/sidpy_tools.py,sha256=0oIx-qMtEmcZmLazQKW19dd-KoxyY3B15aIeMcyHA8E,4878
|
|
30
30
|
pyTEMlib/simulation_tools.py,sha256=RmegD5TpQMU68uASvzZWVplAqs7bM5KkF6bWDWLjyc0,2799
|
|
31
|
-
pyTEMlib/version.py,sha256=
|
|
31
|
+
pyTEMlib/version.py,sha256=sLEWA3eeGfLH2FDGCSFBKKzQ7hDmULfKjeBegz_cqAI,94
|
|
32
32
|
pyTEMlib/xrpa_x_sections.py,sha256=m4gaH7gaJiNi-CsIT9aKoH4fB6MQIAe876kxEmzSebI,1825392
|
|
33
|
-
pytemlib-0.2025.4.
|
|
34
|
-
pytemlib-0.2025.4.
|
|
35
|
-
pytemlib-0.2025.4.
|
|
36
|
-
pytemlib-0.2025.4.
|
|
37
|
-
pytemlib-0.2025.4.
|
|
38
|
-
pytemlib-0.2025.4.
|
|
33
|
+
pytemlib-0.2025.4.2.dist-info/licenses/LICENSE,sha256=7HdBF6SXIBd38bHOKkQd4DYR1KV-OYm9mwB16fM-984,1062
|
|
34
|
+
pytemlib-0.2025.4.2.dist-info/METADATA,sha256=C-qYZn0VpCQOyMbwDFbgxjzcBYzz8D76cucXAxq0R7o,3515
|
|
35
|
+
pytemlib-0.2025.4.2.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
36
|
+
pytemlib-0.2025.4.2.dist-info/entry_points.txt,sha256=zn2yO1IWTutI3c7C9e3GdARCvm43JURoOhqQ8YylV4Y,43
|
|
37
|
+
pytemlib-0.2025.4.2.dist-info/top_level.txt,sha256=rPLVH0UJxrPSPgSoKScTjL1K_X69JFzsYYnDnYTYIlU,9
|
|
38
|
+
pytemlib-0.2025.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|