Skip to content

Commit 1dd2270

Browse files
authored
Merge branch 'master' into fix-stc
2 parents f9b2778 + 8f73452 commit 1dd2270

File tree

5 files changed

+42
-26
lines changed

5 files changed

+42
-26
lines changed

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ jobs:
388388
-e FMRIPREP_DEV 1 -u $(id -u) \
389389
--config $PWD/nipype.cfg -w /tmp/ds005/work \
390390
/tmp/data/ds005 /tmp/ds005/derivatives participant \
391-
--debug --write-graph --mem_mb 4096 \
391+
--sloppy --write-graph --mem_mb 4096 \
392392
--nthreads 2 --anat-only -vv
393393
- save_cache:
394394
key: ds005-anat-v9-{{ .Branch }}-{{ epoch }}
@@ -408,7 +408,7 @@ jobs:
408408
-e FMRIPREP_DEV 1 -u $(id -u) \
409409
--config $PWD/nipype.cfg -w /tmp/ds005/work \
410410
/tmp/data/ds005 /tmp/ds005/derivatives participant \
411-
--debug --write-graph --use-syn-sdc --mem_mb 4096 \
411+
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \
412412
--ignore-aroma-denoising-errors --use-aroma \
413413
--output-space T1w template fsaverage5 \
414414
--template-resampling-grid native \
@@ -435,7 +435,7 @@ jobs:
435435
-e FMRIPREP_DEV 1 -u $(id -u) \
436436
--config $PWD/nipype.cfg -w /tmp/ds005/work \
437437
/tmp/data/ds005 /tmp/ds005/derivatives_partial participant \
438-
--debug --write-graph --use-syn-sdc --mem_mb 4096 \
438+
--sloppy --write-graph --use-syn-sdc --mem_mb 4096 \
439439
--output-space T1w template fsaverage5 \
440440
--ignore-aroma-denoising-errors --use-aroma \
441441
--template-resampling-grid native \
@@ -517,7 +517,7 @@ jobs:
517517
-e FMRIPREP_DEV 1 \
518518
--config $PWD/nipype.cfg -w /tmp/ds054/work \
519519
/tmp/data/ds054 /tmp/ds054/derivatives participant \
520-
--fs-no-reconall --debug --write-graph \
520+
--fs-no-reconall --sloppy --write-graph \
521521
--mem_mb 4096 --nthreads 2 --anat-only -vv
522522
- save_cache:
523523
key: ds054-anat-v7-{{ .Branch }}-{{ epoch }}
@@ -537,7 +537,7 @@ jobs:
537537
-e FMRIPREP_DEV 1 \
538538
--config $PWD/nipype.cfg -w /tmp/ds054/work \
539539
/tmp/data/ds054 /tmp/ds054/derivatives participant \
540-
--fs-no-reconall --debug \
540+
--fs-no-reconall --sloppy \
541541
--output-space T1w template \
542542
--template-resampling-grid 2mm \
543543
--mem_mb 4096 --nthreads 2 -vv
@@ -562,7 +562,7 @@ jobs:
562562
-e FMRIPREP_DEV 1 \
563563
--config $PWD/nipype.cfg -w /tmp/ds054/work \
564564
/tmp/data/ds054 /tmp/ds054/derivatives participant \
565-
--fs-no-reconall --debug --write-graph \
565+
--fs-no-reconall --sloppy --write-graph \
566566
--output-space T1w template \
567567
--template-resampling-grid 2mm \
568568
--reports-only --run-uuid $UUID
@@ -633,7 +633,7 @@ jobs:
633633
-e FMRIPREP_DEV 1 \
634634
--config $PWD/nipype.cfg -w /tmp/ds210/work \
635635
/tmp/data/ds210 /tmp/ds210/derivatives participant \
636-
--fs-no-reconall --debug --write-graph \
636+
--fs-no-reconall --sloppy --write-graph \
637637
--mem_mb 4096 --nthreads 2 --anat-only -vv
638638
- save_cache:
639639
key: ds210-anat-v4-{{ epoch }}
@@ -651,7 +651,7 @@ jobs:
651651
/tmp/data/ds210 /tmp/ds210/derivatives participant \
652652
--fs-no-reconall --t2s-coreg --use-syn-sdc \
653653
--template-resampling-grid native \
654-
--debug --write-graph --mem_mb 4096 --nthreads 2 -vv
654+
--sloppy --write-graph --mem_mb 4096 --nthreads 2 -vv
655655
- run:
656656
name: Checking outputs of fMRIPrep
657657
command: |

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
"affiliation": "Department of Psychology, Florida International University",
7979
"orcid": "0000-0001-9813-3167"
8080
},
81+
{
82+
"name": "Amlien, Inge K.",
83+
"affiliation": "Department of Psychology, University of Oslo",
84+
"orcid": "0000-0002-8508-9088"
85+
},
8186
{
8287
"name": "Liem, Franz",
8388
"affiliation": "University of Zurich",

fmriprep/cli/run.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def get_parser():
7979
help='select a specific task to be processed')
8080

8181
g_perfm = parser.add_argument_group('Options to handle performance')
82-
g_perfm.add_argument('--debug', action='store_true', default=False,
83-
help='run debug version of workflow')
8482
g_perfm.add_argument('--nthreads', '--n_cpus', '-n-cpus', action='store', type=int,
8583
help='maximum number of threads across all processes')
8684
g_perfm.add_argument('--omp-nthreads', action='store', type=int, default=0,
@@ -103,6 +101,8 @@ def get_parser():
103101
'signal')
104102
g_perfm.add_argument("-v", "--verbose", dest="verbose_count", action="count", default=0,
105103
help="increases log verbosity for each occurence, debug level is -vvv")
104+
g_perfm.add_argument('--debug', action='store_true', default=False,
105+
help='DEPRECATED - Does not do what you want.')
106106

107107
g_conf = parser.add_argument_group('Workflow configuration')
108108
g_conf.add_argument(
@@ -238,6 +238,8 @@ def get_parser():
238238
'the FMRIPREP developers. This information helps to '
239239
'improve FMRIPREP and provides an indicator of real '
240240
'world usage crucial for obtaining funding.')
241+
g_other.add_argument('--sloppy', action='store_true', default=False,
242+
help='Use low-quality tools for speed - TESTING ONLY')
241243

242244
return parser
243245

@@ -517,13 +519,15 @@ def build_workflow(opts, retval):
517519
'Option --output-grid-reference is deprecated, please use '
518520
'--template-resampling-grid')
519521
template_out_grid = template_out_grid or opts.output_grid_reference
522+
if opts.debug is not None:
523+
logger.warning('Option --debug is deprecated and has no effect')
520524

521525
retval['workflow'] = init_fmriprep_wf(
522526
subject_list=subject_list,
523527
task_id=opts.task_id,
524528
run_uuid=run_uuid,
525529
ignore=opts.ignore,
526-
debug=opts.debug,
530+
debug=opts.sloppy,
527531
low_mem=opts.low_mem,
528532
anat_only=opts.anat_only,
529533
longitudinal=opts.longitudinal,

fmriprep/interfaces/bids.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,35 @@ class DerivativesDataSink(SimpleInterface):
184184
Saves the `in_file` into a BIDS-Derivatives folder provided
185185
by `base_directory`, given the input reference `source_file`.
186186
187+
>>> from pathlib import Path
187188
>>> import tempfile
188189
>>> from fmriprep.utils.bids import collect_data
189-
>>> tmpdir = tempfile.mkdtemp()
190-
>>> tmpfile = os.path.join(tmpdir, 'a_temp_file.nii.gz')
191-
>>> open(tmpfile, 'w').close() # "touch" the file
192-
>>> dsink = DerivativesDataSink(base_directory=tmpdir)
193-
>>> dsink.inputs.in_file = tmpfile
190+
>>> tmpdir = Path(tempfile.mkdtemp())
191+
>>> tmpfile = tmpdir / 'a_temp_file.nii.gz'
192+
>>> tmpfile.open('w').close() # "touch" the file
193+
>>> dsink = DerivativesDataSink(base_directory=str(tmpdir))
194+
>>> dsink.inputs.in_file = str(tmpfile)
194195
>>> dsink.inputs.source_file = collect_data('ds114', '01')[0]['t1w'][0]
195196
>>> dsink.inputs.keep_dtype = True
196197
>>> dsink.inputs.suffix = 'target-mni'
197198
>>> res = dsink.run()
198199
>>> res.outputs.out_file # doctest: +ELLIPSIS
199200
'.../fmriprep/sub-01/ses-retest/anat/sub-01_ses-retest_target-mni_T1w.nii.gz'
200201
202+
>>> bids_dir = tmpdir / 'bidsroot' / 'sub-02' / 'ses-noanat' / 'func'
203+
>>> bids_dir.mkdir(parents=True, exist_ok=True)
204+
>>> tricky_source = bids_dir / 'sub-02_ses-noanat_task-rest_run-01_bold.nii.gz'
205+
>>> tricky_source.open('w').close()
206+
>>> dsink = DerivativesDataSink(base_directory=str(tmpdir))
207+
>>> dsink.inputs.in_file = str(tmpfile)
208+
>>> dsink.inputs.source_file = str(tricky_source)
209+
>>> dsink.inputs.keep_dtype = True
210+
>>> dsink.inputs.desc = 'preproc'
211+
>>> res = dsink.run()
212+
>>> res.outputs.out_file # doctest: +ELLIPSIS
213+
'.../fmriprep/sub-02/ses-noanat/func/sub-02_ses-noanat_task-rest_run-01_\
214+
desc-preproc_bold.nii.gz'
215+
201216
"""
202217
input_spec = DerivativesDataSinkInputSpec
203218
output_spec = DerivativesDataSinkOutputSpec
@@ -221,15 +236,7 @@ def _run_interface(self, runtime):
221236

222237
m = BIDS_NAME.search(src_fname)
223238

224-
# TODO this quick and dirty modality detection needs to be implemented
225-
# correctly
226-
mod = 'func'
227-
if 'anat' in op.dirname(self.inputs.source_file):
228-
mod = 'anat'
229-
elif 'dwi' in op.dirname(self.inputs.source_file):
230-
mod = 'dwi'
231-
elif 'fmap' in op.dirname(self.inputs.source_file):
232-
mod = 'fmap'
239+
mod = op.basename(op.dirname(self.inputs.source_file))
233240

234241
base_directory = runtime.cwd
235242
if isdefined(self.inputs.base_directory):

notebooks

0 commit comments

Comments
 (0)