Commit 8548aba9 authored by payno's avatar payno
Browse files

[core][tomoh5tonx] add information regarding field of view

/close #8
parent 28f5fb79
Pipeline #30509 passed with stage
in 24 seconds
......@@ -669,6 +669,8 @@ class _Acquisition:
_NAME_PATH = 'technique/scan/name'
_FOV_PATH = 'technique/scan/field_of_view'
def __init__(self, entry: h5py.Group, file_keys: H5FileKeys, scan_titles):
self._initialization_entry = entry
self._indexes = entry[_Acquisition._SCAN_NUMBER_PATH]
......@@ -1082,6 +1084,10 @@ class _Acquisition:
if y_magnified_pix_size is not None:
detector_node['y_magnified_pixel_size'] = y_magnified_pix_size
detector_node['y_magnified_pixel_size'].attrs['unit'] = unit
# write field of view
fov = self._get_field_of_fiew()
if fov is not None:
detector_node['field_of_view'] = fov
def _create_data_virtual_dataset(self, detector_node):
if (self.n_frames is None or self.dim_1 is None or self.dim_2 is None
......@@ -1218,6 +1224,13 @@ class _Acquisition:
_logger.warning("unable to find %s magnified pixel size. Will be skip" % axis)
return None, None
def _get_field_of_fiew(self):
if self._FOV_PATH in self._initialization_entry:
return self.initialization_entry[self._FOV_PATH][()]
else:
_logger.warning("unable to find information regarding field of view")
return None
@staticmethod
def _get_unit(node: h5py.Dataset, default_unit):
"""Simple process to retrieve unit from an attribute"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment