The `buildSurface` action uses the marching cubes algorithm to create a 3D surface from a 3D biomedical image. It generates two output tables: one for the vertices of the surface and another for the faces (triangles) that connect these vertices. This is essential for visualizing and analyzing anatomical structures, such as organs or tumors, from medical scans like CT or MRI.
| Parameter | Description |
|---|---|
| images | Specifies the input table that contains the 3D biomedical image data to process. |
| outputFaces | Specifies the output table to store the faces (triangles) of the generated 3D surface. |
| outputVertices | Specifies the output table to store the vertices of the generated 3D surface. |
| intensities | A list of intensity values (isovalues) for which to generate surfaces. Use this for creating surfaces at specific, discrete density levels. |
| thresholds | A list of value ranges (low and high thresholds) to define regions for surface generation. Use this for creating surfaces around a range of densities. |
| smoothing | Specifies parameters to smooth the generated surface, reducing jaggedness. Includes `iterations` and `relaxationFactor`. |
Before building a surface, we first need to load 3D medical image data. This example uses the `loadDicomData` action to load a series of DICOM files from a specified path into a CAS table. This table will then serve as the input for the `buildSurface` action.
| 1 | |
| 2 | PROC CAS; |
| 3 | |
| 4 | SESSION casauto; |
| 5 | ACTION bioMedImage.loadDicomData / path='path/to/dicom/folder' casout={name='heart_ct_scans', replace=true}; |
| 6 | |
| 7 | RUN; |
| 8 |
This example demonstrates the simplest way to use the `buildSurface` action. It generates a 3D surface from the `heart_ct_scans` table based on a single intensity value of 1200. The resulting vertices and faces are stored in `heart_vertices` and `heart_faces` tables, respectively.
| 1 | |
| 2 | PROC CAS; |
| 3 | bioMedImage.buildSurface / images={TABLE={name='heart_ct_scans'}} outputVertices={name='heart_vertices', replace=true} outputFaces={name='heart_faces', replace=true} intensities={1200}; |
| 4 | |
| 5 | RUN; |
| 6 |
This example builds a surface for a region defined by a range of intensity values (from 800 to 1500). Additionally, it applies a smoothing algorithm over 5 iterations with a relaxation factor of 0.5 to produce a less jagged, more visually appealing surface. This is useful for modeling tissues that don't have a single, uniform density.
| 1 | |
| 2 | PROC CAS; |
| 3 | bioMedImage.buildSurface / images={TABLE={name='heart_ct_scans'}} outputVertices={name='smooth_heart_vertices', replace=true} outputFaces={name='smooth_heart_faces', replace=true} thresholds={{low=800, high=1500}} smoothing={iterations=5, relaxationFactor=0.5}; |
| 4 | |
| 5 | RUN; |
| 6 |