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

조회 수: 2(최근 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:
  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
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.

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


KSSV 2016년 7월 12일


Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by