Skip to content

Commit d585f8a

Browse files
committed
remove tbss and update docs
1 parent 49797ad commit d585f8a

File tree

5 files changed

+57
-27
lines changed

5 files changed

+57
-27
lines changed

dmriprep/cli.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ def __init__(
3434
omp_nthreads,
3535
eddy_niter,
3636
synb0_dir,
37-
acqp_file,
38-
tbss,
39-
diffusivity_meas,
37+
acqp_file
4038
):
4139

4240
self.layout = layout
@@ -54,8 +52,6 @@ def __init__(
5452
self.eddy_niter = eddy_niter
5553
self.synb0_dir = synb0_dir
5654
self.acqp_file = acqp_file
57-
self.tbss = (tbss,)
58-
self.diffusivity_meas = diffusivity_meas
5955

6056

6157
@click.command()
@@ -155,14 +151,6 @@ def __init__(
155151
help="working directory",
156152
type=click.Path(exists=True, file_okay=False, writable=True),
157153
)
158-
@click.option("--tbss", help="Run TBSS", is_flag=True)
159-
@click.option(
160-
"--diffusivity_meas",
161-
help="Specify which measures to calculate.",
162-
default=("FA",),
163-
type=click.Choice(["FA", "MD", "AD", "RD"]),
164-
multiple=True,
165-
)
166154
@click.option(
167155
"--synb0_dir",
168156
default=None,
@@ -184,9 +172,7 @@ def main(
184172
omp_nthreads,
185173
eddy_niter,
186174
synb0_dir,
187-
acqp_file,
188-
tbss,
189-
diffusivity_meas,
175+
acqp_file
190176
):
191177
"""
192178
BIDS_DIR: The directory with the input dataset formatted according to the
@@ -238,9 +224,7 @@ def main(
238224
omp_nthreads=omp_nthreads,
239225
eddy_niter=eddy_niter,
240226
synb0_dir=synb0_dir,
241-
acqp_file=acqp_file,
242-
tbss=tbss,
243-
diffusivity_meas=list(diffusivity_meas),
227+
acqp_file=acqp_file
244228
)
245229

246230
wf = init_dmriprep_wf(parameters)

dmriprep/workflows/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def init_dmriprep_wf(parameters):
2525
single_subject_wf = init_single_subject_wf(
2626
subject_id=subject_id,
2727
name="single_subject_" + subject_id + "_wf",
28-
parameters=parameters,
28+
parameters=parameters
2929
)
3030

3131
single_subject_wf.config["execution"]["crashdump_dir"] = os.path.join(
@@ -47,7 +47,7 @@ def init_single_subject_wf(subject_id, name, parameters):
4747
datatype="dwi",
4848
suffix="dwi",
4949
extensions=[".nii", ".nii.gz"],
50-
return_type="filename",
50+
return_type="filename"
5151
)
5252

5353
if not dwi_files:
@@ -69,12 +69,12 @@ def init_single_subject_wf(subject_id, name, parameters):
6969
subject_id=subject_id,
7070
dwi_file=dwi_file,
7171
metadata=metadata,
72-
parameters=parameters,
72+
parameters=parameters
7373
)
7474
datasink_wf = init_output_wf(
7575
subject_id=subject_id,
7676
session_id=session_id,
77-
output_folder=parameters.output_dir,
77+
output_folder=parameters.output_dir
7878
)
7979

8080
dwi_preproc_wf.base_dir = os.path.join(
@@ -120,8 +120,8 @@ def init_single_subject_wf(subject_id, name, parameters):
120120
("outputnode.out_dtifit_FA", "inputnode.dtifit_FA"),
121121
("outputnode.out_dtifit_V1", "inputnode.dtifit_V1"),
122122
("outputnode.out_dtifit_sse", "inputnode.dtifit_sse"),
123-
("outputnode.out_noise", "inputnode.noise"),
124-
],
123+
("outputnode.out_noise", "inputnode.noise")
124+
]
125125
)
126126
]
127127
)

dmriprep/workflows/dwi/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
#!/usr/bin/env python
22

3+
"""
4+
5+
Pre-processing dMRI workflows
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
.. automodule:: dmriprep.workflows.dwi.base
9+
.. automodule:: dmriprep.workflows.dwi.prep_dwi
10+
.. automodule:: dmriprep.workflows.dwi.tensor
11+
.. automodule:: dmriprep.workflows.dwi.outputs
12+
13+
"""
14+
315
from .base import init_dwi_preproc_wf
416
from .prep_dwi import init_prep_dwi_wf
517
from .tensor import init_tensor_wf
618
from .outputs import init_output_wf
19+
20+
__all__ = [
21+
"init_dwi_preproc_wf",
22+
"init_prep_dwi_wf",
23+
"init_tensor_wf",
24+
"init_output_wf"
25+
]

dmriprep/workflows/dwi/base.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Orchestrating the dwi preprocessing workflows
55
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
7+
.. autofunction:: init_dwi_preproc_wf
8+
79
"""
810

911
from bids import BIDSLayout
@@ -52,7 +54,16 @@ def init_dwi_preproc_wf(subject_id, dwi_file, metadata, parameters):
5254
# synb0,
5355
# )
5456

55-
dwi_wf = pe.Workflow(name="dwi_preproc_wf")
57+
multiple_runs = isinstance(dwi_file, list)
58+
59+
if multiple_runs:
60+
ref_file = dwi_file[0]
61+
else:
62+
ref_file = dwi_file
63+
64+
wf_name = _get_wf_name(ref_file)
65+
66+
dwi_wf = pe.Workflow(name=wf_name)
5667

5768
inputnode = pe.Node(
5869
niu.IdentityInterface(
@@ -419,3 +430,19 @@ def get_b0_mask_fn(b0_file):
419430
)
420431

421432
return dwi_wf
433+
434+
435+
def _get_wf_name(dwi_fname):
436+
"""
437+
Derives the workflow name from the supplied dwi file.
438+
"""
439+
440+
from nipype.utils.filemanip import split_filename
441+
442+
fname = split_filename(dwi_fname)[1]
443+
fname_nosub = "_".join(fname.split("_")[1:])
444+
name = "func_preproc_" + fname_nosub.replace(".", "_").replace(" ", "").replace(
445+
"-", "_"
446+
).replace("_dwi", "_wf")
447+
448+
return name

long_description.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ segmentation, skullstripping etc.) providing outputs that can be
2828
easily submitted to a variety of tractography algorithms.
2929

3030
[Documentation `dmriprep.org <https://dmriprep.readthedocs.io>`_]
31-
[Support `neurostars.org <https://neurostars.org/tags/fmriprep>`_]
31+
[Support `neurostars.org <https://neurostars.org/tags/dmriprep>`_]

0 commit comments

Comments
 (0)