Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion brainprep/interfaces/ants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
14 changes: 13 additions & 1 deletion brainprep/interfaces/fsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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
-------
Expand All @@ -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)

Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions brainprep/workflow/quasiraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def brainprep_quasiraw(
1,
workspace_dir / "05-scale",
entities,
interp="nearestneighbour"
)
bc_anatomical_file, _ = interfaces.biasfield(
scaled_anatomical_file,
Expand Down