Class AlgorithmExtractSurfaceCubes

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmExtractSurfaceCubes
    extends AlgorithmBase
    Extracts a surface using Marching Cube Extraction. Triangle decimation can be invoked to reduce triangle count. The decimation algorithm produces a continuous level of detail (clod) structure that can be used to optimize the the visualization of the surface. The input to this algorithm is typically a mask image where 0 = background and 100 = object (i.e. interior to a VOI). The mask image is then blurred slightly and the level (50) is extracted. A greyscale image may also be input and a surface is extracted given a level. The steps are:
    1. Build mask image of VOI (i.e. all point interior to VOI are set to 100. All points exterior are = 0.
    2. Blur mask image if not grey-scale
    3. Extract level surface at 50 or user defined level
    4. Save surface ( ".sur")
    5. If decimate then decimate surface and save (".sur")
    Version:
    0.1 June, 2001
    Author:
    Matthew J. McAuliffe, Ph.D., David H. Eberly, Ph.D. wrote all the extraction and decimation code found in the SurfaceExtraction, SurfaceDecimation and associated classes, with a little input from Matt with speed and memory optimizations
    See Also:
    ModelSurfaceExtractor, ModelSurfaceDecimator
    • Field Detail

      • MASK_MODE

        public static final int MASK_MODE
        Extract surface from mask image.
        See Also:
        Constant Field Values
      • LEVEL_MODE

        public static final int LEVEL_MODE
        Extract surface based on intensity level.
        See Also:
        Constant Field Values
      • NONE_MODE

        public static final int NONE_MODE
        Do not perform triangle consistency checking - all counter clockwise or all clockwise.
        See Also:
        Constant Field Values
      • ADJ_MODE

        public static final int ADJ_MODE
        Use adjacency model to perform triangle consistency.
        See Also:
        Constant Field Values
      • SMOOTH_MODE

        public static final int SMOOTH_MODE
        Use smoothing model to perform triangle consistency. Smooths normals.
        See Also:
        Constant Field Values
      • blurFlag

        private final boolean blurFlag
        If true then the input image is blurred slightly.
      • blurSigma

        private float blurSigma
        The amount to blur to smooth surface.
      • decimateFlag

        private final boolean decimateFlag
        If true then the extracted surface is decimated into a continuous level of detail surface (clod).
      • level

        private final int level
        Indicates level surface to be extracted.
      • maskImage

        private ModelImage maskImage
        Mask image to extract surface from.
      • mode

        private final int mode
        Indicates mode - VOI, LEVELSET, or MASK.
      • surfaceFileName

        private java.lang.String surfaceFileName
        Path and name of extracted surface file. ".sur" will be appended if necessary.
    • Constructor Detail

      • AlgorithmExtractSurfaceCubes

        public AlgorithmExtractSurfaceCubes​(ModelImage image,
                                            int level,
                                            int mode,
                                            boolean decFlag,
                                            boolean blurFlag,
                                            float sigma,
                                            java.lang.String fileName)
        Creates a new AlgorithmExtractSurfaceCubes object.
        Parameters:
        image - mask image or gray-scale where a level surface is to be extracted
        level - indicates level surface to be extracted
        mode - Indicates mode - VOI, LEVELSET, or MASK.
        decFlag - indicates whether or not the decimation into a CLOD should take place.
        blurFlag - if true then the input image is blurred slightly
        sigma - the amount to blur the image
        fileName - path and name of extracted surface file. ".sur" will be appended if necessary.
        smoothFlag - whether the generated mesh should have smoothing applied to it
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • extractSurface

        private void extractSurface()
        Extracts a surface, in the form of triangles, from an image.
      • init

        private void init()
        DOCUMENT ME!