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
|
|---|
Methods
| filespec_to_file_map(klass, filespec) | |
| filespec_to_files(klass, filespec) | |
| from_file_map(klass, file_map) | |
| from_filename(klass, filename) | |
| from_files(klass, file_map) | |
| from_filespec(klass, filespec) | |
| from_image(klass, img) | Class method to create new instance of own class from img |
| get_affine() | |
| get_data() | |
| get_data_dtype() | |
| get_filename() | Fetch the image filename |
| get_header() | |
| get_shape() | Return shape for image |
| header_class | alias of Header |
| instance_to_filename(klass, img, filename) | Save img in our own format, to name implied by filename |
| load(klass, filename) | |
| make_file_map(klass[, mapping]) | Class method to make files holder for this image type |
| set_data_dtype(dtype) | |
| set_filename(filename) | Sets the files in the object from a given filename |
| to_file_map([file_map]) | |
| to_filename(filename) | Write image to files implied by filename string |
| to_files([file_map]) | |
| to_filespec(filename) | |
| update_header() | Update header from information in image |
Class method to create new instance of own class from img
| Parameters: | img : spatialimage instance
|
|---|---|
| Returns: | cimg : spatialimage instance
|
Fetch the image filename
| Parameters: | None : |
|---|---|
| Returns: | fname : None or str
|
Return shape for image
This function deprecated; please use the shape property instead
alias of Header
Save img in our own format, to name implied by filename
This is a class method
| Parameters: | img : spatialimage instance
filename : str
|
|---|
Class method to make files holder for this image type
| Parameters: | mapping : None or mapping, optional
|
|---|---|
| Returns: | file_map : dict
|
Sets the files in the object from a given filename
The different image formats may check whether the filename has an extension characteristic of the format, and raise an error if not.
| Parameters: | filename : str
|
|---|
Write image to files implied by filename string
| Parameters: | filename : str
|
|---|---|
| Returns: | None : |
Update header from information in image