I have a Nifti file, the size of which is 62*62*38. How can I transfer the Nifti file to .mat Matlab file?
相关问题
- Extract matrix elements using a vector of column i
- How do you get R's null and residual deviance
- How to display an image represented by three matri
- OpenCV - Is there an implementation of marker base
- Avoid copying an array when using mexCallMATLAB
相关文章
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
- Vertical line fit using polyfit
- Reading .mat file using C: how to read cell-struct
- Is it possible to compare 3D images?
- How can I find row to all rows distance matrix bet
This can read NIFTI as well as many other medical image file types into MATLAB arrays, which you can then save as .mat files.
Most medical imaging data can be manipulated effectively using some kind of toolbox, such as SPM. However, if you need to gain access to the raw matrix I've always used NIfTI tools from the Mathworks file exchange site (here).
There are two functions that are relevant here:
load_nii
andload_untouched_nii
. The first functionload_nii
takes care of situations where the header in the NiFTI contains transformations that haven't been applied to the underlying data matrix. If you know that no such transformations exist, you can useload_untouched_nii
to avoid the reslicing being done. Both functions return a structure, and the data matrix is located in theimg
field of the returned structure.FreeSurfer has a MATLAB function called "MRIread". It can read NIFTI (.nii, .nii.gz) files into a MATLAB structure, which can then be saved to a MAT file if so desired.