Commit 051708c6 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Auto-CoR: dont do flatfield when it is disabled

parent a3152389
Pipeline #35254 passed with stages
in 14 minutes and 33 seconds
......@@ -7,7 +7,7 @@ class CORFinder:
"""
An application-type class for finding the Center Of Rotation (COR).
"""
def __init__(self, dataset_info, angles=None, halftomo=False):
def __init__(self, dataset_info, angles=None, halftomo=False, do_flatfield=True):
"""
Initialize a CORFinder object.
......@@ -23,6 +23,7 @@ class CORFinder:
"""
self.halftomo = halftomo
self.dataset_info = dataset_info
self.do_flatfield = do_flatfield
self.shape = dataset_info._radio_dims_notbinned[::-1]
self._get_angles(angles)
self._init_radios()
......@@ -78,6 +79,8 @@ class CORFinder:
def _init_flatfield(self):
if not(self.do_flatfield):
return
self.flatfield = FlatField(
self.radios.shape,
flats=self.dataset_info.flats,
......@@ -89,6 +92,8 @@ class CORFinder:
def _apply_flatfield(self):
if not(self.do_flatfield):
return
self.flatfield.normalize_radios(self.radios)
......
......@@ -82,6 +82,7 @@ class ProcessConfig:
self.corfinder = CORFinder(
self.dataset_infos,
halftomo=self.nabu_config["reconstruction"]["enable_halftomo"],
do_flatfield=self.nabu_config["preproc"]["flatfield_enabled"]
)
cor = self.corfinder.find_cor(search_method=cor)
self.dataset_infos.axis_position = cor
......
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