From 99e8c9e1932adfe61991663057862ef788c62e3b Mon Sep 17 00:00:00 2001 From: Henri Payno Date: Wed, 31 Aug 2022 11:43:23 +0200 Subject: [PATCH 1/2] edf2nx configuration: set default distance and translation to millimeter close #113 --- nxtomomill/io/config/edfconfig.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxtomomill/io/config/edfconfig.py b/nxtomomill/io/config/edfconfig.py index f6fc227..add7901 100644 --- a/nxtomomill/io/config/edfconfig.py +++ b/nxtomomill/io/config/edfconfig.py @@ -331,11 +331,11 @@ class TomoEDFConfig(ConfigBase): # units self._pixel_size_unit = MetricSystem.MICROMETER - self._distance_unit = MetricSystem.CENTIMETER + self._distance_unit = MetricSystem.MILLIMETER self._energy_unit = EnergySI.KILOELECTRONVOLT - self._x_trans_unit = MetricSystem.CENTIMETER - self._y_trans_unit = MetricSystem.CENTIMETER - self._z_trans_unit = MetricSystem.CENTIMETER + self._x_trans_unit = MetricSystem.MILLIMETER + self._y_trans_unit = MetricSystem.MILLIMETER + self._z_trans_unit = MetricSystem.MILLIMETER # sample self._sample_name = None -- GitLab From 66c005449c4985ae807c7124eec9f19a2a729dd5 Mon Sep 17 00:00:00 2001 From: Henri Payno Date: Wed, 31 Aug 2022 11:53:04 +0200 Subject: [PATCH 2/2] add some progress during metadata retrieving. We cannot provide a real estimation of it. This is only used to show some processing is done. Signed-off-by: Henri Payno --- nxtomomill/converter/edf/edfconverter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nxtomomill/converter/edf/edfconverter.py b/nxtomomill/converter/edf/edfconverter.py index 978c62e..6083677 100644 --- a/nxtomomill/converter/edf/edfconverter.py +++ b/nxtomomill/converter/edf/edfconverter.py @@ -197,6 +197,16 @@ def from_edf_to_nx(configuration: TomoEDFConfig, progress=None) -> tuple: else: scan_info = None + if progress and hasattr(progress, "set_name"): + progress.set_name( + "preprocessing - retrieve all metadata (can take a few seconds - cannot display real advancement)" + ) + progress.reset() + if hasattr(progress, "progress"): + progress.progress = 50.0 + else: + progress = 50.0 + scan = EDFTomoScan( scan=configuration.input_folder, dataset_basename=configuration.dataset_basename, -- GitLab