@@ -20,20 +20,6 @@ def getthreshop(thresh):
20
20
def pickrun (files , whichrun ):
21
21
"""pick file from list of files"""
22
22
23
- < << << << HEAD
24
- filemap = {'first' : 0 , 'last' : - 1 , 'middle' :len (files ) // 2 }
25
-
26
- if isinstance (whichrun , str ):
27
- if whichrun not in filemap .keys ():
28
- raise (KeyError , 'Sorry, whichrun must be either integer index'
29
- 'or string in form of "first", "last" or "middle' )
30
- else :
31
- return files [filemap [whichrun ]]
32
-
33
- if isinstance (files , list ):
34
- return files [whichrun ]
35
- else :
36
- == == == =
37
23
filemap = {'first' : 0 , 'last' : - 1 , 'middle' : len (files ) // 2 }
38
24
39
25
if isinstance (files , list ):
@@ -50,7 +36,6 @@ def pickrun(files, whichrun):
50
36
return files [filemap [whichrun ]]
51
37
else :
52
38
# in case single file name is given
53
- >> >> >> > f079ed286d456b531f4f325ddc689f2572654edd
54
39
return files
55
40
56
41
@@ -426,14 +411,10 @@ def create_parallelfeat_preproc(name='featpreproc', highpass=True):
426
411
return featpreproc
427
412
428
413
429
- < << << << HEAD
430
- def create_featreg_preproc (name = 'featpreproc' , highpass = True , whichvol = 'middle' , whichrun = 0 ):
431
- == == == =
432
414
def create_featreg_preproc (name = 'featpreproc' ,
433
415
highpass = True ,
434
416
whichvol = 'middle' ,
435
417
whichrun = 0 ):
436
- > >> >> >> f079ed286d456b531f4f325ddc689f2572654edd
437
418
"""Create a FEAT preprocessing workflow with registration to one volume of the first run
438
419
439
420
Parameters
@@ -444,11 +425,7 @@ def create_featreg_preproc(name='featpreproc',
444
425
name : name of workflow (default: featpreproc)
445
426
highpass : boolean (default: True)
446
427
whichvol : which volume of the first run to register to ('first', 'middle', 'last', 'mean')
447
- <<<<<<< HEAD
448
- whichrun : which of the runs to draw reference volume from (indexed by int)
449
- =======
450
428
whichrun : which run to draw reference volume from (integer index or 'first', 'middle', 'last')
451
- >>>>>>> f079ed286d456b531f4f325ddc689f2572654edd
452
429
453
430
Inputs::
454
431
@@ -537,13 +514,6 @@ def create_featreg_preproc(name='featpreproc',
537
514
"""
538
515
539
516
if whichvol != 'mean' :
540
- < << << << HEAD
541
- extract_ref = pe .Node (interface = fsl .ExtractROI (t_size = 1 ),
542
- iterfield = ['in_file' ],
543
- name = 'extractref' )
544
- featpreproc .connect (img2float , ('out_file' , pickrun , whichrun ), extract_ref , 'in_file' )
545
- featpreproc .connect (img2float , ('out_file' , pickvol , 0 , whichvol ), extract_ref , 't_min' )
546
- == == == =
547
517
extract_ref = pe .Node (
548
518
interface = fsl .ExtractROI (t_size = 1 ),
549
519
iterfield = ['in_file' ],
@@ -552,7 +522,6 @@ def create_featreg_preproc(name='featpreproc',
552
522
extract_ref , 'in_file' )
553
523
featpreproc .connect (img2float , ('out_file' , pickvol , 0 , whichvol ),
554
524
extract_ref , 't_min' )
555
- >> >> >> > f079ed286d456b531f4f325ddc689f2572654edd
556
525
featpreproc .connect (extract_ref , 'roi_file' , outputnode , 'reference' )
557
526
"""
558
527
Realign the functional runs to the reference (`whichvol` volume of first run)
@@ -569,15 +538,8 @@ def create_featreg_preproc(name='featpreproc',
569
538
'ref_file' )
570
539
else :
571
540
motion_correct .inputs .mean_vol = True
572
- < << << << HEAD
573
- featpreproc .connect (motion_correct , ('mean_img' , pickrun , whichrun ), outputnode , 'reference' )
574
-
575
- featpreproc .connect (motion_correct , 'par_file' , outputnode , 'motion_parameters' )
576
- featpreproc .connect (motion_correct , 'out_file' , outputnode , 'realigned_files' )
577
- == == == =
578
541
featpreproc .connect (motion_correct , ('mean_img' , pickrun , whichrun ),
579
542
outputnode , 'reference' )
580
- >> >> >> > f079ed286d456b531f4f325ddc689f2572654edd
581
543
582
544
featpreproc .connect (motion_correct , 'par_file' , outputnode ,
583
545
'motion_parameters' )
@@ -598,19 +560,11 @@ def create_featreg_preproc(name='featpreproc',
598
560
Extract the mean volume of the first functional run
599
561
"""
600
562
601
- < << << << HEAD
602
- meanfunc = pe .Node (interface = fsl .ImageMaths (op_string = '-Tmean' ,
603
- suffix = '_mean' ),
604
- name = 'meanfunc' )
605
- featpreproc .connect (motion_correct , ('out_file' , pickrun , whichrun ), meanfunc , 'in_file' )
606
-
607
- == == == =
608
563
meanfunc = pe .Node (
609
564
interface = fsl .ImageMaths (op_string = '-Tmean' , suffix = '_mean' ),
610
565
name = 'meanfunc' )
611
566
featpreproc .connect (motion_correct , ('out_file' , pickrun , whichrun ),
612
567
meanfunc , 'in_file' )
613
- >> >> >> > f079ed286d456b531f4f325ddc689f2572654edd
614
568
"""
615
569
Strip the skull from the mean functional to generate a mask
616
570
"""
@@ -746,12 +700,8 @@ def create_featreg_preproc(name='featpreproc',
746
700
iterfield = ['in_file' ],
747
701
name = 'meanfunc3' )
748
702
749
- < << << << HEAD
750
- featpreproc .connect (meanscale , ('out_file' , pickrun , whichrun ), meanfunc3 , 'in_file' )
751
- == == == =
752
703
featpreproc .connect (meanscale , ('out_file' , pickrun , whichrun ), meanfunc3 ,
753
704
'in_file' )
754
- >> >> >> > f079ed286d456b531f4f325ddc689f2572654edd
755
705
featpreproc .connect (meanfunc3 , 'out_file' , outputnode , 'mean' )
756
706
"""
757
707
Perform temporal highpass filtering on the data
0 commit comments