@@ -684,7 +684,7 @@ def agg_data(self, intent_code=None):
684
684
685
685
In the general case, the numpy data array is extracted from each ``GiftiDataArray``
686
686
object and returned in a ``tuple``, in the order they are found in the GIFTI image.
687
-
687
+
688
688
If all ``GiftiDataArray`` s have ``intent`` of 2001 (``NIFTI_INTENT_TIME_SERIES``),
689
689
then the data arrays are concatenated as columns, producing a vertex-by-time array.
690
690
If an ``intent_code`` is passed, data arrays are filtered by the selected intents,
@@ -715,57 +715,71 @@ def agg_data(self, intent_code=None):
715
715
>>> from nibabel.testing import test_data
716
716
>>> surf_gii_fname = test_data('gifti', 'ascii.gii')
717
717
>>> surf_gii_img = nib.load(surf_gii_fname)
718
- >>> func_gii_fname = test_data('gifti', 'sub-01_task-rhymejudgment_space-xformspaceverage3_hemi -L.func.gii')
718
+ >>> func_gii_fname = test_data('gifti', 'sub-01_task-rhymejudgment_space-fsaverage3_hemi -L.func.gii')
719
719
>>> func_gii_img = nib.load(func_gii_fname)
720
720
721
721
When not passing anything to ``intent_code``
722
722
723
723
>>> surf_gii_img.agg_data() # surface file
724
724
(array([[-16.07201 , -66.187515, 21.266994],
725
- [-16.705893, -66.05434 , 21.232786],
726
- [-17.61435 , -65.40164 , 21.071466]], dtype=float32),
727
- array([0, 1, 2], dtype=int32))
725
+ [-16.705893, -66.05434 , 21.232786],
726
+ [-17.61435 , -65.40164 , 21.071466]], dtype=float32), array([0, 1, 2], dtype=int32))
728
727
>>> func_gii_img.agg_data() # functional file
729
- array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
730
- ...,
731
- [268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
732
- 259.7127 ]], dtype=float32)
728
+ array([[ 545.4326 , 535.8471 , 537.5014 , ..., 540.2762 ,
729
+ 539.53827 , 541.3617 ],
730
+ [ 640.0118 , 634.727 , 630.03784 , ..., 635.21936 ,
731
+ 641.19586 , 638.7647 ],
732
+ [ 612.9056 , 607.3228 , 606.1355 , ..., 608.2441 ,
733
+ 615.8239 , 613.0585 ],
734
+ ...,
735
+ [ 101.28482 , 101.41192 , 99.21213 , ..., 100.47232 ,
736
+ 99.258316, 99.440796],
737
+ [ 371.81592 , 367.02896 , 363.90207 , ..., 365.52597 ,
738
+ 363.44937 , 363.10278 ],
739
+ [ 268.6521 , 262.0212 , 259.06717 , ..., 262.5381 ,
740
+ 257.8245 , 259.7127 ]], dtype=float32)
733
741
734
742
When passig matching intend codes ``intent_code``
735
743
736
- >>> surf_gii_img.agg_data('pointset') # surface pointset
744
+ >>> surf_gii_img.agg_data('pointset') # surface pointset
737
745
array([[-16.07201 , -66.187515, 21.266994],
738
- [-16.705893, -66.05434 , 21.232786],
739
- [-17.61435 , -65.40164 , 21.071466]], dtype=float32)
746
+ [-16.705893, -66.05434 , 21.232786],
747
+ [-17.61435 , -65.40164 , 21.071466]], dtype=float32)
740
748
>>> surf_gii_img.agg_data('triangle') # surface triangle
741
749
array([0, 1, 2], dtype=int32)
742
750
>>> func_gii_img.agg_data('time series') # functional file
743
- array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
744
- 541.3617 ],
745
- ...,
746
- [268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
747
- 259.7127 ]], dtype=float32)
748
-
751
+ array([[ 545.4326 , 535.8471 , 537.5014 , ..., 540.2762 ,
752
+ 539.53827 , 541.3617 ],
753
+ [ 640.0118 , 634.727 , 630.03784 , ..., 635.21936 ,
754
+ 641.19586 , 638.7647 ],
755
+ [ 612.9056 , 607.3228 , 606.1355 , ..., 608.2441 ,
756
+ 615.8239 , 613.0585 ],
757
+ ...,
758
+ [ 101.28482 , 101.41192 , 99.21213 , ..., 100.47232 ,
759
+ 99.258316, 99.440796],
760
+ [ 371.81592 , 367.02896 , 363.90207 , ..., 365.52597 ,
761
+ 363.44937 , 363.10278 ],
762
+ [ 268.6521 , 262.0212 , 259.06717 , ..., 262.5381 ,
763
+ 257.8245 , 259.7127 ]], dtype=float32)
749
764
750
765
When passing mismatching ``intent_code``, the function return a empty ``tuple``
751
766
752
767
>>> surf_gii_img.agg_data('time series')
753
768
()
754
- >>> func_gii_img.agg_data('triangle')
769
+ >>> func_gii_img.agg_data('triangle')
755
770
()
756
771
757
- When passing tuple ``intent_code``, the output will follow
772
+ When passing tuple ``intent_code``, the output will follow
758
773
the order of ``intent_code`` in the tuple
759
774
760
775
>>> surf_gii_img.agg_data(('pointset', 'triangle'))
761
776
(array([[-16.07201 , -66.187515, 21.266994],
762
- [-16.705893, -66.05434 , 21.232786],
763
- [-17.61435 , -65.40164 , 21.071466]], dtype=float32),
764
- array([0, 1, 2], dtype=int32))
777
+ [-16.705893, -66.05434 , 21.232786],
778
+ [-17.61435 , -65.40164 , 21.071466]], dtype=float32), array([0, 1, 2], dtype=int32))
765
779
>>> surf_gii_img.agg_data(('triangle', 'pointset'))
766
780
(array([0, 1, 2], dtype=int32), array([[-16.07201 , -66.187515, 21.266994],
767
- [-16.705893, -66.05434 , 21.232786],
768
- [-17.61435 , -65.40164 , 21.071466]], dtype=float32))
781
+ [-16.705893, -66.05434 , 21.232786],
782
+ [-17.61435 , -65.40164 , 21.071466]], dtype=float32))
769
783
"""
770
784
771
785
# Allow multiple intents to specify the order
0 commit comments