Reading NIfTI rescale slope/inter in medicalVolume

6 ビュー (過去 30 日間)
Xiangxi Meng
Xiangxi Meng 2022 年 10 月 20 日
回答済み: aditi bagora 2023 年 9 月 27 日
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!

回答 (1 件)

aditi bagora
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.

カテゴリ

Help Center および File ExchangeBiomedical Imaging についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by