nipreps / smriprep

Structural MRI PREProcessing (sMRIPrep) workflows for NIPreps (NeuroImaging PREProcessing tools)
https://nipreps.github.io/smriprep
Apache License 2.0
134 stars 39 forks source link

Incosistent autorecon errors #130

Open JoffJones opened 5 years ago

JoffJones commented 5 years ago

Hi all, related to https://github.com/poldracklab/fmriprep/issues/1798 I'm experiencing inconsistent errors for the same subjects related to freesurfer. Most of the time it seems to run OK, but sometimes it fails. The first error was autorecon_31 and more recently I received an error with autorecon_30. I always create new working directories so I'm not sure how to avoid this problem in future. Any help would be appreciated!

Many thanks, Joff

aroma-sub-006.txt

effigies commented 5 years ago

I think I've been convinced that we need to re-examine which recon steps can be run in parallel.

#@# WMParc Mon Oct  7 16:49:38 UTC 2019
/CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006

 mri_aparc2aseg --s sub-006 --labelwm --hypo-as-wm --rip-unknown --volmask --o mri/wmparc.mgz --ctxseg aparc+aseg.mgz 

SUBJECTS_DIR /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer
subject sub-006
outvol mri/wmparc.mgz
useribbon 0
baseoffset 0
labeling wm
labeling hypo-intensities as wm
dmaxctx 5.000000
RipUnknown 1
CtxSeg /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/mri/aparc+aseg.mgz

Reading lh white surface 
 /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/surf/lh.white

Reading lh pial surface 
 /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/surf/lh.pial

Loading lh annotations from /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/label/lh.aparc.annot
reading colortable from annotation file...
colortable with 36 entries read (originally /autofs/space/tanha_002/users/greve/fsdev.build/average/colortable_desikan_killiany.txt)

Reading rh white surface 
 /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/surf/rh.white

Reading rh pial surface 
 /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/surf/rh.pial

Loading rh annotations from /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/label/rh.aparc.annot
reading colortable from annotation file...
colortable with 36 entries read (originally /autofs/space/tanha_002/users/greve/fsdev.build/average/colortable_desikan_killiany.txt)
Have color table for lh white annotation
Have color table for rh white annotation
Loading ribbon segmentation from /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/mri/ribbon.mgz
Loading filled from /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/mri/ribbon.mgz
Ripping vertices labeled as unkown
Ripped 6685 vertices from left hemi
Ripped 7430 vertices from right hemi

Building hash of lh white

Building hash of lh pial

Building hash of rh white

Building hash of rh pial

Loading aseg from /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/mri/aseg.mgz
Loading Ctx Seg File /CALM_BIDS_New_2/derivatives/fmriprep-1.5.0-test-56-aroma/freesurfer/sub-006/mri/aparc+aseg.mgz
ASeg Vox2RAS: -----------
-1.00000   0.00000   0.00000   128.00000;
 0.00000   0.00000   1.00000  -128.00000;
 0.00000  -1.00000   0.00000   128.00000;
 0.00000   0.00000   0.00000   1.00000;
-------------------------

Labeling Slice
  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19 
 20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39 
 40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59 
 60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79 
 80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 nctx = 979765
Used brute-force search on 27 voxels
Fixing Parahip LH WM
  Found 6 clusters
     0 k 1800.000000
     1 k 1.000000
     2 k 1.000000
     3 k 3.000000
     4 k 11.000000
     5 k 2.000000
Fixing Parahip RH WM
  Found 9 clusters
     0 k 1.000000
     1 k 1.000000
     2 k 1.000000
     3 k 14.000000
     4 k 1.000000
     5 k 1.000000
     6 k 1.000000
     7 k 1.000000
     8 k 1598.000000
Writing output aseg to mri/wmparc.mgz

 mri_segstats --seg mri/wmparc.mgz --sum stats/wmparc.stats --pv mri/norm.mgz --excludeid 0 --brainmask mri/brainmask.mgz --in mri/norm.mgz --in-intensity-name norm --in-intensity-units MR --subject sub-006 --surf-wm-vol --ctab /opt/freesurfer/WMParcStatsLUT.txt --etiv 

$Id: mri_segstats.c,v 1.121 2016/05/31 17:27:11 greve Exp $
cwd 
cmdline mri_segstats --seg mri/wmparc.mgz --sum stats/wmparc.stats --pv mri/norm.mgz --excludeid 0 --brainmask mri/brainmask.mgz --in mri/norm.mgz --in-intensity-name norm --in-intensity-units MR --subject sub-006 --surf-wm-vol --ctab /opt/freesurfer/WMParcStatsLUT.txt --etiv 
sysname  Linux
hostname node-i06
machine  x86_64
user     jj02
UseRobust  0
atlas_icv (eTIV) = 1474832 mm^3    (det: 1.320900 )
mghRead(mri/wmparc.mgz): could not read 262144 bytes at slice 26
Loading mri/wmparc.mgz
ERROR: loading mri/wmparc.mgz
Linux node-i06 3.10.0-862.el7.x86_64 poldracklab/fmriprep#1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

This clearly isn't isolated to hemisphere, so it's very likely a race condition. This will take a little bit of effort to read through the recon-all script and identify which steps can still be parallelized.

JoffJones commented 5 years ago

Not sure if this helps but just to add, I previously ran 50 subjects from the same group error-free using fmriprep1.4.1.rc4 with virtually the same call. I guess the only major difference was bind mounting the home directory. "-B", "/home/jj02/.cache/fmriprep:/home/fmriprep"

effigies commented 5 years ago

I don't think that should have any effect on FreeSurfer. This is an intermittent problem that's been going on for a while. We've been blaming it on filesystem synchronization, but reading those logs again makes me think it's an actual bug.