Skip to content

Commit 20880e0

Browse files
committed
removed some extraneous inputs. added fwhm
1 parent 836835e commit 20880e0

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

examples/rsfmri_conn_spm_preprocessing.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,7 @@ def create_workflow(files,
348348
"""
349349

350350
smooth = Node(interface=spm.Smooth(), name = "smooth")
351-
352-
"""`write_voxel_sizes` is the input of the normalize interface that is recommended to be set to
353-
the voxel sizes of the target volume. There is no need to set it manually since we van infer it from data
354-
using the following function:
355-
"""
356-
357-
def get_vox_dims(volume):
358-
import nibabel as nb
359-
if isinstance(volume, list):
360-
volume = volume[0]
361-
nii = nb.load(volume)
362-
hdr = nii.get_header()
363-
voxdims = hdr.get_zooms()
364-
return [float(voxdims[0]), float(voxdims[1]), float(voxdims[2])]
351+
smooth.inputs.fwhm = vol_fwhm
365352

366353
"""Here we are connecting all the nodes together. Notice that we add the merge node only if you choose
367354
to use 4D. Also `get_vox_dims` function is passed along the input volume of normalise to set the optimal
@@ -495,14 +482,8 @@ def merge_files(in1, in2):
495482
name='bandpass_unsmooth')
496483
bandpass1.inputs.fs = 1./TR
497484

498-
if highpass_freq < 0:
499-
bandpass1.inputs.highpass_freq = -1
500-
else:
501-
bandpass1.inputs.highpass_freq = highpass_freq
502-
if lowpass_freq < 0:
503-
bandpass1.inputs.lowpass_freq = -1
504-
else:
505-
bandpass1.inputs.lowpass_freq = lowpass_freq
485+
bandpass1.inputs.highpass_freq = highpass_freq
486+
bandpass1.inputs.lowpass_freq = lowpass_freq
506487
wf.connect(filter2, 'out_res', bandpass1, 'files')
507488

508489
bandpass2 = bandpass1.clone(name='bandpass_smooth')

0 commit comments

Comments
 (0)