Skip to content

Commit 0b612da

Browse files
ghisvailtclose
authored andcommitted
ENH: Drop FSL prefix from prepare_fieldmap (#59)
1 parent c346916 commit 0b612da

File tree

4 files changed

+64
-63
lines changed

4 files changed

+64
-63
lines changed

src/pydra/tasks/fsl/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
Std2ImgCoord,
3434
)
3535
from .fnirt import FNIRT, ApplyWarp, ConvertWarp, FNIRTFileUtils, InvWarp
36-
from .fugue import FUGUE, FSLPrepareFieldmap, Prelude, SigLoss
36+
from .fugue import FUGUE, Prelude, PrepareFieldmap, SigLoss
3737
from .susan import SUSAN
3838
from .utils import (
3939
FFT,
@@ -59,6 +59,7 @@
5959
FSLInterleave = Interleave
6060
FSLMerge = Merge
6161
FSLOrient = Orient
62+
FSLPrepareFieldmap = PrepareFieldmap
6263
FSLReorient2Std = Reorient2Std
6364
FSLSelectVols = SelectVols
6465
FSLSlice = Slice

src/pydra/tasks/fsl/fugue/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
=====
44
55
.. automodule:: pydra.tasks.fsl.fugue.fugue
6-
.. automodule:: pydra.tasks.fsl.fugue.fsl_prepare_fieldmap
6+
.. automodule:: pydra.tasks.fsl.fugue.prepare_fieldmap
77
.. automodule:: pydra.tasks.fsl.fugue.prelude
88
.. automodule:: pydra.tasks.fsl.fugue.sigloss
99
"""
1010

11-
from .fsl_prepare_fieldmap import FSLPrepareFieldmap
1211
from .fugue import FUGUE
1312
from .prelude import Prelude
13+
from .prepare_fieldmap import PrepareFieldmap
1414
from .sigloss import SigLoss

src/pydra/tasks/fsl/fugue/fsl_prepare_fieldmap.py

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
"""
2+
PrepareFieldmap
3+
===============
4+
5+
EPI fieldmap preprocessing.
6+
7+
Examples
8+
========
9+
10+
>>> task = PrepareFieldmap(phase_image="gre_phase.nii", magnitude_image="gre_mag.nii", output_image="fmap.nii")
11+
>>> task.cmdline
12+
'fsl_prepare_fieldmap SIEMENS gre_phase.nii gre_mag.nii fmap.nii 2.46'
13+
"""
14+
15+
__all__ = ["PrepareFieldmap"]
16+
17+
from os import PathLike
18+
19+
from attrs import define, field
20+
from pydra.engine.specs import ShellSpec, SpecInfo
21+
from pydra.engine.task import ShellCommandTask
22+
23+
24+
@define(kw_only=True)
25+
class PrepareFieldmapSpec(ShellSpec):
26+
"""Specifications for fsl_prepare_fieldmap."""
27+
28+
scanner: str = field(default="SIEMENS", metadata={"help_string": "scanner (usually SIEMENS)", "argstr": ""})
29+
30+
phase_image: PathLike = field(metadata={"help_string": "phase image", "mandatory": True, "argstr": ""})
31+
32+
magnitude_image: PathLike = field(
33+
metadata={"help_string": "magnitude (brain extracted) image", "mandatory": True, "argstr": ""}
34+
)
35+
36+
output_image: str = field(
37+
metadata={
38+
"help_string": "output fieldmap image in rad/s",
39+
"argstr": "",
40+
"output_file_template": "{phase_image}_fmap",
41+
}
42+
)
43+
44+
delta_te: float = field(
45+
default=2.46,
46+
metadata={
47+
"help_string": "echo time difference of the fieldmap sequence in milliseconds (usually 2.46 on SIEMENS)",
48+
"argstr": "",
49+
},
50+
)
51+
52+
no_check: bool = field(metadata={"help_string": "disable sanity checks for images", "argstr": "--nocheck"})
53+
54+
55+
class PrepareFieldmap(ShellCommandTask):
56+
"""Task definition for fsl_prepare_fieldmap."""
57+
58+
executable = "fsl_prepare_fieldmap"
59+
60+
input_spec = SpecInfo(name="Input", bases=(PrepareFieldmapSpec,))

0 commit comments

Comments
 (0)