Home | Trees | Indices | Help |
|
---|
|
NIfTI header representation.
NIfTI header can be created by loading information from an existing NIfTI file or by creating a matching NIfTI header for a ndarray.
In addition, a number of methods to manipulate the header information are provided. However, this class is not able to write a NIfTI header back to disk. Please refer to the NIfTIImage class for this functionality.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
nvox | |||
max | |||
min | |||
sform_inv Returns the inverse sform matrix. |
|||
qform_inv Returns the inverse qform matrix. |
|||
extent Returns the shape of the dataimage. |
|||
volextent Returns the size/shape of the volume(s) in the image as a tuple. |
|||
timepoints Returns the number of timepoints in the image. |
|||
raw_nimg | |||
filename Returns the filename. |
|||
slope | |||
intercept | |||
voxdim Returns a 3-tuple a voxel dimensions/size in (x,y,z). |
|||
pixdim Returns the pixel dimensions on all 7 dimensions. |
|||
description | |||
header Returns the header data of the NiftiImage in a dictionary. |
|||
sform Returns the sform matrix. |
|||
qform Returns the qform matrix. |
|||
quatern Returns a 3-tuple containing (qb, qc, qd). |
|||
qoffset Returns a 3-tuple containing (qx, qy, qz). |
|||
qfac | |||
rtime Returns the temporal distance between the volumes in a timeseries. |
|||
Inherited from |
|
source .
|
|
|
Returns a 3-tuple a voxel dimensions/size in (x,y,z). The voxdim property is an alternative way to access this function. |
Set voxel dimensions/size. The qform matrix and its inverse will be recalculated automatically. Besides reading it is also possible to set the voxel dimensions by assigning to the voxdim property. |
Set the pixel dimensions. Calling setPixDims() with a length-3 sequence equals calling setVoxDims(). |
Returns the pixel dimensions on all 7 dimensions. The function is similar to getVoxDims(), but instead of the 3d spatial dimensions of a voxel it returns the dimensions of an image pixel on all 7 dimensions supported by the NIfTI dataformat. |
Returns the shape of the dataimage. Please note that the order of dimensions is different from the tuple
returned by calling See also getVolumeExtent() and getTimepoints(). The extent property is an alternative way to access this function.
|
Returns the size/shape of the volume(s) in the image as a tuple. The volextent property is an alternative way to access this function.
|
Returns the number of timepoints in the image. In case of a 3d (or less dimension) image this method returns 1. The timepoints property is an alternative way to access this function. |
Returns the temporal distance between the volumes in a timeseries. The rtime property is an alternative way to access this function. |
Returns the header data of the NiftiImage in a dictionary. Note, that modifications done to this dictionary do not cause any modifications in the NIfTI image. Please use the updateFromDict() method to apply changes to the image. The header property is an alternative way to access this function. But please note that the header property cannot be used like this: nimg.header['something'] = 'new value' Instead one has to get the header dictionary, modify and later reassign it: h = nimg.header h['something'] = 'new value' nimg.header = h |
Update NIfTI header information. Updated header data is read from the supplied dictionary. One cannot
modify dimensionality and datatype of the image data. If such
information is present in the header dictionary it is removed before
the update. If resizing or datatype casting are required one has to
convert the image data into a separate array ( |
Set the slope attribute in the NIfTI header. Besides reading it is also possible to set the slope by assigning to the slope property. |
Set the intercept attribute in the NIfTI header. Besides reading it is also possible to set the intercept by assigning to the intercept property. |
Set the description element in the NIfTI header. Besides reading it is also possible to set the description by assigning to the description property. |
Set the type of space described by the NIfTI transformations. The NIfTI format defines five coordinate system types which are used to describe the target space of a transformation (qform or sform). Please note, that the last four transformation types are only available in the NIfTI format and not when saving into ANALYZE.
Parameters:
|
Returns the sform matrix. Please note, that the returned SForm matrix is not bound to the NiftiImage object. Therefore it cannot be successfully modified in-place. Modifications to the SForm matrix can only be done by setting a new SForm matrix either by calling setSForm() or by assigning it to the sform attribute. The sform property is an alternative way to access this function. |
Sets the sform matrix. The supplied value has to be a 4x4 matrix. The matrix elements will be converted to floats. By definition the last row of the sform matrix has to be (0,0,0,1). However, different values can be assigned, but will not be stored when the niftifile is saved. The inverse sform matrix will be automatically recalculated. Besides reading it is also possible to set the sform matrix by assigning to the sform property. Parameters:
|
Returns the inverse sform matrix. Please note, that the inverse SForm matrix cannot be modified in-place. One needs to set a new SForm matrix instead. The corresponding inverse matrix is then re-calculated automatically. The sform_inv property is an alternative way to access this function. |
Returns the qform matrix. Please note, that the returned QForm matrix is not bound to the NiftiImage object. Therefore it cannot be successfully modified in-place. Modifications to the QForm matrix can only be done by setting a new QForm matrix either by calling setQForm() or by assigning it to the qform property. |
Returns the inverse qform matrix. The qform_inv property is an alternative way to access this function. Please note, that the inverse QForm matrix cannot be modified in-place. One needs to set a new QForm matrix instead. The corresponding inverse matrix is then re-calculated automatically. |
Sets the qform matrix. The supplied value has to be a 4x4 matrix. The matrix will be converted to float. The inverse qform matrix and the quaternion representation will be automatically recalculated. Besides reading it is also possible to set the qform matrix by assigning to the qform property. Parameters:
|
Set Quaternion from 3-tuple (qb, qc, qd). The qform matrix and it's inverse are re-computed automatically. Besides reading it is also possible to set the quaternion by assigning to the quatern property. Parameters:
|
Returns a 3-tuple containing (qb, qc, qd). The quatern property is an alternative way to access this function. |
Set QOffset from 3-tuple (qx, qy, qz). The qform matrix and its inverse are re-computed automatically. Besides reading it is also possible to set the qoffset by assigning to the qoffset property. Parameters:
|
Returns a 3-tuple containing (qx, qy, qz). The qoffset property is an alternative way to access this function. |
Set qfac (scaling factor of qform matrix). The qform matrix and its inverse are re-computed automatically. Besides reading it is also possible to set the qfac by assigning to the qfac property. Parameters:
|
Returns to orientation of the i, j and k axis as stored in the qform matrix. By default NIfTI orientation codes are returned, but if |
Returns to orientation of the i, j and k axis as stored in the sform matrix. By default NIfTI orientation codes are returned, but if |
Returns the filename. To distinguish ANALYZE from 2-file NIfTI images the image filename is returned for ANALYZE images while the header filename is returned for NIfTI files. The filename property is an alternative way to access this function. |
|
nvox
|
max
|
min
|
sform_invReturns the inverse sform matrix. Please note, that the inverse SForm matrix cannot be modified in-place. One needs to set a new SForm matrix instead. The corresponding inverse matrix is then re-calculated automatically. The sform_inv property is an alternative way to access this function.
|
qform_invReturns the inverse qform matrix. The qform_inv property is an alternative way to access this function. Please note, that the inverse QForm matrix cannot be modified in-place. One needs to set a new QForm matrix instead. The corresponding inverse matrix is then re-calculated automatically.
|
extentReturns the shape of the dataimage. Please note that the order of dimensions is different from the tuple
returned by calling See also getVolumeExtent() and getTimepoints(). The extent property is an alternative way to access this function.
|
volextentReturns the size/shape of the volume(s) in the image as a tuple. The volextent property is an alternative way to access this function.
|
timepointsReturns the number of timepoints in the image. In case of a 3d (or less dimension) image this method returns 1. The timepoints property is an alternative way to access this function.
|
raw_nimg
|
filenameReturns the filename. To distinguish ANALYZE from 2-file NIfTI images the image filename is returned for ANALYZE images while the header filename is returned for NIfTI files. The filename property is an alternative way to access this function.
|
slope
|
intercept
|
voxdimReturns a 3-tuple a voxel dimensions/size in (x,y,z). The voxdim property is an alternative way to access this function.
|
pixdimReturns the pixel dimensions on all 7 dimensions. The function is similar to getVoxDims(), but instead of the 3d spatial dimensions of a voxel it returns the dimensions of an image pixel on all 7 dimensions supported by the NIfTI dataformat.
|
description
|
headerReturns the header data of the NiftiImage in a dictionary. Note, that modifications done to this dictionary do not cause any modifications in the NIfTI image. Please use the updateFromDict() method to apply changes to the image. The header property is an alternative way to access this function. But please note that the header property cannot be used like this: nimg.header['something'] = 'new value' Instead one has to get the header dictionary, modify and later reassign it: h = nimg.header h['something'] = 'new value' nimg.header = h
|
sformReturns the sform matrix. Please note, that the returned SForm matrix is not bound to the NiftiImage object. Therefore it cannot be successfully modified in-place. Modifications to the SForm matrix can only be done by setting a new SForm matrix either by calling setSForm() or by assigning it to the sform attribute. The sform property is an alternative way to access this function. |
qformReturns the qform matrix. Please note, that the returned QForm matrix is not bound to the NiftiImage object. Therefore it cannot be successfully modified in-place. Modifications to the QForm matrix can only be done by setting a new QForm matrix either by calling setQForm() or by assigning it to the qform property. |
quaternReturns a 3-tuple containing (qb, qc, qd). The quatern property is an alternative way to access this function.
|
qoffsetReturns a 3-tuple containing (qx, qy, qz). The qoffset property is an alternative way to access this function.
|
qfac
|
rtimeReturns the temporal distance between the volumes in a timeseries. The rtime property is an alternative way to access this function.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Oct 17 15:19:37 2008 | http://epydoc.sourceforge.net |