CortidQCT  1.2.2.52
CortidQCT.h
Go to the documentation of this file.
1 
49 #ifndef CORTIDQCT_C_BINDINGS_CORTIDQCT_H__
50 # define CORTIDQCT_C_BINDINGS_CORTIDQCT_H__
51 
52 # ifdef __cplusplus
53 extern "C" {
54 
55 # define CQCT_EXTERN extern "C"
56 # else
57 # define CQCT_EXTERN
58 # endif
59 
60 # include <stddef.h>
61 
62 // MARK: -
63 // MARK: Object Type / Generic Functions
66 
68 typedef void *Id;
69 
71 CQCT_EXTERN Id CQCT_retain(Id obj);
72 
75 CQCT_EXTERN void CQCT_release(Id obj);
76 
79 CQCT_EXTERN Id CQCT_autorelease(Id obj);
80 
82 CQCT_EXTERN void CQCT_autoreleasePoolPush();
83 
86 CQCT_EXTERN void CQCT_autoreleasePoolPop();
87 
89 
90 // MARK: -
91 // MARK: Error Type
97 enum CQCT_ErrorId {
99  CQCT_ErrorId_Unknown,
100  CQCT_ErrorId_InvalidArgument,
101  CQCT_ErrorId_OutOfRange
102 };
103 
104 struct CQCT_Error_t;
106 typedef struct CQCT_Error_t *CQCT_Error;
107 
109 CQCT_EXTERN CQCT_Error CQCT_createError(enum CQCT_ErrorId id,
110  const char *message);
111 
113 CQCT_EXTERN enum CQCT_ErrorId CQCT_errorType(CQCT_Error error);
114 
116 CQCT_EXTERN const char *CQCT_errorMessage(CQCT_Error error);
117 
119 
120 // MARK: -
121 // MARK: VoxelVolume Type
127 typedef struct {
129  size_t width, heigth, depth;
131 
133 typedef struct {
134  float width, heigth, depth;
136 
137 struct CQCT_VoxelVolume_t;
140 
142 CQCT_EXTERN CQCT_VoxelVolume CQCT_createVoxelVolume();
143 
145 CQCT_EXTERN int CQCT_voxelVolumeLoadFromFile(CQCT_VoxelVolume volume,
146  const char *filename,
147  CQCT_Error *error);
148 
150 CQCT_EXTERN CQCT_VoxelVolumeSize CQCT_voxelVolumeSize(CQCT_VoxelVolume volume);
151 
153 CQCT_EXTERN CQCT_VoxelVolumeVoxelSize
154 CQCT_voxelVolumeVoxelSize(CQCT_VoxelVolume volume);
155 
157 CQCT_EXTERN size_t CQCT_voxelVolumeCopyVoxels(CQCT_VoxelVolume volume,
158  float **buffer);
159 
161 
169 
171 
172 // MARK: -
173 // MARK: Mesh Type
178 struct CQCT_Mesh_t;
180 typedef struct CQCT_Mesh_t *CQCT_Mesh;
181 
184  float u;
185  float v;
186  ptrdiff_t triangleIndex;
187 };
189 
191 struct CQCT_Ray_t {
193  float x0, y0, z0;
195  float dx, dy, dz;
196 };
197 typedef struct CQCT_Ray_t CQCT_Ray;
198 
203  float t;
205  unsigned int : 4 * 8;
206 };
208 
210 CQCT_EXTERN CQCT_Mesh CQCT_createMesh();
211 
229 CQCT_EXTERN CQCT_Mesh CQCT_createMeshAndAllocateMemory(size_t nVertices,
230  size_t nTriangles,
231  CQCT_Error *error);
232 
243 CQCT_EXTERN CQCT_Mesh CQCT_meshFromFile(const char *filename,
244  CQCT_Error *error);
245 
258 CQCT_EXTERN CQCT_Mesh CQCT_meshFromFileWithCustomMapping(
259  const char *filename, CQCT_ColorToLabelMap map, CQCT_Error *error);
260 
272 CQCT_EXTERN CQCT_Mesh CQCT_meshAndLabelsFromFile(const char *meshFilename,
273  const char *labelFilename,
274  CQCT_Error *error);
275 
277 CQCT_EXTERN int CQCT_loadMesh(CQCT_Mesh mesh, const char *filename,
278  CQCT_Error *error);
279 
281 CQCT_EXTERN int CQCT_loadMeshWithCustomMapping(CQCT_Mesh mesh,
282  const char *filename,
283  CQCT_ColorToLabelMap map,
284  CQCT_Error *error);
285 
287 CQCT_EXTERN int CQCT_loadMeshAndLabels(CQCT_Mesh mesh, const char *meshFilename,
288  const char *labelFilename,
289  CQCT_Error *error);
290 
292 CQCT_EXTERN int CQCT_meshAndLabelsWriteToFile(CQCT_Mesh mesh,
293  const char *meshFilename,
294  const char *labelsFilename,
295  CQCT_Error *error);
296 
298 CQCT_EXTERN size_t CQCT_meshVertexCount(CQCT_Mesh mesh);
299 
301 CQCT_EXTERN size_t CQCT_meshTriangleCount(CQCT_Mesh mesh);
302 
320 CQCT_EXTERN size_t CQCT_meshCopyVertices(CQCT_Mesh mesh, float **bufferPtr);
321 
331 CQCT_EXTERN void CQCT_meshSetVertices(CQCT_Mesh mesh, float const *buffer);
332 
349 CQCT_EXTERN size_t CQCT_meshCopyVertexNormals(CQCT_Mesh mesh,
350  float **bufferPtr);
351 
361 CQCT_EXTERN void CQCT_meshSetVertexNormals(CQCT_Mesh mesh, float const *buffer);
362 
367 CQCT_EXTERN size_t CQCT_meshCopyTriangles(CQCT_Mesh mesh,
368  ptrdiff_t **bufferPtr);
369 
379 CQCT_EXTERN void CQCT_meshSetTriangles(CQCT_Mesh mesh, ptrdiff_t const *buffer);
380 
385 CQCT_EXTERN size_t CQCT_meshCopyLabels(CQCT_Mesh mesh,
386  unsigned int **bufferPtr);
387 
395 CQCT_EXTERN void CQCT_meshSetLabels(CQCT_Mesh mesh, unsigned int const *buffer);
396 
415 CQCT_EXTERN int CQCT_meshBarycentricToCartesian(
416  CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints,
417  float **bufferPtr, CQCT_Error *error);
418 
442 CQCT_EXTERN int CQCT_meshBarycentricInterpolation(
443  CQCT_Mesh mesh, CQCT_BarycentricPoint const *barycentricPtr, size_t nPoints,
444  float const *attributePtr, size_t attributeDimensions, float **bufferPtr,
445  CQCT_Error *error);
446 
467 CQCT_EXTERN size_t
468 CQCT_meshRayIntersections(CQCT_Mesh mesh, CQCT_Ray *raysPtr, size_t nRays,
469  CQCT_RayMeshIntersection **intersectionsOutPtr);
470 
478 CQCT_EXTERN void CQCT_meshUpsample(CQCT_Mesh mesh, size_t nTimes);
479 
486 CQCT_EXTERN void CQCT_meshUpdatePerVertexNormals(CQCT_Mesh mesh);
487 
489 
490 // MARK: -
491 // MARK: ColorToLabelMap Type
492 
498 CQCT_EXTERN CQCT_ColorToLabelMap CQCT_createColorToLabelMap();
500 
502 CQCT_EXTERN int CQCT_colorToLabelMapLoadFromFile(CQCT_ColorToLabelMap map,
503  const char *filename,
504  CQCT_Error *error);
505 
507 CQCT_EXTERN size_t CQCT_colorToLabelMapEntryCount(CQCT_ColorToLabelMap map);
508 
514 CQCT_EXTERN size_t CQCT_colorToLabelMapCopyEntries(CQCT_ColorToLabelMap map,
515  unsigned int **bufferPtr);
516 
518 CQCT_EXTERN void CQCT_colorToLabelMapSetEntries(CQCT_ColorToLabelMap map,
519  size_t count,
520  const unsigned int *entries);
521 
523 
524 // MARK: -
525 // MARK: MeshFitterState Type
531 struct CQCT_MeshFitter_t;
534 
538 
540 typedef CQCT_MeshFitterState CQCT_MeshFitterResult;
541 
543 CQCT_EXTERN CQCT_MeshFitterState
544 CQCT_createMeshFitterState(CQCT_MeshFitter fitter, CQCT_VoxelVolume volume);
545 
547 CQCT_EXTERN CQCT_Mesh
548 CQCT_meshFitterResultReferenceMesh(CQCT_MeshFitterResult result);
549 
551 CQCT_EXTERN CQCT_Mesh CQCT_meshFitterResultMesh(CQCT_MeshFitterResult result);
552 
555  CQCT_MeshFitterResult result, float **buffer);
556 
558 CQCT_EXTERN void
559 CQCT_meshFitterResultSetDisplacementVector(CQCT_MeshFitterResult result,
560  float const *buffer);
561 
563 CQCT_EXTERN size_t
564 CQCT_meshFitterResultCopyWeights(CQCT_MeshFitterResult result, float **buffer);
565 
567 CQCT_EXTERN void CQCT_meshFitterResultSetWeights(CQCT_MeshFitterResult result,
568  float const *buffer);
569 
573 CQCT_EXTERN size_t CQCT_meshFitterResultCopyVertexNormals(
574  CQCT_MeshFitterResult result, float **buffer)
575  __attribute__((deprecated("Use normals stored in deformedMesh instead.")));
576 
578 CQCT_EXTERN size_t
579 CQCT_meshFitterResultVolumeSamplingPositionsCount(CQCT_MeshFitterResult result);
580 
583  CQCT_MeshFitterResult result, float **buffer);
584 
586 CQCT_EXTERN size_t CQCT_meshFitterResultCopyVolumeSamples(
587  CQCT_MeshFitterResult result, float **buffer);
588 
590 CQCT_EXTERN float
591 CQCT_meshFitterResultMinimumDisplacementNorm(CQCT_MeshFitterResult result);
592 
594 CQCT_EXTERN float
595 CQCT_meshFitterResultLogLikelihood(CQCT_MeshFitterResult result);
596 
599 CQCT_EXTERN float
600 CQCT_meshFitterResultCopyPerVertexLogLikelihood(CQCT_MeshFitterResult result,
601  float **buffer);
602 
604 CQCT_EXTERN void
605 CQCT_meshFitterResultSetLogLikelihood(CQCT_MeshFitterResult result, float ll);
606 
608 CQCT_EXTERN float
609 CQCT_meshFitterResultEffectiveSigmaS(CQCT_MeshFitterResult result);
610 
612 CQCT_EXTERN size_t
613 CQCT_meshFitterResultIterationCount(CQCT_MeshFitterResult result);
614 
616 CQCT_EXTERN void
617 CQCT_meshFitterResultSetIterationCount(CQCT_MeshFitterResult result,
618  size_t count);
619 
621 CQCT_EXTERN int CQCT_meshFitterResultHasConverged(CQCT_MeshFitterResult result);
622 
624 CQCT_EXTERN void
625 CQCT_meshFitterResultSetHasConverged(CQCT_MeshFitterResult result,
626  int converged);
627 
629 CQCT_EXTERN int CQCT_meshFitterResultSuccess(CQCT_MeshFitterResult result);
630 
632 CQCT_EXTERN void CQCT_meshFitterResultSetSuccess(CQCT_MeshFitterResult result,
633  int success);
634 
636 CQCT_EXTERN size_t
637 CQCT_meshFitterResultNonDecreasingCount(CQCT_MeshFitterResult result);
638 
640 CQCT_EXTERN void
641 CQCT_meshFitterResultSetNonDecreasingCount(CQCT_MeshFitterResult result,
642  size_t count);
643 
646  CQCT_MeshFitterState state, float **buffer);
647 
649 
650 // MARK: -
651 // MARK: MeshFitter Type
657 CQCT_EXTERN CQCT_MeshFitter CQCT_createMeshFitter(const char *filename,
659  CQCT_Error *error);
660 
662 CQCT_EXTERN CQCT_MeshFitterResult CQCT_meshFitterFit(CQCT_MeshFitter meshFitter,
663  CQCT_VoxelVolume volume);
664 
666 CQCT_EXTERN int CQCT_meshFitterFitOneIteration(CQCT_MeshFitter meshFitter,
667  CQCT_MeshFitterState state,
668  CQCT_Error *error);
669 
671 CQCT_EXTERN int CQCT_meshFitterVolumeSamplingStep(CQCT_MeshFitter meshFitter,
672  CQCT_MeshFitterState state,
673  CQCT_Error *error);
674 
677  CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error);
678 
681  CQCT_MeshFitter meshFitter, CQCT_MeshFitterState state, CQCT_Error *error);
682 
684 CQCT_EXTERN int CQCT_meshFitterLogLikelihoodStep(CQCT_MeshFitter meshFitter,
685  CQCT_MeshFitterState state,
686  CQCT_Error *error);
687 
689 CQCT_EXTERN int CQCT_meshFitterConvergenceTestStep(CQCT_MeshFitter meshFitter,
690  CQCT_MeshFitterState state,
691  CQCT_Error *error);
692 
694 
695 # ifdef __cplusplus
696 }
697 # endif
698 
699 #endif
700 
702 
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
float t
Signed distance frim the ray origin to the intersection.
Definition: CortidQCT.h:203
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
float x0
Ray origin in cartesian coordinates.
Definition: CortidQCT.h:193
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_VoxelVolumeVoxelSize CQCT_voxelVolumeVoxelSize(CQCT_VoxelVolume volume)
Returns the size of a voxel.
Definition: VoxelVolume.cpp:54
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
Definition: CortidQCT.h:199
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_BarycentricPoint position
Position on the mesh in barycentric coordinates.
Definition: CortidQCT.h:201
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 enum CQCT_ErrorId CQCT_errorType(CQCT_Error error)
Returns the error id.
Definition: Error.cpp:36
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.
Definition: Mesh.cpp:361
CQCT_EXTERN void CQCT_meshUpdatePerVertexNormals(CQCT_Mesh mesh)
Re-computes per-vertex normals.
Definition: Mesh.cpp:395
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 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 CQCT_VoxelVolumeSize CQCT_voxelVolumeSize(CQCT_VoxelVolume volume)
Returns the size of the voxel volume.
Definition: VoxelVolume.cpp:46
VoxelVolume size.
Definition: CortidQCT.h:128
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 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
float dx
Ray direction in cartesian coordinates.
Definition: CortidQCT.h:195
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
VoxelVolume voxel size.
Definition: CortidQCT.h:133
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
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