test_cortical_parcellation_stats.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import datetime
  2. import os
  3. from conftest import SUBJECTS_DIR
  4. from freesurfer_stats import CorticalParcellationStats
  5. def test_read_dktatlas():
  6. stats = CorticalParcellationStats.read(os.path.join(
  7. SUBJECTS_DIR, 'fabian', 'stats', 'lh.aparc.DKTatlas.stats'))
  8. assert stats.headers == {
  9. 'CreationTime': datetime.datetime(2019, 5, 9, 21, 5, 54, tzinfo=datetime.timezone.utc),
  10. 'generating_program': 'mris_anatomical_stats',
  11. 'cvs_version': 'Id: mris_anatomical_stats.c,v 1.79 2016/03/14 15:15:34 greve Exp',
  12. 'mrisurf.c-cvs_version': 'Id: mrisurf.c,v 1.781.2.6 2016/12/27 16:47:14 zkaufman Exp',
  13. 'cmdline': 'mris_anatomical_stats -th3 -mgz -cortex ../label/lh.cortex.label'
  14. ' -f ../stats/lh.aparc.DKTatlas.stats -b -a ../label/lh.aparc.DKTatlas.annot'
  15. ' -c ../label/aparc.annot.DKTatlas.ctab fabian lh white',
  16. 'sysname': 'Linux',
  17. 'hostname': 'another-hostname',
  18. 'machine': 'x86_64',
  19. 'user': 'some-username',
  20. 'SUBJECTS_DIR': '/home/some-username/freesurfer-subjects',
  21. 'anatomy_type': 'surface',
  22. 'subjectname': 'fabian',
  23. 'hemi': 'lh',
  24. 'AnnotationFile': '../label/lh.aparc.DKTatlas.annot',
  25. 'AnnotationFileTimeStamp': datetime.datetime(2019, 5, 9, 23, 5, 40),
  26. }
  27. assert stats.hemisphere == 'left'
  28. def test_read_pial():
  29. stats = CorticalParcellationStats.read(os.path.join(
  30. SUBJECTS_DIR, 'fabian', 'stats', 'rh.aparc.pial.stats'))
  31. assert stats.headers == {
  32. 'CreationTime': datetime.datetime(2019, 5, 9, 21, 3, 42, tzinfo=datetime.timezone.utc),
  33. 'generating_program': 'mris_anatomical_stats',
  34. 'cvs_version': 'Id: mris_anatomical_stats.c,v 1.79 2016/03/14 15:15:34 greve Exp',
  35. 'mrisurf.c-cvs_version': 'Id: mrisurf.c,v 1.781.2.6 2016/12/27 16:47:14 zkaufman Exp',
  36. 'cmdline': 'mris_anatomical_stats -th3 -mgz -cortex ../label/rh.cortex.label'
  37. ' -f ../stats/rh.aparc.pial.stats -b -a ../label/rh.aparc.annot'
  38. ' -c ../label/aparc.annot.ctab fabian rh pial',
  39. 'sysname': 'Linux',
  40. 'hostname': 'some-hostname',
  41. 'machine': 'x86_64',
  42. 'user': 'some-username',
  43. 'SUBJECTS_DIR': '/home/some-username/freesurfer-subjects',
  44. 'anatomy_type': 'surface',
  45. 'subjectname': 'fabian',
  46. 'hemi': 'rh',
  47. 'AnnotationFile': '../label/rh.aparc.annot',
  48. 'AnnotationFileTimeStamp': datetime.datetime(2019, 5, 9, 22, 27, 28),
  49. }
  50. assert stats.hemisphere == 'right'