Initialize image
The image is a combination of (array, affine matrix, header), with optional metadata in extra, and filename / file-like objects contained in the file_map mapping.
| Parameters : | data : object
affine : None or (4,4) array-like
header : None or mapping or header instance, optional
extra : None or mapping, optional
file_map : mapping, optional
|
|---|
alias of ArrayProxy
class method to create image from mapping in file_map `
Return header
alias of AnalyzeHeader
Write image to file_map or contained self.file_map
| Parameters : | file_map : None or mapping, optional
|
|---|
Harmonize header with image data and affine
>>> data = np.zeros((2,3,4))
>>> affine = np.diag([1.0,2.0,3.0,1.0])
>>> img = AnalyzeImage(data, affine)
>>> hdr = img.get_header()
>>> img.shape == (2, 3, 4)
True
>>> img.update_header()
>>> hdr.get_data_shape() == (2, 3, 4)
True
>>> hdr.get_zooms()
(1.0, 2.0, 3.0)