Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

matlab - How to create lung volume with my own imageset?

https://www.mathworks.com/help/images/segment-lungs-from-3-d-chest-mri-data.html

It's going to work amazing in that imageset, but when i try to use mine, i dont know what should i do? I'm working with DICOM format but also i can work with the jpeg format, if its going to be problem.

chestVolume thing is a *.mat file. My imageset has bunch of DICOM files (https://yadi.sk/d/YNePxMYfToPgfw) . I can create masks in Image Segmenter for my dataset. But im not sure these code block work with my dicom dataset.

I cannot create XY and XZ slices , And i dont know how to get image spacings from DICOM data.

Can anyone help me with that code to work with my imageset? And if it is possible, i want to make a 3d model from that lungs.

load chestVolume
whos V

V = im2single(V);
XY = V(:,:,160);
XZ = squeeze(V(256,:,:));

figure
imshow(XY,[],'Border','tight');
imshow(XZ,[],'Border','tight');


BW = XY > 5.098000e-01;
BW = imcomplement(BW);
BW = imclearborder(BW);
BW = imfill(BW, 'holes');
radius = 3;
decomposition = 0;
se = strel('disk',radius,decomposition);
BW = imerode(BW, se);
maskedImageXY = XY;
maskedImageXY(~BW) = 0;
imshow(maskedImageXY)

BW = imbinarize(XZ);
BW = imcomplement(BW);
BW = imclearborder(BW);
BW = imfill(BW,'holes');
radius = 13;
decomposition = 0;
se = strel('disk',radius,decomposition);
BW = imerode(BW, se);
maskedImageXZ = XZ;
maskedImageXZ(~BW) = 0;
imshow(maskedImageXZ)

mask = false(size(V));
mask(:,:,160) = maskedImageXY;
mask(256,:,:) = mask(256,:,:)|reshape(maskedImageXZ,[1,512,318]);
V = histeq(V);
BW = activecontour(V,mask,100,'Chan-Vese');

segmentedImage = V.single(BW);
volLungsPixels = regionprops3(logical(BW),'volume');
spacingx = 0.76;
spacingy = 0.76;
spacingz = 1.261e-6;
unitvol = spacingxspacingyspacingz;
volLungs1 = volLungsPixels.Volume(1)unitvol;
volLungs2 = volLungsPixels.Volume(2)unitvol;
volLungsLiters = volLungs1 + volLungs2
question from:https://stackoverflow.com/questions/65641545/how-to-create-lung-volume-with-my-own-imageset

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...