@@ -46,12 +46,17 @@ def all_fmb_pipeline(name='hmc_sdc_ecc', fugue_params=dict(smooth3d=2.0)):
46
46
outputnode = pe .Node (niu .IdentityInterface (
47
47
fields = ['out_file' , 'out_mask' , 'out_bvec' ]), name = 'outputnode' )
48
48
49
+ list_b0 = pe .Node (niu .Function (
50
+ input_names = ['in_bval' ], output_names = ['out_idx' ],
51
+ function = b0_indices ), name = 'B0indices' )
52
+
49
53
avg_b0_0 = pe .Node (niu .Function (
50
- input_names = ['in_dwi ' , 'in_bval ' ], output_names = ['out_file' ],
51
- function = b0_average ), name = 'b0_avg_pre' )
54
+ input_names = ['in_file ' , 'index ' ], output_names = ['out_file' ],
55
+ function = time_avg ), name = 'b0_avg_pre' )
52
56
avg_b0_1 = pe .Node (niu .Function (
53
- input_names = ['in_dwi' , 'in_bval' ], output_names = ['out_file' ],
54
- function = b0_average ), name = 'b0_avg_post' )
57
+ input_names = ['in_file' , 'index' ], output_names = ['out_file' ],
58
+ function = time_avg ), name = 'b0_avg_post' )
59
+
55
60
bet_dwi0 = pe .Node (fsl .BET (frac = 0.3 , mask = True , robust = True ),
56
61
name = 'bet_dwi_pre' )
57
62
bet_dwi1 = pe .Node (fsl .BET (frac = 0.3 , mask = True , robust = True ),
@@ -67,24 +72,25 @@ def all_fmb_pipeline(name='hmc_sdc_ecc', fugue_params=dict(smooth3d=2.0)):
67
72
(inputnode , hmc , [('in_file' , 'inputnode.in_file' ),
68
73
('in_bvec' , 'inputnode.in_bvec' ),
69
74
('in_bval' , 'inputnode.in_bval' )]),
70
- (inputnode , avg_b0_0 , [('in_file' , 'in_dwi' ),
71
- ('in_bval' , 'in_bval' )]),
75
+ (inputnode , list_b0 , [('in_bval' , 'in_bval' )]),
76
+ (inputnode , avg_b0_0 , [('in_file' , 'in_file' )]),
77
+ (list_b0 , avg_b0_0 , [('out_idx' , 'index' )]),
72
78
(avg_b0_0 , bet_dwi0 , [('out_file' , 'in_file' )]),
73
79
(bet_dwi0 , hmc , [('mask_file' , 'inputnode.in_mask' )]),
74
80
(hmc , sdc , [
75
81
('outputnode.out_file' , 'inputnode.in_file' )]),
76
82
(bet_dwi0 , sdc , [('mask_file' , 'inputnode.in_mask' )]),
77
- (inputnode , sdc , [('in_bval' , 'inputnode.in_bval' ),
78
- ('bmap_pha' , 'inputnode.bmap_pha' ),
83
+ (inputnode , sdc , [('bmap_pha' , 'inputnode.bmap_pha' ),
79
84
('bmap_mag' , 'inputnode.bmap_mag' ),
80
85
('epi_param' , 'inputnode.settings' )]),
86
+ (list_b0 , sdc , [('out_idx' , 'inputnode.in_ref' )]),
81
87
(hmc , ecc , [
82
88
('outputnode.out_xfms' , 'inputnode.in_xfms' )]),
83
89
(inputnode , ecc , [('in_file' , 'inputnode.in_file' ),
84
90
('in_bval' , 'inputnode.in_bval' )]),
85
91
(bet_dwi0 , ecc , [('mask_file' , 'inputnode.in_mask' )]),
86
- (ecc , avg_b0_1 , [('outputnode.out_file' , 'in_dwi ' )]),
87
- (inputnode , avg_b0_1 , [('in_bval ' , 'in_bval ' )]),
92
+ (ecc , avg_b0_1 , [('outputnode.out_file' , 'in_file ' )]),
93
+ (list_b0 , avg_b0_1 , [('out_idx ' , 'index ' )]),
88
94
(avg_b0_1 , bet_dwi1 , [('out_file' , 'in_file' )]),
89
95
(inputnode , unwarp , [('in_file' , 'inputnode.in_dwi' )]),
90
96
(hmc , unwarp , [('outputnode.out_xfms' , 'inputnode.in_hmc' )]),
@@ -529,7 +535,7 @@ def sdc_fmb(name='fmb_correction', interp='Linear',
529
535
>>> from nipype.workflows.dmri.fsl.artifacts import sdc_fmb
530
536
>>> fmb = sdc_fmb()
531
537
>>> fmb.inputs.inputnode.in_file = 'diffusion.nii'
532
- >>> fmb.inputs.inputnode.in_bval = 'diffusion.bval'
538
+ >>> fmb.inputs.inputnode.in_ref = range(0, 30, 6)
533
539
>>> fmb.inputs.inputnode.in_mask = 'mask.nii'
534
540
>>> fmb.inputs.inputnode.bmap_mag = 'magnitude.nii'
535
541
>>> fmb.inputs.inputnode.bmap_pha = 'phase.nii'
@@ -555,7 +561,7 @@ def sdc_fmb(name='fmb_correction', interp='Linear',
555
561
'acc_factor' : 2 , 'enc_dir' : u'AP' }
556
562
557
563
inputnode = pe .Node (niu .IdentityInterface (
558
- fields = ['in_file' , 'in_bval ' , 'in_mask' , 'bmap_pha' , 'bmap_mag' ,
564
+ fields = ['in_file' , 'in_ref ' , 'in_mask' , 'bmap_pha' , 'bmap_mag' ,
559
565
'settings' ]), name = 'inputnode' )
560
566
561
567
outputnode = pe .Node (niu .IdentityInterface (
@@ -580,9 +586,9 @@ def sdc_fmb(name='fmb_correction', interp='Linear',
580
586
input_names = ['in_file' , 'delta_te' ], output_names = ['out_file' ],
581
587
function = rads2radsec ), name = 'ToRadSec' )
582
588
583
- avg_b0 = pe .Node (niu .Function (
584
- input_names = ['in_dwi ' , 'in_bval ' ], output_names = ['out_file' ],
585
- function = b0_average ), name = 'b0_avg ' )
589
+ baseline = pe .Node (niu .Function (
590
+ input_names = ['in_file ' , 'index ' ], output_names = ['out_file' ],
591
+ function = time_avg ), name = 'Baseline ' )
586
592
587
593
fmm2b0 = pe .Node (ants .Registration (output_warped_image = True ),
588
594
name = "FMm_to_B0" )
@@ -639,8 +645,8 @@ def sdc_fmb(name='fmb_correction', interp='Linear',
639
645
('acc_factor' , 'acc_factor' )]),
640
646
(inputnode , pha2rads , [('bmap_pha' , 'in_file' )]),
641
647
(inputnode , firstmag , [('bmap_mag' , 'in_file' )]),
642
- (inputnode , avg_b0 , [('in_file' , 'in_dwi ' ),
643
- ('in_bval ' , 'in_bval ' )]),
648
+ (inputnode , baseline , [('in_file' , 'in_file ' ),
649
+ ('in_ref ' , 'index ' )]),
644
650
(firstmag , n4 , [('roi_file' , 'input_image' )]),
645
651
(n4 , bet , [('output_image' , 'in_file' )]),
646
652
(bet , dilate , [('mask_file' , 'in_file' )]),
@@ -650,12 +656,12 @@ def sdc_fmb(name='fmb_correction', interp='Linear',
650
656
(r_params , rad2rsec , [('delta_te' , 'delta_te' )]),
651
657
(prelude , rad2rsec , [('unwrapped_phase_file' , 'in_file' )]),
652
658
653
- (avg_b0 , fmm2b0 , [('out_file' , 'fixed_image' )]),
659
+ (baseline , fmm2b0 , [('out_file' , 'fixed_image' )]),
654
660
(n4 , fmm2b0 , [('output_image' , 'moving_image' )]),
655
661
(inputnode , fmm2b0 , [('in_mask' , 'fixed_image_mask' )]),
656
662
(dilate , fmm2b0 , [('out_file' , 'moving_image_mask' )]),
657
663
658
- (avg_b0 , applyxfm , [('out_file' , 'reference_image' )]),
664
+ (baseline , applyxfm , [('out_file' , 'reference_image' )]),
659
665
(rad2rsec , applyxfm , [('out_file' , 'input_image' )]),
660
666
(fmm2b0 , applyxfm , [
661
667
('forward_transforms' , 'transforms' ),
0 commit comments