fphammerle / freesurfer-stats

Python Library to Read FreeSurfer's Cortical Parcellation Anatomical Statistics
https://pypi.org/project/freesurfer-stats/
GNU General Public License v3.0
14 stars 1 forks source link

updated so that it can handle non-Measure line in stats header #1

Closed soichih closed 4 years ago

soichih commented 4 years ago

This module was failing on my freesurfer output - as there is a non-Meausre line (# BrainVolStatsFixed-NotNeeded because voxelvolume=1mm3) mixed inside a list of Measures

# SUBJECTS_DIR /N/dc2/scratch/hayashis/bigred3-workflows/5eb0689676c10ead933d673c/5eb068b076c10e7b013d673f
# anatomy_type surface
# subjectname output
# hemi lh
# AnnotationFile ../label/lh.aparc.annot
# AnnotationFileTimeStamp 2020/05/04 21:58:14
# Measure Cortex, NumVert, Number of Vertices, 118968, unitless
# Measure Cortex, WhiteSurfArea, White Surface Total Area, 84858.5, mm^2
# Measure Cortex, MeanThickness, Mean Thickness, 2.39891, mm
# BrainVolStatsFixed-NotNeeded because voxelvolume=1mm3
# Measure BrainSeg, BrainSegVol, Brain Segmentation Volume, 1169408.000000, mm^3
# Measure BrainSegNotVent, BrainSegVolNotVent, Brain Segmentation Volume Without Ventricles, 1157593.000000, mm^3
# Measure BrainSegNotVentSurf, BrainSegVolNotVentSurf, Brain Segmentation Volume Without Ventricles from Surf, 1157593.000000, mm^3
# Measure Cortex, CortexVol, Total cortical gray matter volume, 454587.696158, mm^3
# Measure SupraTentorial, SupraTentorialVol, Supratentorial volume, 1023873.000000, mm^3
# Measure SupraTentorialNotVent, SupraTentorialVolNotVent, Supratentorial volume, 1012058.000000, mm^3
# Measure EstimatedTotalIntraCranialVol, eTIV, Estimated Total Intracranial Volume, 1420434.160521, mm^3
# NTableCols 10
# TableCol  1 ColHeader StructName
# TableCol  1 FieldName Structure Name

The patch simply check to see if there is valid regex match and if not skip the line.

fphammerle commented 4 years ago

Great, thanks @soichih !

Unfortunately, I forgot to make this library compatible with pandas v1, test against python 3.8 and add a license. Just added that today.

Could you rebase your branch?

soichih commented 4 years ago

Re-based

fphammerle commented 4 years ago

Thanks!

You additionally added a merge commit ( 7c54efef5492a7f42c82c2e7c6d81a43817ebb21 ) on top of the new commit 5b1985b2238120909801d19c16443557ab559948

The diff of your PR now also shows my commits: https://github.com/fphammerle/freesurfer-stats/pull/1/files

Could you remove the merge commit?

git reset --hard 5b1985b2238120909801d19c16443557ab559948 && git push -f

soichih commented 4 years ago

Done! Did I do it right this time?

On Wed, May 6, 2020 at 1:48 PM Fabian Peter Hammerle < notifications@github.com> wrote:

Thanks!

You additionally added a merge commit ( 7c54efe https://github.com/fphammerle/freesurfer-stats/commit/7c54efef5492a7f42c82c2e7c6d81a43817ebb21 ) on top of the new commit 5b1985b https://github.com/fphammerle/freesurfer-stats/commit/5b1985b2238120909801d19c16443557ab559948

The diff of your PR now also shows my commits: https://github.com/fphammerle/freesurfer-stats/pull/1/files

Could you remove the merge commit?

git reset --hard 5b1985b2238120909801d19c16443557ab559948 && git push -f

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fphammerle/freesurfer-stats/pull/1#issuecomment-624794139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHBR6E6KWL5UWX5F62M7TDRQGPFPANCNFSM4MZYJKPA .

fphammerle commented 4 years ago

Yes, thanks!

fphammerle commented 4 years ago

Please check whether the new release v1.1.1 works for you: https://pypi.org/project/freesurfer-stats/1.1.1/#history https://github.com/fphammerle/freesurfer-stats/releases/tag/1.1.1