Classes
Methods
(static) load_untouch0_nii_hdr(machine, data) → {Object}
Loads the header of a NIfTI file.
This function initializes a FILE object to read the binary data of a NIfTI header. It then extracts the header information and returns it. This function does not read anything regarding the transformation.
Name | Type | Description |
---|---|---|
machine | 'ieee-le' | | Byte order used by the machine ('ieee-le' for little-endian, 'ieee-be' for big-endian). |
data | ArrayBuffer | The binary data of the NIfTI file. |
- See
- For function that load transformation information: load_untouch_nii_hdr
The parsed NIfTI header object.
- Type:
- Object
(static) load_untouch_nii(filename, data, img_idxopt, dim5_idxopt, dim6_idxopt, dim7_idxopt, old_RGBopt, slice_idxopt) → {Object}
Load a NIfTI or ANALYZE dataset without applying affine transformations or voxel intensity scaling. This function preserves the original NIfTI header and data untouched.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
filename | string | The NIfTI or ANALYZE file name (with extension). | ||
data | ArrayBuffer | The raw content of the file. | ||
img_idx | Array.<number> | <optional> | [] | A numerical array of image volume indices. Only the specified volumes will be loaded. Default is to load all available volumes. |
dim5_idx | Array.<number> | <optional> | [] | A numerical array of 5th dimension indices. Default is to load all available slices. |
dim6_idx | Array.<number> | <optional> | [] | A numerical array of 6th dimension indices. Default is to load all available slices. |
dim7_idx | Array.<number> | <optional> | [] | A numerical array of 7th dimension indices. Default is to load all available slices. |
old_RGB | 0 | | <optional> | 0 | A flag to handle old RGB format. Set to 1 if the image uses the old RGB format (Analyze 6.0), otherwise set to 0 (default). |
slice_idx | Array.<number> | <optional> | [] | A numerical array of image slice indices. Default is to load all available slices. |
nii - The NIfTI object containing the header and image data.
- Type:
- Object
(static) load_untouch_nii_hdr(machine, data) → {Object}
Loads the header of a NIfTI file.
This function initializes a FILE object to read the binary data of a NIfTI header. It then extracts the header information and returns it. If the magic
field in the header is not 'n+1' or 'ni1', qform_code
and sform_code
are set to 0.
Name | Type | Description |
---|---|---|
machine | 'ieee-le' | | Byte order used by the machine ('ieee-le' for little-endian, 'ieee-be' for big-endian). |
data | ArrayBuffer | The binary data of the NIfTI file. |
- See
- For function that does not load transformation information: load_untouch0_nii_hdr
The parsed NIfTI header object.
- Type:
- Object
(static) nifti_anatomical_convention(nii) → {Object}
Automatically flips NIFTI image data to have the right side on the right. Only works on 3D black-and-white NIfTI images. It does not work on colored images, images with imaginary numbers, or 4D images.
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
nii | Object | NIFTI file data loaded using Properties
|
The modified NIFTI object with flipped header and data.
- Type:
- Object
const flippedNii = open_nii_anatomical_convention(nii);