简体   繁体   English

如何将Nifti文件转换为.mat Matlab文件?

[英]How to transfer Nifti file into .mat Matlab file?

I have a Nifti file, the size of which is 62*62*38. 我有一个Nifti文件,其大小为62 * 62 * 38。 How can I transfer the Nifti file to .mat Matlab file? 如何将Nifti文件传输到.mat Matlab文件?

Most medical imaging data can be manipulated effectively using some kind of toolbox, such as SPM. 大多数医学影像数据可以使用某种工具箱(例如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 ). 但是,如果您需要访问原始矩阵,我总是使用MathWorks文件交换站点( 此处 )中的NIfTI工具。

There are two functions that are relevant here: load_nii and load_untouched_nii . 这里有两个相关的函数: load_niiload_untouched_nii The first function load_nii takes care of situations where the header in the NiFTI contains transformations that haven't been applied to the underlying data matrix. 第一个函数load_nii处理load_nii中的标头包含尚未应用于基础数据矩阵的转换的情况。 If you know that no such transformations exist, you can use load_untouched_nii to avoid the reslicing being done. 如果您知道不存在此类转换,则可以使用load_untouched_nii避免进行切片。 Both functions return a structure, and the data matrix is located in the img field of the returned structure. 这两个函数都返回一个结构,并且数据矩阵位于返回的结构的img字段中。

这样可以将NIFTI以及许多其他医学图像文件类型读入MATLAB数组,然后将其另存为.mat文件。

FreeSurfer has a MATLAB function called "MRIread". FreeSurfer具有称为“ MRIread”的MATLAB函数。 It can read NIFTI (.nii, .nii.gz) files into a MATLAB structure, which can then be saved to a MAT file if so desired. 它可以将NIFTI(.nii,.nii.gz)文件读取到MATLAB结构中,然后根据需要将其保存到MAT文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM