Problem of increased 3D volume after reconstruction from 2D CT slides

조회 수: 2 (최근 30일)
Ringo Cheung
Ringo Cheung 2018년 5월 2일
편집: Ringo Cheung 2018년 8월 20일
Dear Everyone,
I have a problem of accuracy after reconstructing CT slides to 3D volume.
In this example, the width of the patient's head is about 140mm as seen from the CT slide. After reconstructing to 3D volume, it was found that the width has increased to about 300mm after outputting to STL file.
Here is the sample of 2D slide and an image of the 3D volume after reconstruction :
Here is the code :
for i = 30 : 160
info = dicominfo(dirOutput(i).name,'UseDictionaryVR',true);
imgTemp = dicomread(info);
imgCropped = imcrop(imgTemp,croppedArea);
imgCroppedBin = imbinarize(imgCropped,0.51728); %Binarize the image
I(:,:,i) = imgCroppedBin;
end
Is = smooth3(I,'gaussian');
fv2 = isosurface(Is,0.5);
fv2 = smoothpatch(fv2,0,3,1,1); %"Smooth Triangulated Mesh" by Dirk-Jan Kroon
patch(fv2,...
'FaceColor',[1,.75,.65],...
'EdgeColor','none');view(35,30); axis off, daspect([1,1,1]);lightangle(45,30);lighting gouraud;
%Create filename according to current timestamp and output 3D model to .STL file
t = datetime('now');
timestamp = datestr(t,30);
fname = '../Desktop/MatLab Demo/TestResult/3Dreconst_';
fext = '.stl';
outfname = strcat(fname,timestamp,fext);
stlwrite(outfname,fv2);
Grateful if anyone can help. Thanks, Ringo
  댓글 수: 2
Robert Roberts
Robert Roberts 2018년 8월 20일
Are you still trying to solve this issue?
Ringo Cheung
Ringo Cheung 2018년 8월 20일
편집: Ringo Cheung 2018년 8월 20일
Hi Robert, Thanks for your comment and finally I used affine3D and imwarp to resolve this issue: First dig out two pieces of information “PixelSpacing” and “SliceThickness” from the DICOM file, then use this information to create an affine3d object. Then define a transform “tform” using this object:
Sx = info.PixelSpacing(1);
Sy = info.PixelSpacing(1);
Sz = info.SliceThickness;
tform = affine3d([Sx 0 0 0; 0 Sy 0 0; 0 0 Sz 0; 0 0 0 1]);
Finally, we complete the transform by applying MATLAB® imwarp function:
I = imwarp(I,tform);
where I is the 3D volume data previously obtained from the 2D slices.
The problem is resolved.
Thanks, Ringo

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Medical Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by