Why does creatMaks have no images

1 次查看(过去 30 天)
This is my code, the function is to generate mask by dicom RT:
info = dicominfo('G:\2024\FillContourFile\rtst2.dcm');
rtContours = dicomContours(info);
rtContours.ROIs
figure
plotContour(rtContours)
dcmFiles = dir('E:\Desktop\pyDemo\pythonProject\150s_masked\*.dcm');
info = dicominfo(fullfile(dcmFiles(1).folder, dcmFiles(1).name));
imageSize = [info.Rows, info.Columns, numel(dcmFiles)];
pixelSpacing = [info.PixelSpacing', info.SliceThickness];
%Here imageSize=[223 406 181],pixelSpacing=[0.5410 0.5410 1.0000]
referenceInfo = imref3d(imageSize,pixelSpacing(1),pixelSpacing(2),pixelSpacing(3));
for i=1:size(rtContours.ROIs,1)
contourIndex = i;
Name = string(rtContours.ROIs{i, 2}{1});
mask = createMask(rtContours, contourIndex, referenceInfo);
size(mask)
volshow(mask);
end

回答(1 个)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU 2024-3-12
Hi 梅花,
The issue with "createMask" producing no images could be due to a spatial mismatch between the RT contours and the DICOM images, or incorrect specifications in "imageSize" or "pixelSpacing'. Ensure the RT contours align with the DICOM series spatially and that "referenceInfo" accurately reflects the image dimensions and resolution. Double-check the contour coordinates and the DICOM series for consistency in anatomical coverage and patient positioning.
If you still face the issue after checking the above, attach the required files for further investigation and debugging.

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by