Slice thickness information lost when using dicomwrite()

조회 수: 6(최근 30일)
Hi, I have written a bit of code to perform some manipulations on a set of DICOM files whose slice thickness (according to dicominfo) is 1 and then write them using dicomwrite. When I use InfoDcm.Slicethickness=1; in order for the slice thickness to be preserved, it only appears as [] when I apply dicominfo to the output file. Does anyone know how to ensure the slice thickness is unchanged?
Thanks, RH

채택된 답변

Kenneth Eaton
Kenneth Eaton 2011년 2월 28일
I think your problem may be the missing capitalization of the "t" in the name SliceThickness. Notice that all the fields in the structure returned by DICOMINFO are in upper camel case
  댓글 수: 3
Roman Hochuli
Roman Hochuli 2011년 2월 28일
Sorry - I'll explain my problem: I'm using a program called CTcreate to generate a phantom (file type *.egsphant) to use with a Monte Carlo simulation. This simulation only allows for the phantom to be placed on the z-axis (which in the case of transverse DICOM slices passes perpendicular to the images), so I would like to rotate the phantom 90 degrees about the central axis on matlab. I have done this by using dicomwrite to produce slice in the sagittal plane, however CTcreate does not work properly due to an issue regarding slice thickness and I would therefore like to ensure that slice thickness =1 in the output file. Please see code below:
slice=zeros(512,512);
I=zeros(245,512);
InfoDcm.Modality = 'CT';
InfoDcm.Slicethickness = 1.0;
for i=1:512
for j=245:-1:1
slice=dicomread(['vhm' int2str(j) '.dcm']);
I(246-j,:)=slice(:,i);
end;
dicomwrite(int16(I),['SLICE' int2str(i) '.dcm'],InfoDcm);
end;

댓글을 달려면 로그인하십시오.

추가 답변(1개)

mohd akmal masud
mohd akmal masud 2018년 2월 19일
Hi all,
I want to extract the RescaleSlope value from dicominfo for each slice. But i have 135 slice images. This is my code to extract RescaleSlope. But still failed. I JUST CAN EXTRACT ONE BY ONE ONLY.
P = zeros(256, 256, 135);
for K = 1 : 135
petname = sprintf('PET_I1001_PT%03d.dcm', K);
P(:,:,K) = dicominfo(petname);
end
info=dicominfo(P(:,:,K));
[r,c,slice] = findND (info.RescaleSlope);
Anyone who can help me solve this problem???

Community Treasure Hunt

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

Start Hunting!

Translated by