How to save file in DICOM format without change the pixel value

5 ビュー (過去 30 日間)
mohd akmal masud
mohd akmal masud 2025 年 3 月 5 日
コメント済み: mohd akmal masud 2025 年 3 月 5 日
Dear all,
I have file as attached. Then, I run this below script. But my problem is, when I try to save dicom format, the error pop up. Because cannot save in single type.
When I change to uin16 type, it can save in dicom format. But the problem is, value pixel i changed. I dont want the pixel valus is changeg.
clc
clear all
close all
sz = [128 128 128];
fname = 'point166ad.ict';
fid = fopen(fname);
data = fread(fid,'*float'); % assuming uint
fclose(fid);
data = reshape(data,sz);
imshow3D(data)
muwater = 0.182868;
mudata = data;
dataHU = ((mudata - muwater)./ (muwater-0))*1000;
figure, imshow3D(dataHU);
imstack34 = permute(dataHU,[1 2 4 3]);
dicomwrite( imstack34, "new4D.dcm");
  2 件のコメント
Cris LaPierre
Cris LaPierre 2025 年 3 月 5 日
The zip file contains an *.hct file, not the *.ict file the code needs.
mohd akmal masud
mohd akmal masud 2025 年 3 月 5 日
here is attached the ict file

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 3 月 5 日
The datatypes for X in dicomwrite() is documented as
Data Types: int8 | int16 | uint8 | uint16
According to the article "Thirty Years of the DICOM Standard" https://pmc.ncbi.nlm.nih.gov/articles/PMC10610864/
Regarding the DICOM pixel data section, the support for floating point values (single precision 32-bit and double precision 64-bit) is limited to radiation dose values in radiotherapy and, more recently, to parametric maps defined as images in which the pixel values have been derived from the value stored by the modality to be the expression of a physical quantity. In all the other cases, DICOM pixel values can only be integers. DICOM uses a scale factor whenever the values stored in each voxel need to be scaled to different units. This is achieved through two fields specified in the metadata defining the slope and the intercept of the linear transformation to be used to convert pixel values to real-world values.
Therefore, using slope and intercept you could effectively get 16 bits fixed-point, but you cannot get 32 bits floating point, and that is a limitation built into DICOM format.

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by