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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…