Commit 8b8df2aa authored by payno's avatar payno
Browse files

Merge branch 'fix_auto_halftomo' into 'master'

Fix enable_halftomo = auto when FOV == "Full"

See merge request !138
parents bdb7c264 ad67c792
Pipeline #49591 passed with stages
in 5 minutes and 43 seconds
__version__ = "2021.1.3-dev"
__version__ = "2021.1.4-dev"
__nabu_modules__ = [
"app",
"cuda",
......
......@@ -50,9 +50,20 @@ class NabuValidator(object):
res = last_idx + idx
return res
@property
def is_halftomo(self):
do_halftomo = self.nabu_config["reconstruction"].get("enable_halftomo", False)
if do_halftomo == "auto":
do_halftomo = self.dataset_infos.is_halftomo
if do_halftomo is None:
raise ValueError(
"'enable_halftomo' was set to 'auto' but unable to get the information on field of view"
)
return do_halftomo
def _get_nx_ny(self, binning=1):
if self.nabu_config["reconstruction"]["enable_halftomo"]:
if self.is_halftomo:
cor = int(round(self.dataset_infos.axis_position / binning))
nx = self.dataset_infos.radio_dims[0] // binning
nx = max(2*cor, 2 * (nx - 1 - cor))
......@@ -68,7 +79,7 @@ class NabuValidator(object):
"""
nx, nz = self.dataset_infos.radio_dims
ny = nx
if self.nabu_config["reconstruction"]["enable_halftomo"]:
if self.is_halftomo:
if self.dataset_infos.axis_position is None:
raise ValueError("Cannot use rotation axis position in the middle of the detector when half tomo is enabled")
nx, ny = self._get_nx_ny()
......
Markdown is supported
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