Skip to content

Commit 3dd6ddd

Browse files
author
Ben Cipollini
committed
fix: move intent_codes.
1 parent 7fa2e62 commit 3dd6ddd

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

nibabel/cifti/parse_cifti_fast.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from .. import xmlutils as xml
2525
from ..externals import inflection
2626
from ..externals.six import BytesIO
27-
from ..nifti1 import Nifti1Extension, extension_codes
27+
from ..nifti1 import Nifti1Extension, extension_codes, intent_codes
2828
from ..nifti2 import Nifti2Header, Nifti2Image
2929

3030

@@ -50,6 +50,33 @@ def _mangle(self, value):
5050
extension_codes.add_codes((
5151
(CiftiExtension.code, "cifti", CiftiExtension),))
5252

53+
intent_codes.add_codes((
54+
# The codes below appear on the CIFTI-2 standard
55+
# http://www.nitrc.org/plugins/mwiki/index.php/cifti:ConnectivityMatrixFileFormats
56+
# https://www.nitrc.org/forum/attachment.php?attachid=341&group_id=454&forum_id=1955
57+
(3000, 'dense fiber/fan samples', (), 'NIFTI_INTENT_CONNECTIVITY_UNKNOWN'),
58+
(3001, 'dense connectivity', (), 'NIFTI_INTENT_CONNECTIVITY_DENSE'),
59+
(3002, 'dense data series/fiber fans', (),
60+
'NIFTI_INTENT_CONNECTIVITY_DENSE_SERIES'),
61+
(3003, 'parcellated connectivity', (),
62+
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED'),
63+
(3004, 'parcellated data series', (),
64+
"NIFTI_INTENT_CONNECTIVITY_PARCELLATED_SERIES"),
65+
(3006, 'dense scalar', (),
66+
'NIFTI_INTENT_CONNECTIVITY_DENSE_SCALARS'),
67+
(3007, 'dense label', (),
68+
'NIFTI_INTENT_CONNECTIVITY_DENSE_LABELS'),
69+
(3008, 'parcellated scalar', (),
70+
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_SCALAR'),
71+
(3009, 'parcellated dense connectivity', (),
72+
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_DENSE'),
73+
(3010, 'dense parcellated connectivity', (),
74+
'NIFTI_INTENT_CONNECTIVITY_DENSE_PARCELLATED'),
75+
(3011, 'parcellated connectivity series', (),
76+
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_PARCELLATED_SERIES'),
77+
(3012, 'parcellated connectivity scalar', (),
78+
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_PARCELLATED_SCALAR')))
79+
5380

5481
class _CiftiAsNiftiHeader(Nifti2Header):
5582
''' Class for Cifti2 header extension '''

nibabel/nifti1.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -230,31 +230,6 @@
230230
(2003, 'rgb vector', (), "NIFTI_INTENT_RGB_VECTOR"),
231231
(2004, 'rgba vector', (), "NIFTI_INTENT_RGBA_VECTOR"),
232232
(2005, 'shape', (), "NIFTI_INTENT_SHAPE"),
233-
# The codes below appear on the CIFTI-2 standard
234-
# http://www.nitrc.org/plugins/mwiki/index.php/cifti:ConnectivityMatrixFileFormats
235-
# https://www.nitrc.org/forum/attachment.php?attachid=341&group_id=454&forum_id=1955
236-
(3000, 'dense fiber/fan samples', (), 'NIFTI_INTENT_CONNECTIVITY_UNKNOWN'),
237-
(3001, 'dense connectivity', (), 'NIFTI_INTENT_CONNECTIVITY_DENSE'),
238-
(3002, 'dense data series/fiber fans', (),
239-
'NIFTI_INTENT_CONNECTIVITY_DENSE_SERIES'),
240-
(3003, 'parcellated connectivity', (),
241-
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED'),
242-
(3004, 'parcellated data series', (),
243-
"NIFTI_INTENT_CONNECTIVITY_PARCELLATED_SERIES"),
244-
(3006, 'dense scalar', (),
245-
'NIFTI_INTENT_CONNECTIVITY_DENSE_SCALARS'),
246-
(3007, 'dense label', (),
247-
'NIFTI_INTENT_CONNECTIVITY_DENSE_LABELS'),
248-
(3008, 'parcellated scalar', (),
249-
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_SCALAR'),
250-
(3009, 'parcellated dense connectivity', (),
251-
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_DENSE'),
252-
(3010, 'dense parcellated connectivity', (),
253-
'NIFTI_INTENT_CONNECTIVITY_DENSE_PARCELLATED'),
254-
(3011, 'parcellated connectivity series', (),
255-
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_PARCELLATED_SERIES'),
256-
(3012, 'parcellated connectivity scalar', (),
257-
'NIFTI_INTENT_CONNECTIVITY_PARCELLATED_PARCELLATED_SCALAR'),
258233
), fields=('code', 'label', 'parameters', 'niistring'))
259234

260235

0 commit comments

Comments
 (0)