CortidQCT  1.2.2.52
CortidQCT.h
1 
18 #ifndef CORTIDQCT_MATLAB_BINDINGS_CORTIDQCT_H__
19 # define CORTIDQCT_MATLAB_BINDINGS_CORTIDQCT_H__
20 
21 # ifdef __cplusplus
22 extern "C" {
23 
24 # define CQCT_EXTERN extern "C"
25 # else
26 # define CQCT_EXTERN
27 # endif
28 
29 # include <stddef.h>
30 
31 // MARK: -
32 // MARK: Object Type / Generic Functions
35 
37 typedef void *Id;
38 
40 CQCT_EXTERN Id CQCT_retain(Id obj);
41 
44 CQCT_EXTERN void CQCT_release(Id obj);
45 
48 CQCT_EXTERN Id CQCT_autorelease(Id obj);
49 
51 CQCT_EXTERN void CQCT_autoreleasePoolPush(void);
52 
55 CQCT_EXTERN void CQCT_autoreleasePoolPop(void);
56 
58 
59 // MARK: -
60 // MARK: Error Type
66 enum CQCT_ErrorId { CQCT_ErrorId_Unknown, CQCT_ErrorId_InvalidArgument };
68 
69 struct CQCT_Error_t;
71 typedef struct CQCT_Error_t *CQCT_Error;
72 
74 CQCT_EXTERN CQCT_Error CQCT_createError(enum CQCT_ErrorId id,
75  const char *message);
76 
78 CQCT_EXTERN enum CQCT_ErrorId CQCT_errorType(CQCT_Error error);
79 
81 CQCT_EXTERN const char *CQCT_errorMessage(CQCT_Error error);
82 
84 
85 // MARK: -
86 // MARK: VoxelVolume Type
92 struct CQCT_VoxelVolume_t;
95 
97 CQCT_EXTERN CQCT_VoxelVolume CQCT_createVoxelVolume(void);
98 
100 CQCT_EXTERN int CQCT_voxelVolumeLoadFromFile(CQCT_VoxelVolume volume,
101  const char *filename,
102  CQCT_Error *error);
103 
105 CQCT_EXTERN size_t CQCT_voxelVolumeWidth(CQCT_VoxelVolume volume);
106 
108 CQCT_EXTERN size_t CQCT_voxelVolumeHeight(CQCT_VoxelVolume volume);
109 
111 CQCT_EXTERN size_t CQCT_voxelVolumeDepth(CQCT_VoxelVolume volume);
112 
114 CQCT_EXTERN float CQCT_voxelVolumeVoxelWidth(CQCT_VoxelVolume volume);
115 
117 CQCT_EXTERN float CQCT_voxelVolumeVoxelHeight(CQCT_VoxelVolume volume);
118 
120 CQCT_EXTERN float CQCT_voxelVolumeVoxelDepth(CQCT_VoxelVolume volume);
121 
123 CQCT_EXTERN size_t CQCT_voxelVolumeCopyVoxels(CQCT_VoxelVolume volume,
124  float **buffer);
125 
127 
135 
137 
138 // MARK: -
139 // MARK: Mesh Type
144 struct CQCT_Mesh_t;
146 typedef struct CQCT_Mesh_t *CQCT_Mesh;
147 
150  float u; // first barycentric coordinate
151  float v; // second barycentric coordinate
152  ptrdiff_t triangleIndex; // triangle index
153 };
154 typedef struct CQCT_BarycentricPoint_t CQCT_BarycentricPoint;
155 
157 struct CQCT_Ray_t {
159  float x0, y0, z0;
161  float dx, dy, dz;
162 };
163 typedef struct CQCT_Ray_t CQCT_Ray;
164 
166 CQCT_EXTERN CQCT_Mesh CQCT_createMesh(void);
167 
185 CQCT_EXTERN CQCT_Mesh CQCT_createMeshAndAllocateMemory(size_t nVertices,
186  size_t nTriangles,
187  CQCT_Error *error);
188 
199 CQCT_EXTERN CQCT_Mesh CQCT_meshFromFile(const char *filename,
200  CQCT_Error *error);
201 
214 CQCT_EXTERN CQCT_Mesh CQCT_meshFromFileWithCustomMapping(
215  const char *filename, CQCT_ColorToLabelMap map, CQCT_Error *error);
216 
228 CQCT_EXTERN CQCT_Mesh CQCT_meshAndLabelsFromFile(const char *meshFilename,
229  const char *labelFilename,
230  CQCT_Error *error);
231 
233 CQCT_EXTERN int CQCT_loadMesh(CQCT_Mesh mesh, const char *filename,
234  CQCT_Error *error);
235 
237 CQCT_EXTERN int CQCT_loadMeshWithCustomMapping(CQCT_Mesh mesh,
238  const char *filename,
239  CQCT_ColorToLabelMap map,
240  CQCT_Error *error);
241 
243 CQCT_EXTERN int CQCT_loadMeshAndLabels(CQCT_Mesh mesh, const char *meshFilename,
244  const char *labelFilename,
245  CQCT_Error *error);
246 
248 CQCT_EXTERN int CQCT_meshAndLabelsWriteToFile(CQCT_Mesh mesh,
249  const char *meshFilename,
250  const char *labelsFilename,
251  CQCT_Error *error);
252 
254 CQCT_EXTERN size_t CQCT_meshVertexCount(CQCT_Mesh mesh);
255 
257 CQCT_EXTERN size_t CQCT_meshTriangleCount(CQCT_Mesh mesh);
258 
276 CQCT_EXTERN size_t CQCT_meshCopyVertices(CQCT_Mesh mesh, float **bufferPtr);
277 
287 CQCT_EXTERN void CQCT_meshSetVertices(CQCT_Mesh mesh, float const *buffer);
288 
305 CQCT_EXTERN size_t CQCT_meshCopyVertexNormals(CQCT_Mesh mesh,
306  float **bufferPtr);
307 
317 CQCT_EXTERN void CQCT_meshSetVertexNormals(CQCT_Mesh mesh, float const *buffer);
318 
323 CQCT_EXTERN size_t CQCT_meshCopyTriangles(CQCT_Mesh mesh,
324  ptrdiff_t **bufferPtr);
325 
335 CQCT_EXTERN void CQCT_meshSetTriangles(CQCT_Mesh mesh, ptrdiff_t const *buffer);
336 
341 CQCT_EXTERN size_t CQCT_meshCopyLabels(CQCT_Mesh mesh,
342  unsigned int **bufferPtr);
343 
351 CQCT_EXTERN void CQCT_meshSetLabels(CQCT_Mesh mesh, unsigned int const *buffer);
352 
371 CQCT_EXTERN int CQCT_meshBarycentricToCartesian(
372  CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints,
373  float **bufferPtr, CQCT_Error *error);
374 
398 CQCT_EXTERN int CQCT_meshBarycentricInterpolation(
399  CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints,
400  float const *attributePtr, size_t attributeDimensions, float **bufferPtr,
401  CQCT_Error *error);
402 
423 CQCT_EXTERN size_t CQCT_meshRayIntersectionsBuffers(
424  CQCT_Mesh mesh, CQCT_Ray *raysPtr, size_t nRays, float **positionsOutPtr,
425  ptrdiff_t **indicesOutPtr, float **distancesOutPtr);
426 
434 CQCT_EXTERN void CQCT_meshUpsample(CQCT_Mesh mesh, size_t nTimes);
435 
442 CQCT_EXTERN void CQCT_meshUpdatePerVertexNormals(CQCT_Mesh mesh);
443 
445 
446 // MARK: -
447 // MARK: ColorToLabelMap Type
448 
457 
459 CQCT_EXTERN CQCT_ColorToLabelMap CQCT_createColorToLabelMap(void);
460 
462 CQCT_EXTERN int CQCT_colorToLabelMapLoadFromFile(CQCT_ColorToLabelMap map,
463  const char *filename,
464  CQCT_Error *error);
465 
467 CQCT_EXTERN size_t CQCT_colorToLabelMapEntryCount(CQCT_ColorToLabelMap map);
468 
474 CQCT_EXTERN size_t CQCT_colorToLabelMapCopyEntries(CQCT_ColorToLabelMap map,
475  unsigned int **bufferPtr);
476 
478 CQCT_EXTERN void CQCT_colorToLabelMapSetEntries(CQCT_ColorToLabelMap map,
479  size_t count,
480  const unsigned int *entries);
482 
483 // MARK: -
484 // MARK: MeshFitterState Type
490 struct CQCT_MeshFitter_t;
493 
497 
499 typedef CQCT_MeshFitterState CQCT_MeshFitterResult;
500 
502 CQCT_EXTERN CQCT_MeshFitterState
503 CQCT_createMeshFitterState(CQCT_MeshFitter fitter, CQCT_VoxelVolume volume);
504 
506 CQCT_EXTERN CQCT_Mesh
507 CQCT_meshFitterResultReferenceMesh(CQCT_MeshFitterResult result);
508 
510 CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultMesh(CQCT_MeshFitterResult result);
511 
514  CQCT_MeshFitterResult result, float **buffer);
515 
517 CQCT_EXTERN void
518 CQCT_meshFitterResultSetDisplacementVector(CQCT_MeshFitterResult result,
519  float const *buffer);
520 
522 CQCT_EXTERN size_t
523 CQCT_meshFitterResultCopyWeights(CQCT_MeshFitterResult result, float **buffer);
524 
526 CQCT_EXTERN void CQCT_meshFitterResultSetWeights(CQCT_MeshFitterResult result,
527  float const *buffer);
531 CQCT_EXTERN size_t CQCT_meshFitterResultCopyVertexNormals(
532  CQCT_MeshFitterResult result, float **buffer)
533  __attribute__((deprecated("Use normals stored in deformedMesh instead.")));
534 
536 CQCT_EXTERN size_t
537 CQCT_meshFitterResultVolumeSamplingPositionsCount(CQCT_MeshFitterResult result);
538 
541  CQCT_MeshFitterResult result, float **buffer);
542 
544 CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamples(
545  CQCT_MeshFitterResult result, float **buffer);
546 
548 CQCT_EXTERN float
549 CQCT_meshFitterResultMinimumDisplacementNorm(CQCT_MeshFitterResult result);
550 
552 CQCT_EXTERN float
553 CQCT_meshFitterResultLogLikelihood(CQCT_MeshFitterResult result);
554 
557 CQCT_EXTERN float
558 CQCT_meshFitterResultCopyPerVertexLogLikelihood(CQCT_MeshFitterResult result,
559  float **buffer);
560 
562 CQCT_EXTERN void
563 CQCT_meshFitterResultSetLogLikelihood(CQCT_MeshFitterResult result, float ll);
564 
566 CQCT_EXTERN float
567 CQCT_meshFitterResultEffectiveSigmaS(CQCT_MeshFitterResult result);
568 
570 CQCT_EXTERN size_t
571 CQCT_meshFitterResultIterationCount(CQCT_MeshFitterResult result);
572 
574 CQCT_EXTERN void
575 CQCT_meshFitterResultSetIterationCount(CQCT_MeshFitterResult result,
576  size_t count);
577 
579 CQCT_EXTERN int CQCT_meshFitterResultHasConverged(CQCT_MeshFitterResult result);
580 
582 CQCT_EXTERN void
583 CQCT_meshFitterResultSetHasConverged(CQCT_MeshFitterResult result,
584  int converged);
585 
587 CQCT_EXTERN int CQCT_meshFitterResultSuccess(CQCT_MeshFitterResult result);
588 
590 CQCT_EXTERN void CQCT_meshFitterResultSetSuccess(CQCT_MeshFitterResult result,
591  int success);
592 
594 CQCT_EXTERN size_t
595 CQCT_meshFitterResultNonDecreasingCount(CQCT_MeshFitterResult result);
596 
598 CQCT_EXTERN void
599 CQCT_meshFitterResultSetNonDecreasingCount(CQCT_MeshFitterResult result,
600  size_t count);
601 
604  CQCT_MeshFitterState state, float **buffer);
605 
607 
608 // MARK: -
609 // MARK: MeshFitter Type
615 CQCT_EXTERN CQCT_MeshFitter CQCT_createMeshFitter(const char *filename,
617  CQCT_Error *error);
618 
620 CQCT_EXTERN CQCT_MeshFitterResult CQCT_meshFitterFit(CQCT_MeshFitter meshFitter,
621  CQCT_VoxelVolume volume);
622 
624 CQCT_EXTERN int CQCT_meshFitterFitOneIteration(CQCT_MeshFitter meshFitter,
625  CQCT_MeshFitterState state,
626  CQCT_Error *error);
627 
629 CQCT_EXTERN int CQCT_meshFitterVolumeSamplingStep(CQCT_MeshFitter meshFitter,
630  CQCT_MeshFitterState state,
631  CQCT_Error *error);
632 
635  CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error);
636 
639  CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error);
640 
642 CQCT_EXTERN int CQCT_meshFitterLogLikelihoodStep(CQCT_MeshFitter meshFitter,
643  CQCT_MeshFitterState state,
644  CQCT_Error *error);
645 
647 CQCT_EXTERN int CQCT_meshFitterConvergenceTestStep(CQCT_MeshFitter meshFitter,
648  CQCT_MeshFitterState state,
649  CQCT_Error *error);
650 
652 
653 # ifdef __cplusplus
654 }
655 # endif
656 
657 #endif
658 
660 
CQCT_EXTERN CQCT_MeshFitter CQCT_createMeshFitter(const char *filename, CQCT_Error *error)
Creates a mesh fitter given the configuration file.
Definition: MeshFitter.cpp:12
CQCT_EXTERN int CQCT_meshFitterResultSuccess(CQCT_MeshFitterResult result)
Returns whether the optimization was successfull.
Definition: MeshFitterState.cpp:297
CQCT_EXTERN float CQCT_meshFitterResultCopyPerVertexLogLikelihood(CQCT_MeshFitterResult result, float **buffer)
Definition: MeshFitterState.cpp:224
CQCT_EXTERN CQCT_Mesh CQCT_createMesh()
Creates an empty mesh.
Definition: Mesh.cpp:10
CQCT_EXTERN float CQCT_meshFitterResultLogLikelihood(CQCT_MeshFitterResult result)
Returns the current log likelihood of the model given the input volume.
Definition: MeshFitterState.cpp:216
CQCT_EXTERN void CQCT_meshFitterResultSetLogLikelihood(CQCT_MeshFitterResult result, float ll)
Sets the current log likelihood of the model given the input volume.
Definition: MeshFitterState.cpp:242
ptrdiff_t triangleIndex
second barycentric coordinate
Definition: CortidQCT.h:186
CQCT_EXTERN void CQCT_autoreleasePoolPop()
Definition: ObjectBase.cpp:63
Ray type.
Definition: CortidQCT.h:191
CQCT_EXTERN const char * CQCT_errorMessage(CQCT_Error error)
Returns the error message.
Definition: Error.cpp:42
CQCT_ErrorId
Error types/Ids.
Definition: CortidQCT.h:98
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.
Definition: Mesh.cpp:90
CQCT_EXTERN size_t CQCT_colorToLabelMapCopyEntries(CQCT_ColorToLabelMap map, unsigned int **bufferPtr)
Copies the entries of the map into the given buffer.
Definition: ColorToLabelMap.cpp:54
CQCT_EXTERN Id CQCT_autorelease(Id obj)
Definition: ObjectBase.cpp:53
CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultReferenceMesh(CQCT_MeshFitterResult result)
Returns the result reference mesh.
Definition: MeshFitterState.cpp:73
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.
Definition: Mesh.cpp:14
CQCT_EXTERN size_t CQCT_meshCopyVertexNormals(CQCT_Mesh mesh, float **bufferPtr)
Copies the mesh&#39;s per-vertex normals into the given buffer.
Definition: Mesh.cpp:190
CQCT_EXTERN CQCT_Error CQCT_createError(enum CQCT_ErrorId id, const char *message)
Creates an error object.
Definition: Error.cpp:32
CQCT_EXTERN CQCT_ColorToLabelMap CQCT_createColorToLabelMap()
Creates a default color to label map.
Definition: ColorToLabelMap.cpp:11
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamplingPositions(CQCT_MeshFitterResult result, float **buffer)
Copies the volume sampling positions.
Definition: MeshFitterState.cpp:172
CQCT_EXTERN int CQCT_voxelVolumeLoadFromFile(CQCT_VoxelVolume volume, const char *filename, CQCT_Error *error)
Loads the voxel volume from file.
Definition: VoxelVolume.cpp:15
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...
Definition: Mesh.cpp:321
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.
Definition: Mesh.cpp:240
Definition: CortidQCT-Common.h:81
CQCT_EXTERN int CQCT_meshFitterVolumeSamplingStep(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs the volume sampling step.
Definition: MeshFitter.cpp:88
struct CQCT_MeshFitterState_t * CQCT_MeshFitterState
Mesh fitter state handle type.
Definition: CortidQCT.h:537
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVertexNormals(CQCT_MeshFitterResult result, float **buffer) __attribute__((deprecated("Use normals stored in deformedMesh instead.")))
Definition: MeshFitterState.cpp:146
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.
Definition: Mesh.cpp:56
CQCT_EXTERN int CQCT_meshFitterResultHasConverged(CQCT_MeshFitterResult result)
Returns whether the optimization has converged.
Definition: MeshFitterState.cpp:278
CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamples(CQCT_MeshFitterResult result, float **buffer)
Copies the volume samples.
Definition: MeshFitterState.cpp:190
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.
Definition: Mesh.cpp:272
CQCT_EXTERN size_t CQCT_meshCopyVertices(CQCT_Mesh mesh, float **bufferPtr)
Copies the mesh&#39;s vertices into the given buffer.
Definition: Mesh.cpp:160
CQCT_EXTERN void CQCT_colorToLabelMapSetEntries(CQCT_ColorToLabelMap map, size_t count, const unsigned int *entries)
Sets the entries of the mapping.
Definition: ColorToLabelMap.cpp:84
CQCT_EXTERN int CQCT_colorToLabelMapLoadFromFile(CQCT_ColorToLabelMap map, const char *filename, CQCT_Error *error)
Loads the mapping from YAML file.
Definition: ColorToLabelMap.cpp:17
CQCT_EXTERN size_t CQCT_meshCopyLabels(CQCT_Mesh mesh, unsigned int **bufferPtr)
Copies the mesh&#39;s labels into the given buffer.
Definition: Mesh.cpp:253
CQCT_EXTERN size_t CQCT_meshCopyTriangles(CQCT_Mesh mesh, ptrdiff_t **bufferPtr)
Copies the mesh&#39;s indices into the given buffer.
Definition: Mesh.cpp:221
CQCT_EXTERN size_t CQCT_voxelVolumeDepth(CQCT_VoxelVolume volume)
Returns the depth of the voxel volume.
Definition: matlab-addons.c:29
CQCT_EXTERN size_t CQCT_meshRayIntersectionsBuffers(CQCT_Mesh mesh, CQCT_Ray *raysPtr, size_t nRays, float **positionsOutPtr, ptrdiff_t **indicesOutPtr, float **distancesOutPtr)
Computes the intersection of a set of rays with the mesh.
Definition: matlab-addons.c:62
CQCT_EXTERN enum CQCT_ErrorId CQCT_errorType(CQCT_Error error)
Returns the error id.
Definition: Error.cpp:36
CQCT_EXTERN void CQCT_meshUpdatePerVertexNormals(CQCT_Mesh mesh)
Re-computes per-vertex normals.
Definition: Mesh.cpp:395
CQCT_EXTERN float CQCT_voxelVolumeVoxelHeight(CQCT_VoxelVolume volume)
Returns the height of a voxel.
Definition: matlab-addons.c:39
CQCT_EXTERN int CQCT_meshFitterConvergenceTestStep(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs the convergence testing step.
Definition: MeshFitter.cpp:232
Definition: CortidQCT-Common.h:67
CQCT_EXTERN float CQCT_voxelVolumeVoxelDepth(CQCT_VoxelVolume volume)
Returns the depth of a voxel.
Definition: matlab-addons.c:44
CQCT_EXTERN Id CQCT_retain(Id obj)
Retains an object, i.e. increments its retain count.
Definition: ObjectBase.cpp:73
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. ...
Definition: Mesh.cpp:208
CQCT_MeshFitterState CQCT_MeshFitterResult
Mesh fitter result object.
Definition: CortidQCT.h:540
CQCT_EXTERN void CQCT_meshFitterResultSetSuccess(CQCT_MeshFitterResult result, int success)
Sets whether the optimization was successfull.
Definition: MeshFitterState.cpp:306
Barycentric point type.
Definition: CortidQCT.h:183
CQCT_EXTERN void CQCT_autoreleasePoolPush()
Adds a new autorelease pool to the stack.
Definition: ObjectBase.cpp:59
CQCT_EXTERN size_t CQCT_voxelVolumeWidth(CQCT_VoxelVolume volume)
Returns the width of the voxel volume.
Definition: matlab-addons.c:19
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.
Definition: Mesh.cpp:42
struct CQCT_Error_t * CQCT_Error
Error type.
Definition: CortidQCT.h:106
CQCT_EXTERN size_t CQCT_meshFitterResultCopyDisplacementVector(CQCT_MeshFitterResult result, float **buffer)
Copies the displacement vector.
Definition: MeshFitterState.cpp:87
Definition: Error.cpp:27
struct CQCT_Mesh_t * CQCT_Mesh
Mesh handle type.
Definition: CortidQCT.h:180
struct CQCT_MeshFitter_t * CQCT_MeshFitter
Mesh fitter handle type.
Definition: CortidQCT.h:533
CQCT_EXTERN void CQCT_meshUpsample(CQCT_Mesh mesh, size_t nTimes)
Upsamples the given mesh nTimes without touchting the original vertices.
Definition: Mesh.cpp:385
CQCT_EXTERN size_t CQCT_meshVertexCount(CQCT_Mesh mesh)
Return number of vertices of the given mesh.
Definition: Mesh.cpp:148
CQCT_EXTERN size_t CQCT_voxelVolumeHeight(CQCT_VoxelVolume volume)
Returns the height of the voxel volume.
Definition: matlab-addons.c:24
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.
Definition: Mesh.cpp:284
struct CQCT_VoxelVolume_t * CQCT_VoxelVolume
Voxel volume handle type.
Definition: CortidQCT.h:139
CQCT_EXTERN size_t CQCT_meshFitterResultNonDecreasingCount(CQCT_MeshFitterResult result)
Returns the current non decreasing count.
Definition: MeshFitterState.cpp:315
CQCT_EXTERN CQCT_Mesh CQCT_meshFromFile(const char *filename, CQCT_Error *error)
Creates and loads a mesh from file.
Definition: Mesh.cpp:29
CQCT_EXTERN CQCT_MeshFitterState CQCT_createMeshFitterState(CQCT_MeshFitter fitter, CQCT_VoxelVolume volume)
Creates an MeshFitter optimization state object.
Definition: MeshFitterState.cpp:47
CQCT_EXTERN float CQCT_meshFitterResultMinimumDisplacementNorm(CQCT_MeshFitterResult result)
Returns the minimum norm of the displacement vector.
Definition: MeshFitterState.cpp:207
CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultMesh(CQCT_MeshFitterResult result)
Returns the result mesh.
Definition: MeshFitterState.cpp:59
CQCT_EXTERN float CQCT_meshFitterResultEffectiveSigmaS(CQCT_MeshFitterResult result)
Returns the current effective sigmaS (after applying decay)
Definition: MeshFitterState.cpp:251
CQCT_EXTERN int CQCT_meshFitterOptimalDisplacementStep(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs the displacement optimization step.
Definition: MeshFitter.cpp:123
void * Id
Generic &#39;object&#39; type.
Definition: CortidQCT.h:68
CQCT_EXTERN CQCT_VoxelVolume CQCT_createVoxelVolume()
Creates an empty voxel volume.
Definition: VoxelVolume.cpp:10
CQCT_EXTERN int CQCT_meshAndLabelsWriteToFile(CQCT_Mesh mesh, const char *meshFilename, const char *labelsFilename, CQCT_Error *error)
Writes mesh and labels to seperate files.
Definition: Mesh.cpp:120
CQCT_EXTERN void CQCT_release(Id obj)
Definition: ObjectBase.cpp:83
CQCT_EXTERN size_t CQCT_meshTriangleCount(CQCT_Mesh mesh)
Return number of triangles of the given mesh.
Definition: Mesh.cpp:154
CQCT_EXTERN CQCT_MeshFitterResult CQCT_meshFitterFit(CQCT_MeshFitter meshFitter, CQCT_VoxelVolume volume)
Fits the reference mesh to the given voxel volume.
Definition: MeshFitter.cpp:37
float v
first barycentric coordinate
Definition: CortidQCT.h:185
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. ...
Definition: Mesh.cpp:34
CQCT_EXTERN int CQCT_meshFitterFitOneIteration(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs one iteration of the fitting algorithm.
Definition: MeshFitter.cpp:53
CQCT_EXTERN int CQCT_meshFitterLogLikelihoodStep(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs the log likelihood computation step.
Definition: MeshFitter.cpp:196
CQCT_EXTERN size_t CQCT_colorToLabelMapEntryCount(CQCT_ColorToLabelMap map)
Returns number of entries of the map.
Definition: ColorToLabelMap.cpp:48
CQCT_EXTERN void CQCT_meshFitterResultSetIterationCount(CQCT_MeshFitterResult result, size_t count)
Sets the iteration count.
Definition: MeshFitterState.cpp:268
Definition: CortidQCT-Common.h:87
CQCT_EXTERN size_t CQCT_voxelVolumeCopyVoxels(CQCT_VoxelVolume volume, float **buffer)
Copies the voxel data to the given buffer.
Definition: VoxelVolume.cpp:62
CQCT_EXTERN int CQCT_loadMesh(CQCT_Mesh mesh, const char *filename, CQCT_Error *error)
Loads a mesh from file.
Definition: Mesh.cpp:51
CQCT_EXTERN size_t CQCT_meshFitterResultVolumeSamplingPositionsCount(CQCT_MeshFitterResult result)
Returns the number of volume sampling positions.
Definition: MeshFitterState.cpp:164
CQCT_EXTERN void CQCT_meshFitterResultSetNonDecreasingCount(CQCT_MeshFitterResult result, size_t count)
Sets the current non decreasing count.
Definition: MeshFitterState.cpp:324
CQCT_EXTERN size_t CQCT_meshFitterResultCopyWeights(CQCT_MeshFitterResult result, float **buffer)
Copies the weight vector.
Definition: MeshFitterState.cpp:118
CQCT_EXTERN void CQCT_meshFitterResultSetHasConverged(CQCT_MeshFitterResult result, int converged)
Sets whether the optimization has converged.
Definition: MeshFitterState.cpp:287
Definition: CortidQCT-Common.h:73
CQCT_EXTERN size_t CQCT_meshFitterResultIterationCount(CQCT_MeshFitterResult result)
Returns the iteration count.
Definition: MeshFitterState.cpp:259
CQCT_EXTERN int CQCT_meshFitterOptimalDeformationStep(CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error)
Runs the deformation optimization step.
Definition: MeshFitter.cpp:158
CQCT_EXTERN void CQCT_meshFitterResultSetDisplacementVector(CQCT_MeshFitterResult result, float const *buffer)
Sets the displacement vector.
Definition: MeshFitterState.cpp:105
CQCT_EXTERN float CQCT_voxelVolumeVoxelWidth(CQCT_VoxelVolume volume)
Returns the width of a voxel.
Definition: matlab-addons.c:34
Definition: CortidQCT-Common.h:77
CQCT_EXTERN size_t CQCT_meshFitterStateCopyModelSamplingPositions(CQCT_MeshFitterState state, float **buffer)
Copies the model sampling positions.
Definition: MeshFitterState.cpp:334
struct CQCT_ColorToLabelMap_t * CQCT_ColorToLabelMap
ColorToLabelMap handle type.
Definition: CortidQCT.h:168
CQCT_EXTERN void CQCT_meshFitterResultSetWeights(CQCT_MeshFitterResult result, float const *buffer)
Sets the weight vector.
Definition: MeshFitterState.cpp:134
CQCT_EXTERN void CQCT_meshSetVertices(CQCT_Mesh mesh, float const *buffer)
Copies the vertices from the given buffer into the mesh data structure.
Definition: Mesh.cpp:178