![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1483391/image.png)
Create a new dicom structure in dicom rt file with the contour data from the contour matrix returned from matlab contour() function
4 次查看(过去 30 天)
显示 更早的评论
Does anybody know how to translate the coordinates returned by matlab contour() function to dicom contour data? c is the contour matrix i need to translate into dicom countour data and define as the parameter contours.
[c h]=contour(R);
info = dicominfo("RS_00170.dcm");
contourIn = dicomContours(info);
contourOut = addContour(contourIn,9,'name',contours,'Closed_planar');
info = convertToInfo(contourOut);
dicomwrite([],"RS_00170.dcm",info,CreateMode="copy");
0 个评论
回答(1 个)
Gojo
2023-9-15
I understand that you want to convert the contour matrix into dicom contour data.
The contour matrix consists of two rows and the data is arranged in n sets of contour lines. Here is an example from the documentation of “contour()” function.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1483391/image.png)
You can iterate over this matrix and add the coordinates of the contour lines to the dicom contour.
Create a temporary matrix storing the desired coordinates [x1 y1; x2 y2 …. xn yn] from the contour matrix, and add the matrix to the dicom contour data using the “addContour()” function.
You can refer to the following for more information:
Hope this helps!!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!