diff --git a/brainprep/interfaces/ants.py b/brainprep/interfaces/ants.py index 7bea45e0..79e63fa5 100644 --- a/brainprep/interfaces/ants.py +++ b/brainprep/interfaces/ants.py @@ -71,7 +71,7 @@ def biasfield( "N4BiasFieldCorrection", "-d", "3", "-i", str(image_file), - "-s", "1", + "-s", "4", "-b", "[1x1x1,3]", "-c", "[50x50x50x50,0.001]", "-t", "[0.15,0.01,200]", diff --git a/brainprep/interfaces/fsl.py b/brainprep/interfaces/fsl.py index 09c66e93..107947e3 100644 --- a/brainprep/interfaces/fsl.py +++ b/brainprep/interfaces/fsl.py @@ -201,7 +201,8 @@ def scale( image_file: File, scale: int, output_dir: Directory, - entities: dict) -> tuple[list[str], tuple[File]]: + entities: dict, + interp: str | None = None) -> tuple[list[str], tuple[File]]: """ Apply an isotropic resampling transformation to a BIDS-compliant image file using FSL's `flirt`. @@ -216,6 +217,10 @@ def scale( Directory where the scaled image will be saved. entities : dict A dictionary of parsed BIDS entities including modality. + interp : str, default=None + Interpolation method used by `flirt`. One of "trilinear", + "nearestneighbour", "sinc" or "spline". If None, `flirt`'s + default ("trilinear") is used. Returns ------- @@ -239,6 +244,10 @@ def scale( "-omat", str(transform_file), "-verbose", "1", ] + if interp is not None: + command += [ + "-interp", interp + ] return command, (scaled_anatomical_file, transform_file) @@ -296,6 +305,9 @@ def affine( "-bins", "256", "-interp", "trilinear", "-dof", "9", + "-searchrx", "-30", "30", + "-searchry", "-30", "30", + "-searchrz", "-30", "30", "-out", str(aligned_anatomical_file), "-omat", str(transform_file), "-verbose", "1" diff --git a/brainprep/workflow/quasiraw.py b/brainprep/workflow/quasiraw.py index 88530a97..0b13dd44 100644 --- a/brainprep/workflow/quasiraw.py +++ b/brainprep/workflow/quasiraw.py @@ -172,6 +172,7 @@ def brainprep_quasiraw( 1, workspace_dir / "05-scale", entities, + interp="nearestneighbour" ) bc_anatomical_file, _ = interfaces.biasfield( scaled_anatomical_file,