Reading NIfTI rescale slope/inter in medicalVolume

조회 수: 3 (최근 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 CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by