Reading NIfTI rescale slope/inter in medicalVolume
6 次查看(过去 30 天)
显示 更早的评论
Hi, I am wondering if it is a bug or something with the newly released medical imaging toolbox of version 2022b.
Problem:
I was given a NIfTI file of a parametric imaging. The data format is (signed) int16. There is a rescale slope/interception parameter in the NIfTI header (`raw.scl_slope`/`raw.scl_inter`). I want to read the matrix into a medical volume:
Vol = medicalVolume("%NIfTI_file.nii%")
However, `Vol.Voxels` is a matrix of int16, without applying the rescale parameters.
Expected outcome:
It should be able to do any of the following things:
- Directly apply the rescaling;
- Provide an argument to specify the type of output (`raw` vs `rescaled`);
- Provide the rescaling information in the `medicalVolume` object that it produces.
Workaround:
Use the traditional `niftiread()` and `niftiinfo()` functions.
n = niftiread("%NIfTI_file.nii%");
n_info = niftiinfo("%NIfTI_file.nii%")
image = n_info.raw.scl_slope*double(n)+n_info.raw.scl_inter;
Question:
Is it a problem with the Medical Imaging Toolbox, or I was not correctly using is? Is there a workaround within the toolbox?
Thank you!
0 个评论
回答(1 个)
aditi bagora
2023-9-27
Based on the provided description, it appears that you expect the "medicalVolume" function to load NifTi data while internally applying rescaling if it is available.
As per the documentation, the "medicalVolume" function has rescaling functionality specifically for DICOM images. The provided link below confirms this.
Consequently, when loading NifTi data using "medicalVolume," rescaling is not applied.
The Medical Imaging Toolbox provides functions such as” niftiread()” and “ niftiinfo()” specifically designed for reading NifTi files and extracting metadata. The workaround you suggested is indeed the most suitable approach for handling rescaling within your implementation.
Hope the information helps you with the issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biomedical Imaging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!