From 34fd6fa47b6046639e5f7fb5c7a2debdfdf95de0 Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 24 Jul 2026 16:01:52 +0100 Subject: [PATCH] fixing tomopy recon related issue --- httomo/method_wrappers/reconstruction.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/httomo/method_wrappers/reconstruction.py b/httomo/method_wrappers/reconstruction.py index ba653f949..4d02797a7 100644 --- a/httomo/method_wrappers/reconstruction.py +++ b/httomo/method_wrappers/reconstruction.py @@ -37,16 +37,18 @@ def _build_kwargs( len(self.parameters) >= 2 ), "recon methods always take data + angles as the first 2 parameters" updated_params = {**dict_params, self.parameters[1]: dataset.angles_radians} - if "detector_pad" not in dict_params: - updated_params.update({"detector_pad": 0}) - else: - if dict_params["detector_pad"]: - det_half = dataset.data.shape[2] // 2 - padded_value_exact = int(np.sqrt(2 * (det_half**2))) - det_half - padded_add_margin = padded_value_exact // 2 - dict_params["detector_pad"] = padded_value_exact + padded_add_margin - detpad_str = f" The calculated 'detector_pad' value is {dict_params["detector_pad"]}" - log_once(detpad_str) + if "sinogram_order" not in dict_params: + # avoid passing detector_pad argument to TomoPy reconstruction + if "detector_pad" not in dict_params: + updated_params.update({"detector_pad": 0}) + else: + if dict_params["detector_pad"]: + det_half = dataset.data.shape[2] // 2 + padded_value_exact = int(np.sqrt(2 * (det_half**2))) - det_half + padded_add_margin = padded_value_exact // 2 + dict_params["detector_pad"] = padded_value_exact + padded_add_margin + detpad_str = f" The calculated 'detector_pad' value is {dict_params["detector_pad"]}" + log_once(detpad_str) return super()._build_kwargs(updated_params, dataset) def _calculate_max_slices_iterative(