Fovia's C++ Client/Server API
Public Member Functions | List of all members
IVolumeSegmentationContext Struct Referenceabstract
Inheritance diagram for IVolumeSegmentationContext:
IRoot

Public Member Functions

virtual signed int ApplyAsLabelVolume (IVolumeDataContext *pDataToApply, signed int bNormalizeValues, signed int minValue, signed int maxValue)=0
 
virtual signed int AskInterface (const BGUID *piid, IRoot **ppr)=0
 
virtual signed int ClearCustomKernel ()=0
 
virtual signed int ClearLabels (signed int labelMask)=0
 
virtual signed int ColorizeTF (IRenderEngineContext *pRenderEngine, int inIndex, int outIndex, int r, int g, int b)=0
 
virtual signed int CombineLabels (signed int inIndex1, signed int inIndex2, signed int outIndex)=0
 
virtual signed int CopyLabel (signed int inIndex, signed int outIndex)=0
 
virtual signed int CustomSegmentationFunction (signed int id, const char *stringParam, IVolumeDataContext *pData, IOctreeContext *pOctree)=0
 
virtual signed int DecRef ()=0
 
virtual signed int DilateOneObject (signed int segLabelIndex, signed int indexToDilate, VECTOR3D origin, signed int count)=0
 
virtual signed int EnableInteractiveSeg (signed long long numRenderEngines, IRenderEngineContext **pArrayOfRenderEnginePtrs)=0
 
virtual signed int ErodeOneObject (signed int segLabelIndex, signed int indexToErode, VECTOR3D origin, signed int count)=0
 
virtual signed int FinishJobSegment (signed long long jobID, signed long long *sizeVoxels, double *sizeMMs)=0
 
virtual signed int FreeHandCut (IRenderEngineContext *pEngine, signed int numPoints, POINT *arrPoints, ENUM_FHC_MODE mode, signed int segLabelIndex, int ppWidth, int ppHeight)=0
 
virtual signed int GetID (signed long long *id)=0
 
virtual signed int GetOctree (IOctreeContext **pOctree)=0
 
virtual signed int IncRef ()=0
 
virtual signed int Initialize (IOctreeContext *pOctree)=0
 
virtual signed int InteractiveSegCancel ()=0
 
virtual signed int InteractiveSegEnd ()=0
 
virtual signed int InteractiveSegInit (SEGMENTATION_PARAMS *pSegParams, signed long long *sizeVoxels, double *sizeMMs)=0
 
virtual signed int InteractiveSegReSegment (SEGMENTATION_PARAMS *pSegParams, signed long long *sizeVoxels, double *sizeMMs)=0
 
virtual signed int LoadCustomKernel (char *dll_path, SEGMENTATION_PARAMS *pSegParams)=0
 
virtual signed int LoadSegStateFromGIPL (char *fileName)=0
 
virtual signed int MakeColorLabeledTFsfromWindowLevel (IRenderEngineContext *pRenderEngine, int windowWidth, int windowLevel)=0
 
virtual signed int MakeColorLabelsFromMainTF (IRenderEngineContext *pRenderEngine)=0
 
virtual signed int MakeTFfromWindowLevel (IRenderEngineContext *pRenderEngine, int index, int windowWidth, int windowLevel, unsigned char startRed, unsigned char startGreen, unsigned char startBlue, unsigned char endRed, unsigned char endGreen, unsigned char endBlue)=0
 
virtual signed int ReleaseSessionResources ()=0
 
virtual signed int SaveForUndo (signed int index, signed int *numLeft)=0
 
virtual signed int SaveSegStateAsGIPL (char *fileName)=0
 
virtual signed int Segment (SEGMENTATION_PARAMS *pSegParams, signed long long *sizeVoxels, double *sizeMMs)=0
 
virtual signed int SetColorizationColors (signed int numColors, signed int *pColors)=0
 
virtual signed int SetSegLabelIndex (signed int labelIndex)=0
 
virtual signed int SetSegLabelMask (unsigned long long labelMasks0to63, unsigned long long labelMasks64to127, unsigned long long labelMasks128to191, unsigned long long labelMasks192to255)=0
 
virtual signed int SetSegType (ENUM_SEG_TYPE segType)=0
 
virtual signed int StartJobSegment (signed long long *jobID, SEGMENTATION_PARAMS *pSegParams)=0
 
virtual signed int SwapLabels (signed int index1, signed int index2)=0
 
virtual signed int UndoLast (signed int *numLeft)=0
 
- Public Member Functions inherited from IRoot
template<class T >
signed int AskInterface (T **pp)
 

Detailed Description

The IVolumeData interface represents a volume data set in memory. This object is created by IServerContext::CreateVolumeSegmentation(). Note that none of the functions on this interface will function correctly until SetVolumeData() has been called.

Member Function Documentation

virtual signed int IVolumeSegmentationContext::ApplyAsLabelVolume ( IVolumeDataContext pDataToApply,
signed int  bNormalizeValues,
signed int  minValue,
signed int  maxValue 
)
pure virtual

This seems to be a legacy colorization method before segmentation was thought of as labels and multi TF's

virtual signed int IVolumeSegmentationContext::AskInterface ( const BGUID piid,
IRoot **  ppr 
)
pure virtual

Queries this object to see if the interface piid is supported and returns the result in ppr.

Parameters
piidThe BGUID of the requested interface.
pprThe address of an IRoot pointer which will receive the new interface.
Returns
S_OK if the interface is supported. E_FAIL if it is not.

Implements IRoot.

virtual signed int IVolumeSegmentationContext::ClearLabels ( signed int  labelMask)
pure virtual

Clear the segmentation info for some labels

Parameters
labelMaskbit mask indicating which labels to clear (e.g. 0x02 will only clear label 1, and 0xff will clear all 8 labels)
virtual signed int IVolumeSegmentationContext::ColorizeTF ( IRenderEngineContext pRenderEngine,
int  inIndex,
int  outIndex,
int  r,
int  g,
int  b 
)
pure virtual

Take a 3D Transfer Function and make it all a solid colr (usefull for visualizing the results of segmentation)

Parameters
renderEnginerenderEngine to change the TFs
inIndexwhich Label TF to use as the shape of the TF
outIndexwhich Label TF to set
rcolor to use
gcolor to use
bcolor to use
virtual signed int IVolumeSegmentationContext::CombineLabels ( signed int  inIndex1,
signed int  inIndex2,
signed int  outIndex 
)
pure virtual

Combine two labels into one using a voxel-wise or operation

Parameters
inIndex1first label to combine
inIndex2second label to combine
outIndexlabel to place the result in (note it can be the same as one of the input labels)
virtual signed int IVolumeSegmentationContext::CopyLabel ( signed int  inIndex,
signed int  outIndex 
)
pure virtual

Copy one label to another

Parameters
inIndexlabel to copy from
outIndexlabel to copy to
virtual signed int IVolumeSegmentationContext::CustomSegmentationFunction ( signed int  id,
const char *  stringParam,
IVolumeDataContext pData,
IOctreeContext pOctree 
)
pure virtual

Placeholder for ()

virtual signed int IVolumeSegmentationContext::DecRef ( )
pure virtual

Decreases the reference count on this object by 1. If the reference count reaches 0, the object is deallocated.

Implements IRoot.

virtual signed int IVolumeSegmentationContext::DilateOneObject ( signed int  segLabelIndex,
signed int  indexToDilate,
VECTOR3D  origin,
signed int  count 
)
pure virtual

Dilate one connected component

Parameters
SegLabelIndexIndex of which Label to segment into
indexToDilateIndex of which Label to Dilate
originpoint inside the one connected component to Dilate (Note the "closest surface to this point will be dilated even if it is a "hole" insidea an object and not the object "outside" surface
countnumber of layers to add to the outside
virtual signed int IVolumeSegmentationContext::EnableInteractiveSeg ( signed long long  numRenderEngines,
IRenderEngineContext **  pArrayOfRenderEnginePtrs 
)
pure virtual

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.

Parameters
numRenderEnginesnumber of renderEngines in the array
pArrayOfRenderEnginePtrspointer to an array of renderEngine pointers
virtual signed int IVolumeSegmentationContext::ErodeOneObject ( signed int  segLabelIndex,
signed int  indexToErode,
VECTOR3D  origin,
signed int  count 
)
pure virtual

Erode one connected component

Parameters
SegLabelIndexIndex of which Label to segment into
indexToErodeIndex of which Label to Erode
originpoint 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
countnumber of layers to take off from the outside
virtual signed int IVolumeSegmentationContext::FinishJobSegment ( signed long long  jobID,
signed long long *  sizeVoxels,
double *  sizeMMs 
)
pure virtual

Placeholder for ()

virtual signed int IVolumeSegmentationContext::FreeHandCut ( IRenderEngineContext pEngine,
signed int  numPoints,
POINT arrPoints,
ENUM_FHC_MODE  mode,
signed int  segLabelIndex,
int  ppWidth,
int  ppHeight 
)
pure virtual

Cut a section of the data using a polygon specified by the POINT array. Note that Seg_Prams do not effect this.

Parameters
pEngineThe engine that is using the data set we're cutting.
numPointsNumber of points in our selection polygon.
arrPointsPoints in the polygon.
modeMethod to assign voxels to new index.
segLabelIndexIndex of which Label to segment into
widthWidth in pixels of the current projection plane.
heightHeight in pixels of the current projection plane.
virtual signed int IVolumeSegmentationContext::GetID ( signed long long *  id)
pure virtual

Integer that represents the server side object that contains the volume data.

virtual signed int IVolumeSegmentationContext::GetOctree ( IOctreeContext **  pOctree)
pure virtual

Gets the IVolumeOctreeContext object associated with the class.

Parameters
pOctreeA pointer address to recieve the octree reference.
virtual signed int IVolumeSegmentationContext::IncRef ( )
pure virtual

Increases the reference count on this object by 1. You do not need to call this after an object is first created. It is 1 by default.

Implements IRoot.

virtual signed int IVolumeSegmentationContext::Initialize ( IOctreeContext pOctree)
pure virtual

Initializes the class. This function must be called before other class functions can be used.

Parameters
pOctreePointer to the IOctreeContext assoicated with the volume that will be segmented.
segParamspointer to a SEGMENTATOIN_PARAMS data structure that will be initialized to default values.
virtual signed int IVolumeSegmentationContext::InteractiveSegCancel ( )
pure virtual

End the current "cycle", the last segmentation is dropped and the persistent seg state remains unaltered from this cycle

virtual signed int IVolumeSegmentationContext::InteractiveSegEnd ( )
pure virtual

End the current "cycle", the last segmentation from m_workingLabel is "or"-ed over to the SegLabelIndex

virtual signed int IVolumeSegmentationContext::InteractiveSegInit ( SEGMENTATION_PARAMS pSegParams,
signed long long *  sizeVoxels,
double *  sizeMMs 
)
pure virtual

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
segParamspointer to a SEGMENTATION_PARAMS data structure that will be used for the first Segmentation
sizeVoxelsreturn value of the size of the segmented region (in voxels)
sizeMMsreturn value of the size of the segmented region (in cubic millimeters)
virtual signed int IVolumeSegmentationContext::InteractiveSegReSegment ( SEGMENTATION_PARAMS pSegParams,
signed long long *  sizeVoxels,
double *  sizeMMs 
)
pure virtual

During a "cycle", this is called for each subsequent segment with new parameters into m_workingLabel

Parameters
segParamspointer to a SEGMENTATION_PARAMS data structure that will be used for the next Segmentation
sizeVoxelsreturn value of the size of the segmented region (in voxels)
sizeMMsreturn value of the size of the segmented region (in cubic millimeters)
virtual signed int IVolumeSegmentationContext::LoadCustomKernel ( char *  dll_path,
SEGMENTATION_PARAMS pSegParams 
)
pure virtual

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
dll_pathThe fully (or relative) qualified path to the dll file including extension
segParamsFor access to the customParamsPtr and size
virtual signed int IVolumeSegmentationContext::LoadSegStateFromGIPL ( char *  fileName)
pure virtual

Load the label Volume (segmentation state) from disk .gipl format on the server

Parameters
fileNamefile (either fully qualified or relative. Also with extension) to load (on server)
virtual signed int IVolumeSegmentationContext::MakeColorLabeledTFsfromWindowLevel ( IRenderEngineContext pRenderEngine,
int  windowWidth,
int  windowLevel 
)
pure virtual

Fill in the upper TF's with colorized version of the W/L TF

Parameters
renderEnginerenderEngine to change the TFs
windowWidthWindow Width in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)
windowLevelWindow Level in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)
virtual signed int IVolumeSegmentationContext::MakeColorLabelsFromMainTF ( IRenderEngineContext pRenderEngine)
pure virtual

Fill in the upper TF's with colorized version of the main (0) transfer function

Parameters
renderEnginerenderEngine to change the TFs
virtual signed int IVolumeSegmentationContext::MakeTFfromWindowLevel ( IRenderEngineContext pRenderEngine,
int  index,
int  windowWidth,
int  windowLevel,
unsigned char  startRed,
unsigned char  startGreen,
unsigned char  startBlue,
unsigned char  endRed,
unsigned char  endGreen,
unsigned char  endBlue 
)
pure virtual

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 which 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
renderEnginerenderEngine to change the TFs
indexwhich Label TF to set
windowWidthWindow Width in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)
windowLevelWindow Level in Volume Values as stored in the file (e.g. for CT, the HU values are converted using DICOM rescale intercept and scale)
startRedcolor to use for the minimum window value
startGreencolor to use for the minimum window value
startBluecolor to use for the minimum window value
endRedcolor to use for the maximum window value
endGreencolor to use for the maximum window value
endBluecolor to use for the maximum window value
virtual signed int IVolumeSegmentationContext::ReleaseSessionResources ( )
pure virtual

Call this if you wish to free up server resources for this object before disconnecting.

virtual signed int IVolumeSegmentationContext::SaveForUndo ( signed int  index,
signed int *  numLeft 
)
pure virtual

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
indexWhich label to save
numLeftThe number of undo operations possible after adding this one
virtual signed int IVolumeSegmentationContext::SaveSegStateAsGIPL ( char *  fileName)
pure virtual

Save the label Volume (segmentation state) to disk in .gipl format on the server

Parameters
fileNamefile (either fully qualified or relative. Also with extension) to save (on server)
virtual signed int IVolumeSegmentationContext::Segment ( SEGMENTATION_PARAMS pSegParams,
signed long long *  sizeVoxels,
double *  sizeMMs 
)
pure virtual

Perform the Segmentation (Synchronous, especially becuase you don't want to be rendering while segmenting)

Parameters
pSegParamspointer to a SEGMENTATOIN_PARAMS data structure that will be applied before segmenting
sizeVoxelsreturn value of the size of the segmented region (in voxels)
sizeMMsreturn value of the size of the segmented region (in cubic millimeters)
virtual signed int IVolumeSegmentationContext::SetColorizationColors ( signed int  numColors,
signed int *  pColors 
)
pure virtual

This seems to be a legacy colorization method before segmentation was thought of as labels and multi TF's

virtual signed int IVolumeSegmentationContext::SetSegLabelIndex ( signed int  labelIndex)
pure virtual

Set the label for segmetnation output (the label value to segment into)

Parameters
labelIndexthe labele index value to segment into (defaults to 1)
virtual signed int IVolumeSegmentationContext::SetSegLabelMask ( unsigned long long  labelMasks0to63,
unsigned long long  labelMasks64to127,
unsigned long long  labelMasks128to191,
unsigned long long  labelMasks192to255 
)
pure virtual

Set the mask of labels that segmentation will grow through

Parameters
labelMasksArray of 4 64 bit masks (for up to 256 masks, if 8TF, then only use first 8 its of array[0]) (defaults to 0xfff...)
virtual signed int IVolumeSegmentationContext::SetSegType ( ENUM_SEG_TYPE  segType)
pure virtual

Set the type of segmentation (additive or subtractive)

Parameters
m_SegTypeenum ST_ADDITIVE or ST_SUBTRACTIVE (defaults to additive)
virtual signed int IVolumeSegmentationContext::StartJobSegment ( signed long long *  jobID,
SEGMENTATION_PARAMS pSegParams 
)
pure virtual

Placeholder for ()

virtual signed int IVolumeSegmentationContext::SwapLabels ( signed int  index1,
signed int  index2 
)
pure virtual

Swap contents of two labels

Parameters
index1first label to swap
index2second label to swap
virtual signed int IVolumeSegmentationContext::UndoLast ( signed int *  numLeft)
pure virtual

Undo the last "operation" (internally a ring buffer of 10 undo's are stored, so only the last 10 can be undone)

Parameters
numLeftThe number of undo operations possible after removing this one