Options
All
  • Public
Menu

Class VolumeSegmentationContext

volumeSegmentationContext is backed by a native VolumeSegmentationContext, associated with this an Fovia.OctreeContext and one or more Fovia.RenderEngineContext .

Hierarchy

  • VolumeSegmentationContext

Index

Constructors

constructor

  • Constructor for the VolumeSegmentationContext

    Parameters

    • segmentationContextID: number

      Unique segmentation context ID.

    • octree: OctreeContext

    Returns VolumeSegmentationContext

Properties

Private octreeContext

octreeContext: OctreeContext

Private segmentationContextID

segmentationContextID: number

Methods

clearCustomKernel

  • clearCustomKernel(callbackFunc?: any): Promise<Object>
  • Unload the Custom Kenrel DLL and free any memory it used

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

clearLabels

  • clearLabels(labelMask: number, callbackFunc?: any): Promise<Object>
  • Clear the segmentation info for some labels

    @param labelMask bit mask indicating which labels to clear (e.g. 0x01 will only clear
    

    label 0, 0x02 will only clear label 1, and 0xff will clear all 8 labels)

    Parameters

    • labelMask: number
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

colorizeTF

  • colorizeTF(renderEngineContext: RenderEngineContext, inIndex: number, outIndex: number, color: Color, callbackFunc?: any): Promise<Object>
  • Take a 3D Transfer Function and make it all a solid colr (usefull for visualizing the results of segmentation)

    Parameters

    • renderEngineContext: RenderEngineContext
    • inIndex: number

      which Label TF to use as the shape of the TF

    • outIndex: number

      which Label TF to set

    • color: Color
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

combineLabels

  • combineLabels(inIndex1: number, inIndex2: number, outIndex: number, callbackFunc?: any): Promise<Object>
  • Combine two labels int one using a voxel-wise or operation

    Parameters

    • inIndex1: number

      first label to combine

    • inIndex2: number

      second label to combine

    • outIndex: number

      label to place the reult in (note it can be the same as one of the input labels)

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

copyLabel

  • copyLabel(inIndex: number, outIndex: number, callbackFunc?: any): Promise<Object>
  • Copy one label to another

    Parameters

    • inIndex: number

      label to copy from

    • outIndex: number

      label to copy to

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

dilateOneObject

  • dilateOneObject(segLabelIndex: number, indexToDilate: number, origin: Vector, count: number, callbackFunc?: any): Promise<Object>
  • Dilate one connected component

    Parameters

    • segLabelIndex: number

      Index of which Label to segment into

    • indexToDilate: number

      Index of which Label to dilate

    • origin: Vector

      origin point inside the one connected component to dilate (Note the "closest surface to this point will be dilated even if it is a "hole" inside an object and not the object "outside" surface

    • count: number

      number of layers to add to the outside

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

enableInteractiveSeg

  • enableInteractiveSeg(listOfRenderingEngines: Array<RenderEngineContext>, callbackFunc?: any): Promise<Object>
  • Enable Interactive Segmentation. Specifically setup the render engines that will be rendering the results so that TF can be adjusted for subtractive and other things. AS well as set flag for some things that happen automatically inside (e.g. make the working label hte same TF as the seg Label)

    Parameters

    • listOfRenderingEngines: Array<RenderEngineContext>

      render engines that are used with this segmentation operation

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

erodeOneObject

  • erodeOneObject(segLabelIndex: number, indexToErode: number, origin: Vector, count: number, callbackFunc?: any): Promise<Object>
  • Erode one connected component

    Parameters

    • segLabelIndex: number

      Index of which Label to segment into

    • indexToErode: number

      Index of which Label to erode

    • origin: Vector

      origin point inside the one connected component to erode (Note the "closest surface to this point will be dilated even if it is a "hole" inside an object and not the object "outside" surface

    • count: number

      number of layers to take off from the outside

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

freeHandCut

  • freeHandCut(renderEngineContext: RenderEngineContext, pointList: Array<Point>, fhcMode: FreeHandCutMode, segLabelIndex: number, ppWidth: number, ppHeight: number, callbackFunc?: any): Promise<Object>

getOctree

  • Return the octree context associated with this object

    Returns OctreeContext

    octree context associated with this object

getSegmentationContextID

  • getSegmentationContextID(): number
  • Return the segmentation context ID associated with this object

    Returns number

    segmentation context ID associated with this object

initialize

  • initialize(callbackFunc?: any): Promise<Object>
  • Initializes the class. This function must be called before other class functions can be used.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

interactiveSegCancel

  • interactiveSegCancel(callbackFunc?: any): Promise<Object>
  • End the current "cycle", the last segmentation is dropped and the persistent seg state remains unaltered from this cycle

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

interactiveSegEnd

  • interactiveSegEnd(callbackFunc?: any): Promise<Object>
  • End the current "cycle", the last segmentation from m_workingLabel is "or"-ed over to the SegLabelIndex

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

interactiveSegInit

  • Start an interactive segmentation "cycle" (Cycle is defined as a sequence of segments where the use adjusts the parameters to get some desired segmentation that is kept only on "End" without "Escape"). The m_workingLabel is used for these intermittent segmentations

    Parameters

    • segmentationParameters: SegmentationParameters

      initial parameters for the segmentation operation

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(data) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , data)

    data.sizeVoxels value of the size of the segmented region (in voxels) data.sizeMMs value of the size of the segmented region (in cubic millimeters)

interactiveSegReSegment

  • interactiveSegReSegment(segmentationParameters: SegmentationParameters, callbackFunc?: any): Promise<Object>
  • During a "cycle", this is called for each subsequent segment with new parameters into m_workingLabel

    Parameters

    • segmentationParameters: SegmentationParameters

      parameters for the segmentation operation

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(data) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , data)

    data.sizeVoxels value of the size of the segmented region (in voxels) data.sizeMMs value of the size of the segmented region (in cubic millimeters)

loadCustomKernel

  • loadCustomKernel(dllPath: string, segmentationParameters: SegmentationParameters, callbackFunc?: any): Promise<Object>
  • The custom Kernel DLL is loaded at runtime since it is unkown at compile time. ALso a buffer for and parameters which will be used is allocated (so we an later copy new parameters in, a copy is kept here locally in case the client is remote). Params can be updated in Segmentation Params for subsequent segmentation calls.

    Parameters

    • dllPath: string

      The fully (or relative) qualifed pathto the dll file including extension

    • segmentationParameters: SegmentationParameters

      uses the customKernelParamArray values

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

loadSegStateFromGIPL

  • loadSegStateFromGIPL(giplServerFilename: string, callbackFunc?: any): Promise<Object>
  • Load the label Volume (segmentation state) from disk .gipl format on the server

    Parameters

    • giplServerFilename: string

      file (either fully qualifed or relative. Also with extension) to load (from server)

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

makeColorLabeledTFsfromWindowLevel

  • makeColorLabeledTFsfromWindowLevel(renderEngineContext: RenderEngineContext, windowWidth: number, windowLevel: number, callbackFunc?: any): Promise<Object>
  • Fill in the upper TF's with colorized version of the W/L TF

    Parameters

    • renderEngineContext: RenderEngineContext
    • windowWidth: number

      Window Width in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)

    • windowLevel: number

      Window Level in Volume Values as stroed in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

makeColorLabelsFromMainTF

  • makeColorLabelsFromMainTF(renderEngineContext: RenderEngineContext, callbackFunc?: any): Promise<Object>
  • Fill in the upper TF's with colorized version of hte main (0) transfer function

    Parameters

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

makeTFfromWindowLevel

  • makeTFfromWindowLevel(renderEngineContext: RenderEngineContext, index: number, windowWidth: number, windowLevel: number, startColor: Color, endColor: Color, callbackFunc?: any): Promise<Object>
  • To display segmentation on 2D Thin display we utilize a fully opaque TF with a Parallel render instead of MPR render Type. This function will create that TF. for unsegmented data use (0,0,0) to (255,255,255) to get a TF whihc looks a a W/L display on a normal MPR 2D display. It is suggested for the segmented labels to use (r/2,g/2,b/2) to (r,g,b) for a given color for that label because then you will still see the different shades of the 2D image below the color.

    Parameters

    • renderEngineContext: RenderEngineContext
    • index: number

      which Label TF to set

    • windowWidth: number

      Window Width in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)

    • windowLevel: number

      Window Level in Volume Values as stroed in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)

    • startColor: Color

      color to use for the minimum window value

    • endColor: Color

      color to use for the maximum window value

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

Private printNativeSegmentationParameters

  • Private method for printing the supplied segmentation state from the native code. This is used only for internal debugging purposes

    Parameters

    Returns void

    This is a synchronous method that returns void immediately upon emitted the event.

saveForUndo

  • saveForUndo(labelIndex: number, callbackFunc?: any): Promise<Object>
  • Save the current state as an "operation" (internally a ring buffer of 10 undo's are stored, so only the last 10 can be undone)

    Parameters

    • labelIndex: number

      Which label to save

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(numLeft) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , numLeft)

    numLeft The number of undo operations possible after removing this one

saveSegStateAsGIPL

  • saveSegStateAsGIPL(giplServerFilename: string, callbackFunc?: any): Promise<Object>
  • Save the label Volume (segmentation state) to disk in .gipl format on the server

    Parameters

    • giplServerFilename: string

      file (either fully qualifed or relative. Also with extension) to save (on server)

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

segment

  • Perform the Segmentation, make sure you invoke this method with a Promise or callback so you know when it completes. You should not modify the VolumeSegmentationContext while segmentation is occuring.

    Parameters

    • segmentationParameters: SegmentationParameters

      data structure that will be applied before segmenting

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(data) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , data)

    data.sizeVoxels value of the size of the segmented region (in voxels) data.sizeMMs value of the size of the segmented region (in cubic millimeters)

setSegLabelIndex

  • setSegLabelIndex(labelIndex: number, callbackFunc?: any): Promise<Object>
  • Set the label for segmetnation output (the label value to segment into)

    Parameters

    • labelIndex: number

      the lable index value to segment into (defaults to 1)

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setSegLabelMask

  • setSegLabelMask(labelMasks0to63: number, labelMasks64to127: number, labelMasks128to191: number, labelMasks192to255: number, callbackFunc?: any): Promise<Object>
  • Set the mask of lables that segmentation will grow through

    Parameters

    • labelMasks0to63: number
    • labelMasks64to127: number
    • labelMasks128to191: number
    • labelMasks192to255: number
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setSegType

  • Set the type of segmentation (additive or subtractive)

    Parameters

    • segType: SegmentationType

      specifies either additive or subtractive enum

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

swapLabels

  • swapLabels(index1: number, index2: number, callbackFunc?: any): Promise<Object>
  • Swap contents of two labels

    Parameters

    • index1: number

      first label to swap

    • index2: number

      second label to swap

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

undoLast

  • undoLast(callbackFunc?: any): Promise<Object>
  • Undo the last "operation" (internally a ring buffer of 10 undo's are stored, so only the last 10 can be undone)

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(numLeft) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , numLeft)

    numLeft The number of undo operations possible after removing this one

Generated using TypeDoc