Skip to content

Commit 18501c4

Browse files
committed
add time series example
1 parent aef5a4f commit 18501c4

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

nibabel/gifti/gifti.py

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,32 +701,68 @@ def agg_data(self, intent_code=None):
701701
>>> from nibabel.testing import test_data
702702
>>> surf_gii_fname = test_data('gifti', 'ascii.gii')
703703
>>> surf_gii_img = nib.load(surf_gii_fname)
704+
>>> func_gii_fname = test_data('gifti', 'sub-01_task-rhymejudgment_space-xformspaceverage3_hemi-L.func.gii')
705+
>>> func_gii_img = nib.load(func_gii_fname)
704706
705707
When not passing anything to``intent_code``
706-
707-
>>> surf_gii_img.agg_data()
708+
709+
>>> surf_gii_img.agg_data() # surface file
708710
(array([[-16.07201 , -66.187515, 21.266994],
709711
[-16.705893, -66.05434 , 21.232786],
710712
[-17.61435 , -65.40164 , 21.071466]], dtype=float32),
711713
array([0, 1, 2], dtype=int32))
712714
715+
>>> func_gii_img.agg_data() # functional file
716+
array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
717+
541.3617 ],
718+
[640.0118 , 634.727 , 630.03784 , ..., 635.21936 , 641.19586 ,
719+
638.7647 ],
720+
[612.9056 , 607.3228 , 606.1355 , ..., 608.2441 , 615.8239 ,
721+
613.0585 ],
722+
...,
723+
[101.28482 , 101.41192 , 99.21213 , ..., 100.47232 , 99.258316,
724+
99.440796],
725+
[371.81592 , 367.02896 , 363.90207 , ..., 365.52597 , 363.44937 ,
726+
363.10278 ],
727+
[268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
728+
259.7127 ]], dtype=float32)
729+
730+
713731
When passig matching intend codes ``intent_code``
714732
715-
>>> surf_gii_img.agg_data('pointset')
733+
>>> surf_gii_img.agg_data('pointset') # surface file
716734
array([[-16.07201 , -66.187515, 21.266994],
717735
[-16.705893, -66.05434 , 21.232786],
718736
[-17.61435 , -65.40164 , 21.071466]], dtype=float32)
719737
738+
>>> func_gii_img.agg_data('time series') # functional file
739+
array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
740+
541.3617 ],
741+
[640.0118 , 634.727 , 630.03784 , ..., 635.21936 , 641.19586 ,
742+
638.7647 ],
743+
[612.9056 , 607.3228 , 606.1355 , ..., 608.2441 , 615.8239 ,
744+
613.0585 ],
745+
...,
746+
[101.28482 , 101.41192 , 99.21213 , ..., 100.47232 , 99.258316,
747+
99.440796],
748+
[371.81592 , 367.02896 , 363.90207 , ..., 365.52597 , 363.44937 ,
749+
363.10278 ],
750+
[268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
751+
259.7127 ]], dtype=float32)
752+
720753
>>> surf_gii_img.agg_data('triangle')
721754
array([0, 1, 2], dtype=int32)
722755
723756
When passing mismatching intent codes ``intent_code``
724-
757+
725758
>>> surf_gii_img.agg_data('time series')
726759
() # return a empty ``tuple``
727760
761+
>>> func_gii_img.agg_data('triangle')
762+
() # return a empty ``tuple``
763+
728764
When passing tuple ``intent_code``
729-
765+
730766
>>> surf_gii_img.agg_data(('pointset', 'triangle'))
731767
(array([[-16.07201 , -66.187515, 21.266994],
732768
[-16.705893, -66.05434 , 21.232786],

0 commit comments

Comments
 (0)