6
6
# copyright and license terms.
7
7
#
8
8
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
9
- ''' Read / write access to CIfTI2 image format
9
+ ''' Read / write access to CIFTI-2 image format
10
10
11
11
Format of the NIFTI2 container format described here:
12
12
13
13
http://www.nitrc.org/forum/message.php?msg_id=3738
14
14
15
- Definition of the CIFTI2 header format and file extensions can be found at:
15
+ Definition of the CIFTI-2 header format and file extensions can be found at:
16
16
17
17
http://www.nitrc.org/projects/cifti
18
18
'''
@@ -39,7 +39,7 @@ def _float_01(val):
39
39
40
40
41
41
class Cifti2HeaderError (Exception ):
42
- """ Error in CIFTI2 header
42
+ """ Error in CIFTI-2 header
43
43
"""
44
44
45
45
@@ -175,7 +175,7 @@ def _to_xml_element(self):
175
175
176
176
177
177
class Cifti2LabelTable (xml .XmlSerializable , MutableMapping ):
178
- """ CIFTI2 label table: a sequence of ``Cifti2Label``s
178
+ """ CIFTI-2 label table: a sequence of ``Cifti2Label``s
179
179
180
180
* Description - Used by NamedMap when IndicesMapToDataType is
181
181
"CIFTI_INDEX_TYPE_LABELS" in order to associate names and display colors
@@ -233,7 +233,7 @@ def _to_xml_element(self):
233
233
234
234
235
235
class Cifti2Label (xml .XmlSerializable ):
236
- """ CIFTI2 label: association of integer key with a name and RGBA values
236
+ """ CIFTI-2 label: association of integer key with a name and RGBA values
237
237
238
238
For all color components, value is floating point with range 0.0 to 1.0.
239
239
@@ -311,7 +311,7 @@ def _to_xml_element(self):
311
311
312
312
313
313
class Cifti2NamedMap (xml .XmlSerializable ):
314
- """CIFTI2 named map: association of name and optional data with a map index
314
+ """CIFTI-2 named map: association of name and optional data with a map index
315
315
316
316
Associates a name, optional metadata, and possibly a LabelTable with an
317
317
index in a map.
@@ -429,7 +429,7 @@ def _to_xml_element(self):
429
429
430
430
431
431
class Cifti2VoxelIndicesIJK (xml .XmlSerializable , MutableSequence ):
432
- """CIFTI2 VoxelIndicesIJK: Set of voxel indices contained in a structure
432
+ """CIFTI-2 VoxelIndicesIJK: Set of voxel indices contained in a structure
433
433
434
434
* Description - Identifies the voxels that model a brain structure, or
435
435
participate in a parcel. Note that when this is a child of BrainModel,
@@ -511,7 +511,7 @@ def _to_xml_element(self):
511
511
512
512
513
513
class Cifti2Vertices (xml .XmlSerializable , MutableSequence ):
514
- """CIFTI2 vertices - association of brain structure and a list of vertices
514
+ """CIFTI-2 vertices - association of brain structure and a list of vertices
515
515
516
516
* Description - Contains a BrainStructure type and a list of vertex indices
517
517
within a Parcel.
@@ -577,7 +577,7 @@ def _to_xml_element(self):
577
577
578
578
579
579
class Cifti2Parcel (xml .XmlSerializable ):
580
- """CIFTI2 parcel: association of a name with vertices and/or voxels
580
+ """CIFTI-2 parcel: association of a name with vertices and/or voxels
581
581
582
582
* Description - Associates a name, plus vertices and/or voxels, with an
583
583
index.
@@ -692,7 +692,7 @@ def _to_xml_element(self):
692
692
693
693
694
694
class Cifti2Volume (xml .XmlSerializable ):
695
- """CIFTI2 volume: information about a volume for mappings that use voxels
695
+ """CIFTI-2 volume: information about a volume for mappings that use voxels
696
696
697
697
* Description - Provides information about the volume for any mappings that
698
698
use voxels.
@@ -735,7 +735,7 @@ def _to_xml_element(self):
735
735
736
736
737
737
class Cifti2VertexIndices (xml .XmlSerializable , MutableSequence ):
738
- """CIFTI2 vertex indices: vertex indices for an associated brain model
738
+ """CIFTI-2 vertex indices: vertex indices for an associated brain model
739
739
740
740
The vertex indices (which are independent for each surface, and
741
741
zero-based) that are used in this brain model[.] The parent
@@ -1078,7 +1078,7 @@ def _to_xml_element(self):
1078
1078
1079
1079
1080
1080
class Cifti2Matrix (xml .XmlSerializable , MutableSequence ):
1081
- """ CIFTI2 Matrix object
1081
+ """ CIFTI-2 Matrix object
1082
1082
1083
1083
This is a list-like container where the elements are instances of
1084
1084
:class:`Cifti2MatrixIndicesMap`.
@@ -1210,7 +1210,7 @@ def _to_xml_element(self):
1210
1210
1211
1211
1212
1212
class Cifti2Header (FileBasedHeader , xml .XmlSerializable ):
1213
- ''' Class for CIFTI2 header extension '''
1213
+ ''' Class for CIFTI-2 header extension '''
1214
1214
1215
1215
def __init__ (self , matrix = None , version = "2.0" ):
1216
1216
FileBasedHeader .__init__ (self )
@@ -1301,7 +1301,7 @@ def from_axes(cls, axes):
1301
1301
1302
1302
1303
1303
class Cifti2Image (DataobjImage ):
1304
- """ Class for single file CIFTI2 format image
1304
+ """ Class for single file CIFTI-2 format image
1305
1305
"""
1306
1306
header_class = Cifti2Header
1307
1307
valid_exts = Nifti2Image .valid_exts
@@ -1329,7 +1329,7 @@ def __init__(self,
1329
1329
returns an array from ``np.asanyarray``. It should have a
1330
1330
``shape`` attribute or property.
1331
1331
header : Cifti2Header instance or Sequence[cifti2_axes.Axis]
1332
- Header with data for / from XML part of CIFTI2 format.
1332
+ Header with data for / from XML part of CIFTI-2 format.
1333
1333
Alternatively a sequence of cifti2_axes.Axis objects can be provided
1334
1334
describing each dimension of the array.
1335
1335
nifti_header : None or mapping or NIfTI2 header instance, optional
@@ -1356,7 +1356,7 @@ def nifti_header(self):
1356
1356
1357
1357
@classmethod
1358
1358
def from_file_map (klass , file_map ):
1359
- """ Load a CIFTI2 image from a file_map
1359
+ """ Load a CIFTI-2 image from a file_map
1360
1360
1361
1361
Parameters
1362
1362
----------
@@ -1376,7 +1376,7 @@ def from_file_map(klass, file_map):
1376
1376
cifti_header = item .get_content ()
1377
1377
break
1378
1378
else :
1379
- raise ValueError ('NIfTI2 header does not contain a CIFTI2 '
1379
+ raise ValueError ('NIfTI2 header does not contain a CIFTI-2 '
1380
1380
'extension' )
1381
1381
1382
1382
# Construct cifti image.
@@ -1435,7 +1435,7 @@ def to_file_map(self, file_map=None):
1435
1435
img .to_file_map (file_map or self .file_map )
1436
1436
1437
1437
def update_headers (self ):
1438
- ''' Harmonize CIFTI2 and NIfTI headers with image data
1438
+ ''' Harmonize CIFTI-2 and NIfTI headers with image data
1439
1439
1440
1440
>>> import numpy as np
1441
1441
>>> data = np.zeros((2,3,4))
0 commit comments