@@ -665,6 +665,7 @@ class ReconAll(CommandLine):
665
665
input_spec = ReconAllInputSpec
666
666
output_spec = ReconAllOutputSpec
667
667
_can_resume = True
668
+ force_run = False
668
669
669
670
# Steps are based off of the recon-all tables [0,1] describing, inputs,
670
671
# commands, and outputs of each step of the recon-all process,
@@ -687,7 +688,7 @@ class ReconAll(CommandLine):
687
688
], []),
688
689
('nuintensitycor' , ['mri/nu.mgz' ], []),
689
690
('normalization' , ['mri/T1.mgz' ], []),
690
- ('skullstrip' , ['mri/talairach_with_skull.lta' ,
691
+ ('skullstrip' , ['mri/transforms/ talairach_with_skull.lta' ,
691
692
'mri/brainmask.auto.mgz' ,
692
693
'mri/brainmask.mgz' ], []),
693
694
]
@@ -730,6 +731,8 @@ class ReconAll(CommandLine):
730
731
'surf/lh.sulc' , 'surf/rh.sulc' ,
731
732
'surf/lh.inflated.H' , 'surf/rh.inflated.H' ,
732
733
'surf/lh.inflated.K' , 'surf/rh.inflated.K' ], []),
734
+ # Undocumented in ReconAllTableStableV5.3
735
+ ('curvstats' , ['stats/lh.curv.stats' , 'stats/rh.curv.stats' ], []),
733
736
]
734
737
_autorecon3_steps = [
735
738
('sphere' , ['surf/lh.sphere' , 'surf/rh.sphere' ], []),
@@ -742,18 +745,29 @@ class ReconAll(CommandLine):
742
745
'surf/lh.curv.pial' , 'surf/rh.curv.pial' ,
743
746
'surf/lh.area.pial' , 'surf/rh.area.pial' ,
744
747
'surf/lh.thickness' , 'surf/rh.thickness' ], []),
748
+ # Misnamed outputs in ReconAllTableStableV5.3: ?h.w-c.pct.mgz
749
+ ('pctsurfcon' , ['surf/lh.w-g.pct.mgh' , 'surf/rh.w-g.pct.mgh' ], []),
750
+ ('parcstats' , ['stats/lh.aparc.stats' , 'stats/rh.aparc.stats' ,
751
+ 'label/aparc.annot.a2009s.ctab' ], []),
745
752
('cortparc2' , ['label/lh.aparc.a2009s.annot' ,
746
753
'label/rh.aparc.a2009s.annot' ], []),
747
754
('parcstats2' , ['stats/lh.aparc.a2009s.stats' ,
748
755
'stats/rh.aparc.a2009s.stats' ,
749
- 'stats/aparc.annot.a2009s.ctab' ], []),
756
+ 'label/aparc.annot.a2009s.ctab' ], []),
757
+ # Undocumented in ReconAllTableStableV5.3
758
+ ('cortparc3' , ['label/lh.aparc.DKTatlas40.annot' ,
759
+ 'label/rh.aparc.DKTatlas40.annot' ], []),
760
+ # Undocumented in ReconAllTableStableV5.3
761
+ ('parcstats3' , ['stats/lh.aparc.a2009s.stats' ,
762
+ 'stats/rh.aparc.a2009s.stats' ,
763
+ 'label/aparc.annot.a2009s.ctab' ], []),
750
764
('cortribbon' , ['mri/lh.ribbon.mgz' , 'mri/rh.ribbon.mgz' ,
751
765
'mri/ribbon.mgz' ], []),
752
766
('segstats' , ['stats/aseg.stats' ], []),
753
767
('aparc2aseg' , ['mri/aparc+aseg.mgz' ,
754
768
'mri/aparc.a2009s+aseg.mgz' ], []),
755
769
('wmparc' , ['mri/wmparc.mgz' , 'stats/wmparc.stats' ], []),
756
- ('balabels' , ['BA.ctab' , 'BA.thresh.ctab' ], []),
770
+ ('balabels' , ['label/ BA.ctab' , 'label/ BA.thresh.ctab' ], []),
757
771
('label-exvivo-ec' , ['label/lh.entorhinal_exvivo.label' ,
758
772
'label/rh.entorhinal_exvivo.label' ], []),
759
773
]
@@ -807,18 +821,18 @@ class ReconAll(CommandLine):
807
821
'surf/lh.thickness' , 'surf/rh.thickness' ], []),
808
822
('cortribbon' , ['mri/lh.ribbon.mgz' , 'mri/rh.ribbon.mgz' ,
809
823
'mri/ribbon.mgz' ], []),
810
- ('parcstats' , ['stats/lh.aparc.astats ' , 'stats/rh.aparc.stats' ,
811
- 'stats /aparc.annot.ctab' ], []),
824
+ ('parcstats' , ['stats/lh.aparc.stats ' , 'stats/rh.aparc.stats' ,
825
+ 'label /aparc.annot.ctab' ], []),
812
826
('cortparc2' , ['label/lh.aparc.a2009s.annot' ,
813
827
'label/rh.aparc.a2009s.annot' ], []),
814
828
('parcstats2' , ['stats/lh.aparc.a2009s.stats' ,
815
829
'stats/rh.aparc.a2009s.stats' ,
816
- 'stats /aparc.annot.a2009s.ctab' ], []),
830
+ 'label /aparc.annot.a2009s.ctab' ], []),
817
831
('cortparc3' , ['label/lh.aparc.DKTatlas.annot' ,
818
832
'label/rh.aparc.DKTatlas.annot' ], []),
819
833
('parcstats3' , ['stats/lh.aparc.DKTatlas.stats' ,
820
834
'stats/rh.aparc.DKTatlas.stats' ,
821
- 'stats /aparc.annot.DKTatlas.ctab' ], []),
835
+ 'label /aparc.annot.DKTatlas.ctab' ], []),
822
836
('pctsurfcon' , ['surf/lh.w-g.pct.mgh' , 'surf/rh.w-g.pct.mgh' ], []),
823
837
('hyporelabel' , ['mri/aseg.presurf.hypos.mgz' ], []),
824
838
('aparc2aseg' , ['mri/aparc+aseg.mgz' ,
@@ -827,7 +841,10 @@ class ReconAll(CommandLine):
827
841
('apas2aseg' , ['mri/aseg.mgz' ], ['mri/aparc+aseg.mgz' ]),
828
842
('segstats' , ['stats/aseg.stats' ], []),
829
843
('wmparc' , ['mri/wmparc.mgz' , 'stats/wmparc.stats' ], []),
830
- ('balabels' , ['BA.ctab' , 'BA.thresh.ctab' ,
844
+ # Note that this is a very incomplete list; however the ctab
845
+ # files are last to be touched, so this should be reasonable
846
+ ('balabels' , ['label/BA_exvivo.ctab' ,
847
+ 'label/BA_exvivo.thresh.ctab' ,
831
848
'label/lh.entorhinal_exvivo.label' ,
832
849
'label/rh.entorhinal_exvivo.label' ], []),
833
850
]
@@ -889,20 +906,30 @@ def cmdline(self):
889
906
if not isdefined (subjects_dir ):
890
907
subjects_dir = self ._gen_subjects_dir ()
891
908
909
+ no_run = True
892
910
flags = []
893
911
for idx , step in enumerate (self ._steps ):
894
912
step , outfiles , infiles = step
895
913
flag = '-{}' .format (step )
896
914
noflag = '-no{}' .format (step )
897
- if flag in cmd or noflag in cmd :
915
+ if noflag in cmd :
916
+ continue
917
+ elif flag in cmd :
918
+ no_run = False
898
919
continue
899
920
900
921
subj_dir = os .path .join (subjects_dir , self .inputs .subject_id )
901
922
if check_depends ([os .path .join (subj_dir , f ) for f in outfiles ],
902
923
[os .path .join (subj_dir , f ) for f in infiles ]):
903
924
flags .append (noflag )
904
- cmd += ' ' + ' ' .join (flags )
925
+ else :
926
+ no_run = False
905
927
928
+ if no_run and not self .force_run :
929
+ iflogger .info ('recon-all complete : Not running' )
930
+ return "echo recon-all: nothing to do"
931
+
932
+ cmd += ' ' + ' ' .join (flags )
906
933
iflogger .info ('resume recon-all : %s' % cmd )
907
934
return cmd
908
935
0 commit comments