Commit 3de02c7e authored by payno's avatar payno Committed by Henri Payno
Browse files

[core][nabu] connect sino_normalization to nabu

- only done for Checbyshev and None
- other modes will raise an error for now.

# Conflicts:
#	tomwer/core/process/reconstruction/nabu/nabuslices.py

# Conflicts:
#	tomwer/core/process/reconstruction/nabu/nabuslices.py
#	tomwer/core/process/reconstruction/nabu/nabuvolume.py
parent 57abf631
......@@ -41,6 +41,7 @@ from tomwer.core.process.reconstruction.nabu.target import Target
from tomwer.core.process.reconstruction.nabu.utils import _NabuPhaseMethod
from tomwer.core.scan.scanbase import TomwerScanBase
from tomwer.core.utils.slurm import is_slurm_available
from tomoscan.normalization import Method as INormMethod
from silx.utils.enum import Enum as _Enum
from .slurm import _exec_nabu_on_slurm
from typing import Iterable, Optional
......@@ -437,6 +438,7 @@ class _NabuBaseReconstructor:
- add or overwrite some parameters of the dictionary
- create the output directory if does not exist
"""
# handle phase
pag = False
db = None
if "phase" in config:
......@@ -447,6 +449,7 @@ class _NabuBaseReconstructor:
pag = True
if "delta_beta" in config["phase"]:
db = round(float(config["phase"]["delta_beta"]))
# handle output
if "output" in config:
_file_name = self._get_file_basename_reconstruction(pag=pag, db=db)
config["output"]["file_prefix"] = _file_name
......@@ -460,6 +463,24 @@ class _NabuBaseReconstructor:
# otherwise default location will be the data root level
location = self.scan.path
config["output"]["location"] = location
# handle preproc
if "preproc" not in config:
config["preproc"] = {}
if self.scan.intensity_normalization.method is INormMethod.NONE:
config["preproc"]["sino_normalization"] = ""
elif self.scan.intensity_normalization.method is INormMethod.SCALAR:
config["preproc"]["sino_normalization"] = "dataset"
# TODO: save scalar in a .hdf5 to pass it to Nabu
raise NotImplementedError("Scalar not implemented at nabu side for now")
elif self.scan.intensity_normalization.method in (
INormMethod.CHEBYSHEV,
INormMethod.LSQR_SPLINE,
INormMethod.MONITOR,
):
config["preproc"][
"sino_normalization"
] = self.scan.intensity_normalization.method.value
return config
def _get_file_basename_reconstruction(self, pag, db):
......
......@@ -45,6 +45,7 @@ from nabu.pipeline.fullfield.nabu_config import (
)
from nabu import version as nabu_version
from tomwer.core.scan.edfscan import EDFTomoScan
from tomoscan.normalization import Method as INormMethod
import copy
import os
from tomwer.core.process.task import Task
......
Supports Markdown
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