Skip to content

Commit

Permalink
expose precision to parent workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen committed Jul 5, 2023
1 parent 81ee9cb commit 0e94a65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def cli(
"initrand": initrand,
"delete_cache": delete_cache,
"random_seed": random_seed,
"double_precision": True, # TODO: expose to user ?
}

pipeline = DwiPreprocessingUsingT1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def check_pipeline_parameters(self):
self.parameters.setdefault("initrand", False)
self.parameters.setdefault("delete_cache", False)
self.parameters.setdefault("random_seed", None)
self.parameters.setdefault("double_precision", True)

def check_custom_dependencies(self):
"""Check dependencies that can not be listed in the `info.json` file."""
Expand Down Expand Up @@ -308,6 +309,7 @@ def build_core_nodes(self):
self.parameters["delete_cache"],
name="SusceptibilityDistortionCorrection",
ants_random_seed=self.parameters["random_seed"],
use_double_precision=self.parameters["double_precision"],
)

# Remove bias correction from (Jeurissen et al., 2014)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def epi_pipeline(
output_dir: Optional[str] = None,
name: str = "susceptibility_distortion_correction_using_t1",
ants_random_seed: Optional[int] = None,
use_double_precision: bool = True,
) -> Workflow:
"""Perform EPI correction.
Expand Down Expand Up @@ -235,6 +236,12 @@ def epi_pipeline(
be stochastic.
Default=None.
use_double_precision : bool, optional
This only affects tools supporting different precision settings.
If True, computations will be made in double precision (i.e. 64 bits).
If False, computations will be made in float precision (i.e. 32 bits).
Default=True.
Returns
-------
Workflow :
Expand Down Expand Up @@ -291,6 +298,7 @@ def epi_pipeline(
base_dir=base_dir,
delete_cache=delete_cache,
output_dir=output_dir,
use_double_precision=use_double_precision,
)
epi_correction_outputs = ["epi_corrected_dwi_image"]

Expand Down

0 comments on commit 0e94a65

Please sign in to comment.