Skip to content

Commit 87673aa

Browse files
committed
Merge branch 'master' into enh/slurmgraph
2 parents cfb6fc6 + 050be47 commit 87673aa

24 files changed

+403
-270
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Next release
1313
* FIX: FUGUE is now properly listing outputs. (https://github.com/nipy/nipype/pull/978)
1414
* ENH: Improved FieldMap-Based (FMB) workflow for correction of susceptibility distortions in EPI seqs.
1515
(https://github.com/nipy/nipype/pull/1019)
16+
* FIX: In the FSLXcommand _list_outputs function fixed for loop range (https://github.com/nipy/nipype/pull/1071)
1617
* ENH: Dropped support for now 7 years old Python 2.6 (https://github.com/nipy/nipype/pull/1069)
1718
* FIX: terminal_output is not mandatory anymore (https://github.com/nipy/nipype/pull/1070)
1819
* ENH: Added "nipype_cmd" tool for running interfaces from the command line (https://github.com/nipy/nipype/pull/795)
@@ -59,6 +60,8 @@ Next release
5960
* ENH: Added -newgrid input to Warp in AFNI (3dWarp wrapper) (https://github.com/nipy/nipype/pull/1128)
6061
* FIX: Fixed AFNI Copy interface to use positional inputs as required (https://github.com/nipy/nipype/pull/1131)
6162
* ENH: Added a check in Dcm2nii to check if nipype created the config.ini file and remove if true (https://github.com/nipy/nipype/pull/1132)
63+
* ENH: Use a while loop to wait for Xvfb (up to a max wait time "xvfb_max_wait" in config file, default 10)
64+
(https://github.com/nipy/nipype/pull/1142)
6265

6366
Release 0.10.0 (October 10, 2014)
6467
============

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ to `NeuroStars.org <http://neurostars.org>`_ with a *nipype* tag. `NeuroStars.or
7777
http://neurostars.org/t/nipype/
7878
7979

80-
To participate in the Nipype development related discussion please use the following mailing list::
80+
To participate in the Nipype development related discussions please use the following mailing list::
8181
82-
http://projects.scipy.org/mailman/listinfo/nipy-devel
83-
82+
http://mail.python.org/mailman/listinfo/neuroimaging
83+
8484
Please add *[nipype]* to the subject line when posting on the mailing list.
8585

8686

@@ -124,5 +124,5 @@ There are interfaces to some GNU code but these are entirely optional.
124124
All trademarks referenced herein are property of their respective
125125
holders.
126126

127-
Copyright (c) 2009-2014, NIPY Developers
127+
Copyright (c) 2009-2015, NIPY Developers
128128
All rights reserved.

doc/users/config_file.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ Execution
125125
all pending jobs and checking for job completion. To be nice to cluster
126126
schedulers the default is set to 60 seconds.
127127

128+
*xvfb_max_wait*
129+
Maximum time (in seconds) to wait for Xvfb to start, if the _redirect_x parameter of an Interface is True.
130+
128131
Example
129132
~~~~~~~
130133

examples/fmri_ants_openfmri.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def create_reg_workflow(name='registration'):
124124
'transformed_files',
125125
'transformed_mean',
126126
'anat2target',
127+
'mean2anat_mask'
127128
]),
128129
name='outputspec')
129130

@@ -171,6 +172,13 @@ def create_reg_workflow(name='registration'):
171172
register.connect(mean2anat, 'out_matrix_file',
172173
mean2anatbbr, 'in_matrix_file')
173174

175+
"""
176+
Create a mask of the median image coregistered to the anatomical image
177+
"""
178+
179+
mean2anat_mask = Node(fsl.BET(mask=True), name='mean2anat_mask')
180+
register.connect(mean2anatbbr, 'out_file', mean2anat_mask, 'in_file')
181+
174182
"""
175183
Convert the BBRegister transformation to ANTS ITK format
176184
"""
@@ -276,6 +284,8 @@ def create_reg_workflow(name='registration'):
276284
register.connect(warpall, 'output_image', outputnode, 'transformed_files')
277285
register.connect(mean2anatbbr, 'out_matrix_file',
278286
outputnode, 'func2anat_transform')
287+
register.connect(mean2anat_mask, 'mask_file',
288+
outputnode, 'mean2anat_mask')
279289
register.connect(reg, 'composite_transform',
280290
outputnode, 'anat2target_transform')
281291

@@ -333,7 +343,8 @@ def create_fs_reg_workflow(name='registration'):
333343
'transformed_files',
334344
'min_cost_file',
335345
'anat2target',
336-
'aparc'
346+
'aparc',
347+
'mean2anat_mask'
337348
]),
338349
name='outputspec')
339350

@@ -349,7 +360,7 @@ def create_fs_reg_workflow(name='registration'):
349360
register.connect(fssource, 'T1', convert, 'in_file')
350361

351362
# Coregister the median to the surface
352-
bbregister = Node(freesurfer.BBRegister(),
363+
bbregister = Node(freesurfer.BBRegister(registered_file=True),
353364
name='bbregister')
354365
bbregister.inputs.init = 'fsl'
355366
bbregister.inputs.contrast_type = 't2'
@@ -359,6 +370,10 @@ def create_fs_reg_workflow(name='registration'):
359370
register.connect(inputnode, 'mean_image', bbregister, 'source_file')
360371
register.connect(inputnode, 'subjects_dir', bbregister, 'subjects_dir')
361372

373+
# Create a mask of the median coregistered to the anatomical image
374+
mean2anat_mask = Node(fsl.BET(mask=True), name='mean2anat_mask')
375+
register.connect(bbregister, 'registered_file', mean2anat_mask, 'in_file')
376+
362377
"""
363378
use aparc+aseg's brain mask
364379
"""
@@ -500,6 +515,8 @@ def create_fs_reg_workflow(name='registration'):
500515
outputnode, 'out_reg_file')
501516
register.connect(bbregister, 'min_cost_file',
502517
outputnode, 'min_cost_file')
518+
register.connect(mean2anat_mask, 'mask_file',
519+
outputnode, 'mean2anat_mask')
503520
register.connect(reg, 'composite_transform',
504521
outputnode, 'anat2target_transform')
505522
register.connect(merge, 'out', outputnode, 'transforms')
@@ -964,6 +981,8 @@ def get_subs(subject_id, conds, run_id, model_id, task_id):
964981
subs.append(('/model%03d/task%03d_' % (model_id, task_id), '/'))
965982
subs.append(('_bold_dtype_mcf_bet_thresh_dil', '_mask'))
966983
subs.append(('_output_warped_image', '_anat2target'))
984+
subs.append(('median_flirt_brain_mask', 'median_brain_mask'))
985+
subs.append(('median_bbreg_brain_mask', 'median_brain_mask'))
967986
return subs
968987

969988
subsgen = pe.Node(niu.Function(input_names=['subject_id', 'conds', 'run_id',
@@ -998,6 +1017,7 @@ def get_subs(subject_id, conds, run_id, model_id, task_id):
9981017
('outputspec.motion_plots',
9991018
'qa.motion.plots'),
10001019
('outputspec.mask', 'qa.mask')])])
1020+
wf.connect(registration, 'outputspec.mean2anat_mask', datasink, 'qa.mask.mean2anat')
10011021
wf.connect(art, 'norm_files', datasink, 'qa.art.@norm')
10021022
wf.connect(art, 'intensity_files', datasink, 'qa.art.@intensity')
10031023
wf.connect(art, 'outlier_files', datasink, 'qa.art.@outlier_files')

matlabscripts/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

matlabscripts/parse_spm_config.m

Lines changed: 0 additions & 45 deletions
This file was deleted.

matlabscripts/parse_spm_config2.m

Lines changed: 0 additions & 54 deletions
This file was deleted.

nipype/interfaces/base.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,13 @@ def run(self, **inputs):
994994
xvfb_proc = subprocess.Popen(xvfb_cmd,
995995
stdout=open(os.devnull),
996996
stderr=open(os.devnull))
997-
time.sleep(0.2) # give Xvfb time to start
998-
if xvfb_proc.poll() is not None:
999-
raise Exception('Error: Xvfb did not start')
997+
wait_step = 0.2
998+
wait_time = 0
999+
while xvfb_proc.poll() is not None:
1000+
if wait_time > config.get('execution', 'xvfb_max_wait'):
1001+
raise Exception('Error: Xvfb did not start')
1002+
time.sleep(wait_step) # give Xvfb time to start
1003+
wait_time += wait_step
10001004

10011005
runtime.environ['DISPLAY'] = ':%s' % vdisplay_num
10021006

nipype/interfaces/dipy/tensors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
def tensor_fitting(data, bvals, bvecs, mask_file=None):
3333
"""
3434
Use dipy to fit DTI
35-
35+
3636
Parameters
3737
----------
3838
in_file : str
@@ -58,7 +58,7 @@ def tensor_fitting(data, bvals, bvecs, mask_file=None):
5858

5959
# Load information about the gradients:
6060
gtab = grad.gradient_table(self.inputs.bvals, self.inputs.bvecs)
61-
61+
6262
# Fit it
6363
tenmodel = dti.TensorModel(gtab)
6464
return tenmodel.fit(data, mask), affine
@@ -84,7 +84,7 @@ class DTIOutputSpec(TraitedSpec):
8484
class DTI(BaseInterface):
8585
"""
8686
Calculates the diffusion tensor model parameters
87-
87+
8888
Example
8989
-------
9090
@@ -99,7 +99,7 @@ class DTI(BaseInterface):
9999
output_spec = DTIOutputSpec
100100

101101
def _run_interface(self, runtime):
102-
ten_fit, affine = tensor_fitting(self.inputs.in_file,
102+
ten_fit, affine = tensor_fitting(self.inputs.in_file,
103103
self.inputs.bvals,
104104
self.inputs.bvecs,
105105
self.inputs.mask_file)
@@ -124,7 +124,7 @@ def _gen_filename(self, name):
124124
def _gen_outfilename(self):
125125
_, name, _ = split_filename(self.inputs.in_file)
126126
return name + '_dti.nii'
127-
127+
128128

129129
class TensorModeInputSpec(TraitedSpec):
130130
in_file = File(exists=True, mandatory=True,

nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ def test_SimulateMultiTensor_inputs():
77
),
88
bvalues=dict(usedefault=True,
99
),
10+
diff_iso=dict(usedefault=True,
11+
),
12+
diff_sf=dict(usedefault=True,
13+
),
1014
gradients=dict(),
1115
ignore_exception=dict(nohash=True,
1216
usedefault=True,

0 commit comments

Comments
 (0)