How to replace 0s between 1s with 1s "filling in" meshgrid-derived XYZ matrices?
조회 수: 1 (최근 30일)
이전 댓글 표시
DICOM ContourData gives points representing organ structures. (Originally a vector for each slice, [x1 y1 z1 x2 y2 z2 ...], I have created three vectors grouping x y z values.)
figure; scatter3(xcontour,ycontour,zcontour,'.')
>> title('PTV1 DICOM Coordinates')
I have another matrix with RTDOSE values. I have created a meshgrid (X,Y,Z) giving the dose's DICOM coordinates and, I think, derived another matrix from it that changes these PTV1 coordinates into 1s with the empty space between them into 0s:
xcontourpointslocation = ismember(X,xcontour);
ycontourpointslocation = ismember(Y,ycontour);
zcontourpointslocation = ismember(Z,zcontour);
So I think now this figure can be thought to represent in "DICOM space" where those 1s are. If I multiply it by the dose matrix, I expect to thereby " extract" the dose at these locations. Yet I obviously want the dose "inside" the structure as well -- i.e., I must convert all those 0s in xcontourpointslocation etc "between the 1s" into 1s to "fill in" the structure.
What MATLAB commands do this elegantly? I have an idea to use the find command with conditioned loops or for loops, but I expect there to be a simpler way, e.g. a command like makesolid(matrix), because this seems straightforward or commonplace.
While hoping you will tell me such a method, I have found some related discussion:
- how to fill a column with 1's between two specific values and with 0 otherwise?
- [replace with interpolated values] zeros in a [vector]
I will continue working on this problem and post my answer if I solve it before hearing from you.
댓글 수: 3
답변 (1개)
KSSV
2016년 7월 12일
I suggest you to use the below code: http://in.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-automatic-mesh-generation
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 DICOM Format에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!