CortidQCT  1.2.2.52
Classes | Macros
CortidQCT.h File Reference

This file contains the C API definition. More...

#include <stddef.h>
Include dependency graph for CortidQCT.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CQCT_VoxelVolumeSize
 VoxelVolume size. More...
 
struct  CQCT_VoxelVolumeVoxelSize
 VoxelVolume voxel size. More...
 
struct  CQCT_BarycentricPoint_t
 Barycentric point type. More...
 
struct  CQCT_Ray_t
 Ray type. More...
 
struct  CQCT_RayMeshIntersection
 

Typedefs

Custom Color To Label Map
typedef struct CQCT_ColorToLabelMap_tCQCT_ColorToLabelMap
 ColorToLabelMap handle type.
 

Functions

ColorToLabelMap object type
CQCT_EXTERN CQCT_ColorToLabelMap CQCT_createColorToLabelMap ()
 Creates a default color to label map.
 
CQCT_EXTERN int CQCT_colorToLabelMapLoadFromFile (CQCT_ColorToLabelMap map, const char *filename, CQCT_Error *error)
 Loads the mapping from YAML file.
 
CQCT_EXTERN size_t CQCT_colorToLabelMapEntryCount (CQCT_ColorToLabelMap map)
 Returns number of entries of the map.
 
CQCT_EXTERN size_t CQCT_colorToLabelMapCopyEntries (CQCT_ColorToLabelMap map, unsigned int **bufferPtr)
 Copies the entries of the map into the given buffer. More...
 
CQCT_EXTERN void CQCT_colorToLabelMapSetEntries (CQCT_ColorToLabelMap map, size_t count, const unsigned int *entries)
 Sets the entries of the mapping.
 
MeshFitter object type
CQCT_EXTERN CQCT_MeshFitter CQCT_createMeshFitter (const char *filename, CQCT_Error *error)
 Creates a mesh fitter given the configuration file.
 
CQCT_EXTERN CQCT_MeshFitterResult CQCT_meshFitterFit (CQCT_MeshFitter meshFitter, CQCT_VoxelVolume volume)
 Fits the reference mesh to the given voxel volume.
 
CQCT_EXTERN int CQCT_meshFitterFitOneIteration (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs one iteration of the fitting algorithm.
 
CQCT_EXTERN int CQCT_meshFitterVolumeSamplingStep (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs the volume sampling step.
 
CQCT_EXTERN int CQCT_meshFitterOptimalDisplacementStep (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs the displacement optimization step.
 
CQCT_EXTERN int CQCT_meshFitterOptimalDeformationStep (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs the deformation optimization step.
 
CQCT_EXTERN int CQCT_meshFitterLogLikelihoodStep (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs the log likelihood computation step.
 
CQCT_EXTERN int CQCT_meshFitterConvergenceTestStep (CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
 Runs the convergence testing step.
 

Generic Functions / Object Type

typedef void * Id
 Generic 'object' type.
 
CQCT_EXTERN Id CQCT_retain (Id obj)
 Retains an object, i.e. increments its retain count.
 
CQCT_EXTERN void CQCT_release (Id obj)
 
CQCT_EXTERN Id CQCT_autorelease (Id obj)
 
CQCT_EXTERN void CQCT_autoreleasePoolPush ()
 Adds a new autorelease pool to the stack.
 
CQCT_EXTERN void CQCT_autoreleasePoolPop ()
 

Error type

enum  CQCT_ErrorId {
  CQCT_ErrorId_Unknown, CQCT_ErrorId_InvalidArgument, CQCT_ErrorId_OutOfRange, CQCT_ErrorId_Unknown,
  CQCT_ErrorId_InvalidArgument
}
 Error types/Ids.
 
typedef struct CQCT_Error_tCQCT_Error
 Error type.
 
CQCT_EXTERN CQCT_Error CQCT_createError (enum CQCT_ErrorId id, const char *message)
 Creates an error object.
 
CQCT_EXTERN enum CQCT_ErrorId CQCT_errorType (CQCT_Error error)
 Returns the error id.
 
CQCT_EXTERN const char * CQCT_errorMessage (CQCT_Error error)
 Returns the error message.
 

VoxelVolume type

typedef struct CQCT_VoxelVolume_tCQCT_VoxelVolume
 Voxel volume handle type.
 
CQCT_EXTERN CQCT_VoxelVolume CQCT_createVoxelVolume ()
 Creates an empty voxel volume.
 
CQCT_EXTERN int CQCT_voxelVolumeLoadFromFile (CQCT_VoxelVolume volume, const char *filename, CQCT_Error *error)
 Loads the voxel volume from file.
 
CQCT_EXTERN CQCT_VoxelVolumeSize CQCT_voxelVolumeSize (CQCT_VoxelVolume volume)
 Returns the size of the voxel volume.
 
CQCT_EXTERN CQCT_VoxelVolumeVoxelSize CQCT_voxelVolumeVoxelSize (CQCT_VoxelVolume volume)
 Returns the size of a voxel.
 
CQCT_EXTERN size_t CQCT_voxelVolumeCopyVoxels (CQCT_VoxelVolume volume, float **buffer)
 Copies the voxel data to the given buffer.
 

Mesh type

typedef struct CQCT_Mesh_tCQCT_Mesh
 Mesh handle type.
 
typedef struct CQCT_BarycentricPoint_t CQCT_BarycentricPoint
 
typedef struct CQCT_Ray_t CQCT_Ray
 
typedef struct CQCT_RayMeshIntersection CQCT_RayMeshIntersection
 
CQCT_EXTERN CQCT_Mesh CQCT_createMesh ()
 Creates an empty mesh.
 
CQCT_EXTERN CQCT_Mesh CQCT_createMeshAndAllocateMemory (size_t nVertices, size_t nTriangles, CQCT_Error *error)
 Creates an mesh and reserve space for vertices and indices. More...
 
CQCT_EXTERN CQCT_Mesh CQCT_meshFromFile (const char *filename, CQCT_Error *error)
 Creates and loads a mesh from file. More...
 
CQCT_EXTERN CQCT_Mesh CQCT_meshFromFileWithCustomMapping (const char *filename, CQCT_ColorToLabelMap map, CQCT_Error *error)
 Creates and loads a mesh from file using the given custom color to label mapping. More...
 
CQCT_EXTERN CQCT_Mesh CQCT_meshAndLabelsFromFile (const char *meshFilename, const char *labelFilename, CQCT_Error *error)
 Creates and loads a mesh from a mesh and a label file. More...
 
CQCT_EXTERN int CQCT_loadMesh (CQCT_Mesh mesh, const char *filename, CQCT_Error *error)
 Loads a mesh from file.
 
CQCT_EXTERN int CQCT_loadMeshWithCustomMapping (CQCT_Mesh mesh, const char *filename, CQCT_ColorToLabelMap map, CQCT_Error *error)
 Loads a mesh from file using a custom color to label map.
 
CQCT_EXTERN int CQCT_loadMeshAndLabels (CQCT_Mesh mesh, const char *meshFilename, const char *labelFilename, CQCT_Error *error)
 Loads a mesh from mesh and label file.
 
CQCT_EXTERN int CQCT_meshAndLabelsWriteToFile (CQCT_Mesh mesh, const char *meshFilename, const char *labelsFilename, CQCT_Error *error)
 Writes mesh and labels to seperate files.
 
CQCT_EXTERN size_t CQCT_meshVertexCount (CQCT_Mesh mesh)
 Return number of vertices of the given mesh.
 
CQCT_EXTERN size_t CQCT_meshTriangleCount (CQCT_Mesh mesh)
 Return number of triangles of the given mesh.
 
CQCT_EXTERN size_t CQCT_meshCopyVertices (CQCT_Mesh mesh, float **bufferPtr)
 Copies the mesh's vertices into the given buffer. More...
 
CQCT_EXTERN void CQCT_meshSetVertices (CQCT_Mesh mesh, float const *buffer)
 Copies the vertices from the given buffer into the mesh data structure. More...
 
CQCT_EXTERN size_t CQCT_meshCopyVertexNormals (CQCT_Mesh mesh, float **bufferPtr)
 Copies the mesh's per-vertex normals into the given buffer. More...
 
CQCT_EXTERN void CQCT_meshSetVertexNormals (CQCT_Mesh mesh, float const *buffer)
 Copies the per-vertex normals from the given buffer into the mesh data structure. More...
 
CQCT_EXTERN size_t CQCT_meshCopyTriangles (CQCT_Mesh mesh, ptrdiff_t **bufferPtr)
 Copies the mesh's indices into the given buffer. More...
 
CQCT_EXTERN void CQCT_meshSetTriangles (CQCT_Mesh mesh, ptrdiff_t const *buffer)
 Copies the triangle indices from the given buffer into the mesh data structure. More...
 
CQCT_EXTERN size_t CQCT_meshCopyLabels (CQCT_Mesh mesh, unsigned int **bufferPtr)
 Copies the mesh's labels into the given buffer. More...
 
CQCT_EXTERN void CQCT_meshSetLabels (CQCT_Mesh mesh, unsigned int const *buffer)
 Copies the vertex labels from the given buffer into the mesh data structure. More...
 
CQCT_EXTERN int CQCT_meshBarycentricToCartesian (CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints, float **bufferPtr, CQCT_Error *error)
 Converts the given list of barycentric points in cartesian coordinates. More...
 
CQCT_EXTERN int CQCT_meshBarycentricInterpolation (CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints, float const *attributePtr, size_t attributeDimensions, float **bufferPtr, CQCT_Error *error)
 Interpolates attribute values given at mesh vertices at arbitrary points on the surface of the mesh. More...
 
CQCT_EXTERN size_t CQCT_meshRayIntersections (CQCT_Mesh mesh, CQCT_Ray *raysPtr, size_t nRays, CQCT_RayMeshIntersection **intersectionsOutPtr)
 Computes the intersection of a set of rays with the mesh. More...
 
CQCT_EXTERN void CQCT_meshUpsample (CQCT_Mesh mesh, size_t nTimes)
 Upsamples the given mesh nTimes without touchting the original vertices. More...
 
CQCT_EXTERN void CQCT_meshUpdatePerVertexNormals (CQCT_Mesh mesh)
 Re-computes per-vertex normals. More...
 

MeshFitterState object type

typedef struct CQCT_MeshFitter_tCQCT_MeshFitter
 Mesh fitter handle type.
 
typedef struct CQCT_MeshFitterState_tCQCT_MeshFitterState
 Mesh fitter state handle type.
 
typedef CQCT_MeshFitterState CQCT_MeshFitterResult
 Mesh fitter result object.
 
CQCT_EXTERN CQCT_MeshFitterState CQCT_createMeshFitterState (CQCT_MeshFitter fitter, CQCT_VoxelVolume volume)
 Creates an MeshFitter optimization state object.
 
CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultReferenceMesh (CQCT_MeshFitterResult result)
 Returns the result reference mesh.
 
CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultMesh (CQCT_MeshFitterResult result)
 Returns the result mesh.
 
CQCT_EXTERN size_t CQCT_meshFitterResultCopyDisplacementVector (CQCT_MeshFitterResult result, float **buffer)
 Copies the displacement vector.
 
CQCT_EXTERN void CQCT_meshFitterResultSetDisplacementVector (CQCT_MeshFitterResult result, float const *buffer)
 Sets the displacement vector.
 
CQCT_EXTERN size_t CQCT_meshFitterResultCopyWeights (CQCT_MeshFitterResult result, float **buffer)
 Copies the weight vector.
 
CQCT_EXTERN void CQCT_meshFitterResultSetWeights (CQCT_MeshFitterResult result, float const *buffer)
 Sets the weight vector.
 
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVertexNormals (CQCT_MeshFitterResult result, float **buffer) __attribute__((deprecated("Use normals stored in deformedMesh instead.")))
 
CQCT_EXTERN size_t CQCT_meshFitterResultVolumeSamplingPositionsCount (CQCT_MeshFitterResult result)
 Returns the number of volume sampling positions.
 
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamplingPositions (CQCT_MeshFitterResult result, float **buffer)
 Copies the volume sampling positions.
 
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamples (CQCT_MeshFitterResult result, float **buffer)
 Copies the volume samples.
 
CQCT_EXTERN float CQCT_meshFitterResultMinimumDisplacementNorm (CQCT_MeshFitterResult result)
 Returns the minimum norm of the displacement vector.
 
CQCT_EXTERN float CQCT_meshFitterResultLogLikelihood (CQCT_MeshFitterResult result)
 Returns the current log likelihood of the model given the input volume.
 
CQCT_EXTERN float CQCT_meshFitterResultCopyPerVertexLogLikelihood (CQCT_MeshFitterResult result, float **buffer)
 
CQCT_EXTERN void CQCT_meshFitterResultSetLogLikelihood (CQCT_MeshFitterResult result, float ll)
 Sets the current log likelihood of the model given the input volume.
 
CQCT_EXTERN float CQCT_meshFitterResultEffectiveSigmaS (CQCT_MeshFitterResult result)
 Returns the current effective sigmaS (after applying decay)
 
CQCT_EXTERN size_t CQCT_meshFitterResultIterationCount (CQCT_MeshFitterResult result)
 Returns the iteration count.
 
CQCT_EXTERN void CQCT_meshFitterResultSetIterationCount (CQCT_MeshFitterResult result, size_t count)
 Sets the iteration count.
 
CQCT_EXTERN int CQCT_meshFitterResultHasConverged (CQCT_MeshFitterResult result)
 Returns whether the optimization has converged.
 
CQCT_EXTERN void CQCT_meshFitterResultSetHasConverged (CQCT_MeshFitterResult result, int converged)
 Sets whether the optimization has converged.
 
CQCT_EXTERN int CQCT_meshFitterResultSuccess (CQCT_MeshFitterResult result)
 Returns whether the optimization was successfull.
 
CQCT_EXTERN void CQCT_meshFitterResultSetSuccess (CQCT_MeshFitterResult result, int success)
 Sets whether the optimization was successfull.
 
CQCT_EXTERN size_t CQCT_meshFitterResultNonDecreasingCount (CQCT_MeshFitterResult result)
 Returns the current non decreasing count.
 
CQCT_EXTERN void CQCT_meshFitterResultSetNonDecreasingCount (CQCT_MeshFitterResult result, size_t count)
 Sets the current non decreasing count.
 
CQCT_EXTERN size_t CQCT_meshFitterStateCopyModelSamplingPositions (CQCT_MeshFitterState state, float **buffer)
 Copies the model sampling positions.
 

Detailed Description

This file contains the C API definition.

Author
Stefan Reinhold