简体   繁体   中英

Reading DICOM-RT files to create 3D binary matrix?

I'm currently working with DICOM-RT files (which contain DICOM along with dose delivery data and structure set files). I'm mainly interested in the "structure set" file (ie RTSS.dcm), which contains the set of contour points for an ROI of interest. In particular, the contour points surround a tumor volume. For instance, a tumor would have a set of 5 contours, each contour being a set of points that encircle that slice of the tumor.

I'm trying to use MatLab to use these contour points to construct a tumor volume in a binary 3D matrix (0 = nontumor, 1=tumor), and need help.

One possible approach is to fill each contour set as a binary slice, then interpolate the volume between slices. So far I've used the fill or patch function to create binary cross-sections of each contour slice, but I'm having difficulty figuring out how to interpolate these binary slices into a 3D volume. None of the built-in functions appear to apply to this particular problem (although maybe I'm just using them wrong?). A simple linear interpolation doesn't seem appropriate either, since the edges of one contour should blend into the adjacent contour in all directions.

Another option would be to take the points and tesselate them (without making slices first). However, I don't know how to make MatLab only tesselate the surface of the tumor and not intersecting the tumor volume. Currently it seems to find triangles within the tumor. If I could get it into just a surface, I'm not sure how to take that and convert it into a binary 3D matrix volume either.

Does anyone have experience with either 3D slice interpolation OR tesselation techniques that might apply here? Or perhaps any relevant toolkits that exist? I'm stuck... :(

I'm open to approaches in other languages as well: I'm somewhat familiar with C# and Python, although I assumed MatLab would handle the matrix operations a little easier.

Thanks in advance!

I'm not sure from what program you're exporting your dicom-rt structure files, but I believe I found a more elegant solution for you, already described in an open-source software (GDCM, CMake, ITK) in an Insight journal article.

I was discussing a similar problem with one of our physicists, and we saw your solution. It's fine if whatever structure you're attempting to binarize has no concavities, but if so, they'll be rendered inaccurately.

This method is verified for dicom-rt structure sets from Eclipse and Masterplan. Hope it helps.

http://www.midasjournal.org/download/viewpdf/701/4

I think I found an answer in another post ( here ). Rather than trying to interpolate the "missing slices" between the defined contours, treating the contour points as a point cloud and finding the convex hull might be a more efficient way of doing it. This method created the binary 3D volume that I was after.

Here is the code I used, hope it might be helpful to those who need to work with DICOM-RT files:


    function mask = DicomRT2BinaryVol(file)
    points = abs(getContourPoints(file));

    %%NOTE: The getContourPoints function simply reads the file using
    %%'dicominfo' method and organizes the contour points into an n-by-3
    %%matrix, each column being the X,Y,Z coordinates.

    DT = DelaunayTri(points);
    [X,Y,Z] = meshgrid(1:50,1:50,1:50);
    simplexIndex = pointLocation(DT, X(:), Y(:), Z(:));
    mask = ~isnan(simplexIndex);
    mask = reshape(mask,size(X));
    end

This method is a slightly modified version of the method posted by @gnovice in the link above.

iTk是一个出色的图书馆: http//www.itk.org/ HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM