nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
146 stars 54 forks source link

extract global measures in addition to shape-specific measures #148

Open satra opened 6 years ago

satra commented 6 years ago

in the mindboggle output none of the global measures/stats evaluated by the underlying tools are extracted. while it's possible to go back and extract them separately, it would nice to have them in the mindboggled output.

binarybottle commented 6 years ago

I agree. Which global measures would you like to include in the mindboggled output?

By the way, this issue is related to issue #108.

satra commented 6 years ago

every measure that's in the header of aseg.stats + corpus callosum + ventricular stats. i don't think the latter two are present in the current output.

# Measure BrainSeg, BrainSegVol, Brain Segmentation Volume, 1078355.000000, mm^3             
# Measure BrainSegNotVent, BrainSegVolNotVent, Brain Segmentation Volume Without Ventricles, 1069223.000000, mm^3                                                                         
# Measure BrainSegNotVentSurf, BrainSegVolNotVentSurf, Brain Segmentation Volume Without Ventricles from Surf, 1068195.198727, mm^3                                                       
# Measure VentricleChoroidVol, VentricleChoroidVol, Volume of ventricles and choroid plexus, 6563.000000, mm^3                                                                            
# Measure lhCortex, lhCortexVol, Left hemisphere cortical gray matter volume, 209722.015864, mm^3                                                                                         # Measure rhCortex, rhCortexVol, Right hemisphere cortical gray matter volume, 206510.220266, mm^3                                                                                        
# Measure Cortex, CortexVol, Total cortical gray matter volume, 416232.236130, mm^3          
# Measure lhCerebralWhiteMatter, lhCerebralWhiteMatterVol, Left hemisphere cerebral white matter volume, 229086.228129, mm^3
# Measure rhCerebralWhiteMatter, rhCerebralWhiteMatterVol, Right hemisphere cerebral white matter volume, 229672.734468, mm^3
# Measure CerebralWhiteMatter, CerebralWhiteMatterVol, Total cerebral white matter volume, 458758.962597, mm^3                                                                            
# Measure SubCortGray, SubCortGrayVol, Subcortical gray matter volume, 56030.000000, mm^3    
# Measure TotalGray, TotalGrayVol, Total gray matter volume, 576053.236130, mm^3
# Measure SupraTentorial, SupraTentorialVol, Supratentorial volume, 940561.198727, mm^3      
# Measure SupraTentorialNotVent, SupraTentorialVolNotVent, Supratentorial volume, 933998.198727, mm^3                                                                                    
 # Measure SupraTentorialNotVentVox, SupraTentorialVolNotVentVox, Supratentorial volume voxel count, 931987.000000, mm^3                                                                   
# Measure Mask, MaskVol, Mask Volume, 1487053.000000, mm^3                                   
# Measure BrainSegVol-to-eTIV, BrainSegVol-to-eTIV, Ratio of BrainSegVol to eTIV, 0.978773, unitless
# Measure MaskVol-to-eTIV, MaskVol-to-eTIV, Ratio of MaskVol to eTIV, 1.349730, unitless
# Measure lhSurfaceHoles, lhSurfaceHoles, Number of defect holes in lh surfaces prior to fixi
ng, 24, unitless
# Measure rhSurfaceHoles, rhSurfaceHoles, Number of defect holes in rh surfaces prior to fixi
ng, 16, unitless
# Measure SurfaceHoles, SurfaceHoles, Total number of defect holes in surfaces prior to fixin
g, 40, unitless
# Measure EstimatedTotalIntraCranialVol, eTIV, Estimated Total Intracranial Volume, 1101741.3
16128, mm^3
binarybottle commented 6 years ago

After running recon-all I see the following in a subject's stats/ folder:

aseg.stats lh.aparc.a2009s.stats lh.aparc.DKTatlas.stats lh.aparc.pial.stats lh.aparc.stats lh.BA_exvivo.stats lh.BA_exvivo.thresh.stats lh.curv.stats lh.w-g.pct.stats rh.aparc.a2009s.stats rh.aparc.DKTatlas.stats rh.aparc.pial.stats rh.aparc.stats rh.BA_exvivo.stats rh.BA_exvivo.thresh.stats rh.curv.stats rh.w-g.pct.stats wmparc.stats

FreeSurfer generates a lot of interesting information, and it's not obvious to me which of the above files would be good to include. If someone runs mindboggle123 (or recon-all as a preprocessing step to mindboggle) they will generate all of the above and have access to them. I don't think that copying these tables into Mindboggle's output tables/ directory is a good idea because they are not in a consistent format. Adding FreeSurfer's volume stats to Mindboggle's output tables might be a mistake as well, because many regions are redefined by the hybrid segmentation with ANTs...

satra commented 6 years ago

run asegstats2table returns a list of specific subcortical and whole brain stats for a subject. i would suggest including those only.

binarybottle commented 6 years ago

Why do I have a syntax error?:

asegstats2table --subjects bert

File "/Applications/freesurfer/bin/asegstats2table", line 195
    print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
SyntaxError: invalid syntax

And why not aparcstats2table as well?...

satra commented 6 years ago

asegstats2table --subjects bert

needs python2, not updated yet to use python 3 ( there is a version in their dev repo which would likely run on python3, but the script itself forces a python2 interpreter).

And why not aparcstats2table as well?...

because in general you do extract those in the freesurfer table. i'm mostly thinking of things like ventricle volume, etiv, brain vol, which are not present in mindboggle output, but can be useful for normalizing, predicting, etc.,.

satra commented 6 years ago

given the python situation it would be best to perhaps just parse the aseg.stats directly using pandas.

binarybottle commented 6 years ago

I won't be able to get to a pandas parsing for some time, unfortunately...

binarybottle commented 6 years ago

@satra -- you didn't tackle whole-brain measures when you introduced LabelGeometry, did you?

satra commented 6 years ago

no - i tackled the pieces necessary to create this table. we are working on a nidmification of the outputs from freesurfer and ants. once that's ready i'll add that in to the code.

PeerHerholz commented 5 years ago

re pandas parsing: @ltirrell already did a great job here. If that's okay for you/sufficient/what you're looking for, I would give it a try, that is packing that functionality in one or a few nodes.