Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 3fd7e47

Browse files
committed
fix: pointing to the segmentation instead of the orig as reference. because hbn data was weird
1 parent ef90778 commit 3fd7e47

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dmriprep/run.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ def run_dmriprep_pe(subject_id, dwi_file, dwi_file_AP, dwi_file_PA, bvec_file, b
243243
inputspec.inputs.subjects_dir = subjects_dir
244244
inputspec.inputs.out_dir = op.abspath(out_dir)
245245

246+
# write the graph (this is saved to the working dir)
247+
wf.write_graph()
248+
246249
wf.run()
247250

248251

@@ -469,14 +472,18 @@ def get_orig(subjects_dir, sub='freesurfer'):
469472
import os.path as op
470473
return op.join(subjects_dir, sub, "mri", "orig.mgz")
471474

475+
476+
def get_aparc_aseg(subjects_dir, sub='freesurfer'):
477+
import os.path as op
478+
return op.join(subjects_dir, sub, "mri", "aparc+aseg.mgz")
479+
472480
# transform the dropped volume version to anat space w/ out resampling
473481
voltransform = pe.Node(fs.ApplyVolTransform(no_resample=True),
474482
iterfield=['source_file', 'reg_file'],
475483
name='transform')
476-
#voltransform.inputs.subjects_dir = subjects_dir
484+
477485
wf.connect(inputspec, 'subjects_dir', voltransform, 'subjects_dir')
478-
#voltransform.inputs.target_file = get_orig(subjects_dir, 'freesurfer')
479-
wf.connect(inputspec, ('subjects_dir', get_orig), voltransform, 'target_file')
486+
wf.connect(inputspec, ('subjects_dir', get_aparc_aseg), voltransform, 'target_file')
480487
wf.connect(prep, "outputnode.out_file", voltransform, "source_file")
481488
wf.connect(bbreg, "out_reg_file", voltransform, "reg_file")
482489

@@ -559,9 +566,6 @@ def binarize_aparc(aparc_aseg):
559566
function=binarize_aparc),
560567
name="bin_aparc")
561568

562-
def get_aparc_aseg(subjects_dir, sub='freesurfer'):
563-
import os.path as op
564-
return op.join(subjects_dir, sub, "mri", "aparc+aseg.mgz")
565569

566570
getB0Anat = fslroi.clone('getB0Anat')
567571
wf.connect(voltransform, 'transformed_file', getB0Anat, 'in_file')
@@ -724,7 +728,6 @@ def name_files_nicely(dwi_file, subject_id):
724728
wf.connect(inputspec, 'subject_id', node_name_files_nicely, 'subject_id')
725729
wf.connect(node_name_files_nicely, 'substitutions', datasink, 'substitutions')
726730

727-
# write the graph (this is saved to the working dir)
728-
wf.write_graph()
731+
729732

730733
return wf

0 commit comments

Comments
 (0)