bioMedImage

buildSurface

Description

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.

proc cas; bioMedImage.buildSurface / images={table={name='input_table'}}, outputFaces={name='output_faces_table', replace=true}, outputVertices={name='output_vertices_table', replace=true}, intensities={1000, 1500} | thresholds={{low=800, high=1200}}, smoothing={iterations=5, relaxationFactor=0.5}; run;
Settings
ParameterDescription
imagesSpecifies the input table that contains the 3D biomedical image data to process.
outputFacesSpecifies the output table to store the faces (triangles) of the generated 3D surface.
outputVerticesSpecifies the output table to store the vertices of the generated 3D surface.
intensitiesA list of intensity values (isovalues) for which to generate surfaces. Use this for creating surfaces at specific, discrete density levels.
thresholdsA list of value ranges (low and high thresholds) to define regions for surface generation. Use this for creating surfaces around a range of densities.
smoothingSpecifies parameters to smooth the generated surface, reducing jaggedness. Includes `iterations` and `relaxationFactor`.
Data Preparation View data prep sheet
Data Creation: Loading DICOM Medical Images

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.

Copied!
1 
2PROC CAS;
3 
4SESSION casauto;
5ACTION bioMedImage.loadDicomData / path='path/to/dicom/folder' casout={name='heart_ct_scans', replace=true};
6 
7RUN;
8 

Examples

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3bioMedImage.buildSurface / images={TABLE={name='heart_ct_scans'}} outputVertices={name='heart_vertices', replace=true} outputFaces={name='heart_faces', replace=true} intensities={1200};
4 
5RUN;
6 
Result :
Two new CAS tables, `heart_vertices` and `heart_faces`, are created. These tables contain the geometric data (coordinates and connectivity) for the 3D surface, which can then be used for visualization or further analysis.

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3bioMedImage.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 
5RUN;
6 
Result :
The action creates two tables, `smooth_heart_vertices` and `smooth_heart_faces`. The resulting surface is smoother and represents the structure within the specified intensity range, making it suitable for detailed morphological analysis.

FAQ

What is the primary function of the buildSurface action?
What are the mandatory parameters for the buildSurface action?
How can I define the regions for surface construction?
What options are available for smoothing the generated surfaces?
What information is contained in the output tables?
What is the purpose of the buildSurface action in the BioMedImage action set?
What are the required input and output tables for the buildSurface action?
How can I specify the regions of interest for surface construction?
What options are available for smoothing the generated surface?
What does the 'outputFaces' parameter specify?
What is the function of the 'outputVertices' parameter?