Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions httomo/method_wrappers/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading