How to replace 0s between 1s with 1s "filling in" meshgrid-derived XYZ matrices?

조회 수: 1 (최근 30일)
Daniel Bridges
Daniel Bridges 2016년 7월 8일
답변: KSSV 2016년 7월 12일
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:
  1. how to fill a column with 1's between two specific values and with 0 otherwise?
  2. [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
José-Luis
José-Luis 2016년 7월 8일
Would you be happy assuming your organ is convex?
Daniel Bridges
Daniel Bridges 2016년 7월 12일
I want to access all the points corresponding to the interior of that volume and the points on its surface in a corresponding matrix containing dose. My thinking is that if I can use a same-sized meshgrid with all the points on surface & interior being 1, otherwise 0, then I can achieve this through element-wise matrix multiplication.
I am trying to avoid assumptions, since ideally the program should be robust to work with any structure. Moreover, structures may be complicated (e.g. a mixture of concave and convex) as their shape is a function of both anatomy and disease-spread.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2016년 7월 12일

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by