The basic functions of the Matlab tool NIFTI package

The basic functions of the Matlab tool NIFTI package

The Nifti format was originally invented for neuroimaging. The Neuroimaging Informatics Technology Initiative (NIFTI) has preset the NIfTI format as a replacement for the ANALYZE7.5 format. Its original application area is neuroimaging, but it is also used in other fields. The main feature of this format is that it contains two affine coordinates that relate the index (i, j, k) of each voxel to its spatial position (x, y, z).

Tools for NIfTI and ANALYZE image The basic functions of the toolkit :
(Basic Programs provided on the official website, save them for your own use)

URL: https://ww2.mathworks.cn/matlabcentral/fileexchange/8797-tools-for-nifti-and-analyze-image
在这里插入图片描述

Installation package:
Link: https://pan.baidu.com/s/132B9mbzeli8MvRD6rMpA6A
Extraction code: 1vw3

How to install NIFTI please see the link:
https://blog.csdn.net/Alexa_/article/details/132351998?spm=1001.2014.3001.5501
在这里插入图片描述

1. load_untouch_header_only.m : Load only the header part of the NIfTI or ANALYZE file. Input files will be automatically detected. NIfTI files will return a NIfTI structure, and ANALYZE files will return an ANALYZE structure.

2. load_nii.m : Load an N-dimensional NIfTI file (where N can be 3 to 7) or an ANALYZE file (where N can be 3 to 4), and apply header information (such as affine geometric transformation, voxel intensity scaling , etc. ) to the data. If your file has more than 3 dimensions (eg time series, etc.) you can also specify a range to extract only 1 or more volumes.

3. save_nii.m : Save the N-dimensional NIfTI structure (where N can be 3 to 7) loaded by "load_nii.m" or made by "make_nii.m" into a NIfTI file.

4. make_nii.m : Make an N-dimensional NIfTI structure (where N can be 3 to 7) based on an N-dimensional matrix and other optional parameters (such as voxel_size, origin, etc.). The NIfTI structure generated by "make_nii" can be saved to a NIfTI file using the "save_nii" command.

5. make_ana.m : Make a 3D ANALYZE structure based on the 3D matrix and other optional parameters (such as voxel_size, origin, etc.). The ANALYZE structure generated by "make_ana" can be saved into an ANALYZE file using the "save_untouch_nii" command for compatibility with some ANALYZE-only programs.

6. reslice_nii.m : Resample a 3D (or 4D) NIfTI file, or use an ANALYZE file of the affine matrix M in a .mat file , and save the resampled data to a new NIfTI file. The program will be based on affine matrices, which is particularly useful for oblique images with non-orthogonal rotations or shears that cannot be loaded using "load_nii.m". You can also specify voxel_size, etc., which will not cause negative effects. Just remember not to do slice time correction after using "reslice_nii.m".

7. pad_nii.m : Pads the volume from any of the six sides in the NIfTI structure while keeping the originator, voxel size, data type and description unchanged. This program is particularly useful after you have used reslice_nii, since the new volume is likely to have different dimensions.

8. clip_nii.m : Clip a volume in a NIfTI structure from any of the six sides while keeping the originator, voxel size, data type and description unchanged. This program is particularly useful after you have used reslice_nii, since the new volume is likely to have different dimensions.

9. view_nii.m : View and edit 3D (or 4D) NIfTI or ANALYZE structures loaded by "load_nii.m" or made by "make_nii.m". Activation maps, ROIs, etc. can be overlaid on top of the background image (see image above). Plot views can be embedded into your existing graphics window. If you use it as a standalone program, it can also edit the image's orientation and voxel values, view volume histograms, and save modified images.

10. load_untouch_nii.m : Load an N-dimensional NIfTI file (where N can be 3 to 7) or an ANALYZE file (where N can be 3 to 4), but do not apply any changes indicated in the title. Warning: Do not use "view_nii.m" to view structures loaded by "load_untouch_nii.m".

11. save_untouch_nii.m : Saves the file loaded by "load_untouch_nii.m" or "make_ana.m" into a new NIfTI or ANALYZE file. If the loaded dataset is not modified, the headers and data in the newly saved file should be the same as in the original file.

Other programs:

1.collapse_nii_scan.m : Consolidate multiple single-scan NIfTI or ANALYZE files into a multi-scan NIfTI file.

2. expand_nii_scan.m:将一个多次扫描的 NIfTI 文件分解为多个单次扫描的 NIfTI 文件。

3. save_untouch_slice.m:用load_untouch_nii加载的部分切片保存回原始图像。您可以以任何方式处理这些切片矩阵,只要它们的尺寸不变。

4. get_nii_frame.m:返回一个NIfTI文件的时间帧数。

5.flip_lr.m:沿穿过originator的平面左右翻转NIfTI或ANALYZE文件,并将LR翻转后的数据保存到NIfTI文件中。警告:请谨慎使用此程序,尽管您可以随时将其翻转回来。

6. load_nii_ext.m:从 NIfTI 文件加载头扩展。

7. mat_into_hdr.m:将旧 SPM .mat 文件中的仿射矩阵集成到其 .hdr 头文件中。因此,ANALYZE 文件被转换为带有更新的 .hdr 头文件的 NIfTI 文件。

Guess you like

Origin blog.csdn.net/Alexa_/article/details/132352137