Libs/Mesh/meshFIM.h
Classes
| Name | |
|---|---|
| class | meshFIM |
Defines
| Name | |
|---|---|
| _EPS | |
| ONE | |
| CURVATURE | |
| GENERATE_GEO_FILES |
Macros Documentation
define _EPS
```cpp
define _EPS 1e-06
```
define ONE
```cpp
define ONE 1
```
define CURVATURE
```cpp
define CURVATURE 2
```
define GENERATE_GEO_FILES
```cpp
define GENERATE_GEO_FILES 1
```
Source code
```cpp
ifndef MESHFIM_H
define MESHFIM_H
include "TriMesh.h"
include "TriMesh_algo.h"
include "KDtree.h"
include "Color.h"
//#include "itkImageToImageFilter.h" //#include "itkLevelSet.h" //#include "itkIndex.h" //#include "vnl/vnl_math.h" //#include "itkDiffusionTensor3D.h"
include
include
include
include
include
include
include
include
include
include
include
include
include
//#include
include
include
include
include
include
include
include
ifndef _EPS
define _EPS 1e-06
endif
define ONE 1
define CURVATURE 2
// SHIREEN
define GENERATE_GEO_FILES 1 // now disable till we incorporate the geodesic repulsion
// end SHIREEN
using trimesh::TriMesh; using trimesh::vec3; using trimesh::point; using trimesh::KDtree; using trimesh::Color;
class meshFIM {
public: typedef int VoxelIndexType;
typedef int index;
enum LabelType { MaskPoint, SeedPoint, ActivePoint, FarPoint, StopPoint, AlivePoint,ToBeAlivePoint };
TriMesh *m_meshPtr;
int NumComputation;
float imageOrigin[3];
float imageSpacing[3];
int imageSize[3];
int imageIndex[3];
std::vector<Color> colors;
void ComputeDistanceToLandmarksGivenTriangleInfo(TriMesh *mesh, const char *infilename, const char *outfilename);
void computeFIM(TriMesh *mesh, const char *vertT_filename);
void GetFeatureValues(point x, std::vector<float> &vals);
void ReadFaceIndexMap(const char *infilename);
void ReadFeatureFromFile(const char *infilename);
void ReadFeatureGradientFromFile(const char *infilename);
point GetFeatureDerivative(point p, int fIndex);
void need_abs_curvatures();
void need_edge_lengths();
void need_speed();
void need_oneringfaces();
void need_kdtree();
void SetMesh(TriMesh *mesh);
void SetStopDistance(float d) {
m_StopDistance = d;
}
void setSpeedType(int st) {
speedType = st;
if (st != ONE && st != CURVATURE) {
std::cout << "Impossible SpeedType set" << std::endl;
throw(1);
}
}
meshFIM() {
m_meshPtr = NULL;
};
~meshFIM() {};
protected:
private:
std::list
TriMesh GetOutputMesh() { return m_meshPtr; } void MeshReader(char filename);
bool IsNonObtuse(int v, TriMesh::Face f);
void SplitFace(std::vector
void SetSeedPoint(std::vector
int getSpeedType() { return speedType; } float GetStopDistance() { return m_StopDistance; }
void InitializeLabels(); void InitializeActivePoints(); float PointLength(point v);
void GenerateReducedData();
void loadGeodesicFile(TriMesh mesh, const char geoFilename);
void computeCoordXFiles(TriMesh mesh, const char vertT_filename); void computeCoordYFiles(TriMesh mesh, const char vertT_filename); void computeCoordZFiles(TriMesh mesh, const char vertT_filename); void computeCurvFiles(TriMesh mesh, const char vertT_filename);
void ComputeDistanceToCurve(TriMesh mesh, std::vector< point > curvePoints, const char outfilename);
void physicalPointToXYZ(point x, VoxelIndexType imageX, float imageOrigin[3], float imageSpacing[3]); VoxelIndexType indexToLinearIndex(VoxelIndexType imageX, int imageSize[3]); VoxelIndexType physicalPointToLinearIndex(point x); VoxelIndexType physicalPointToLinearIndex(point x, float imageOrigin[3], float imageSpacing[3], int imageSize[3]); double pointTriangleDistance(point P, TriMesh::Face face, point &PP); vec3 ComputeBarycentricCoordinates(point p, TriMesh::Face f); void need_maxedgelength(); int FindNearestVertex(point pt); int GetTriangleInfoForPoint(point x, TriMesh::Face &triangleX, float &alphaX, float &betaX, float &gammaX);
//Praful - for Riddhish project
//float GetVirtualSource(vnl_vector
// SHIREEN - compute distance to landmarks based on geodesic approximation
//float GetBronsteinGeodesicDistance(point a, point b, char method);
void ComputeDistanceToLandmark(TriMesh mesh, point landmark, bool apply_log, const char *outfilename);
void UpdateGeodesicMapWithDistancesFromVertices(std::vector
// SHIREEN - computing geo distance on the fly for fuzzy geodesics
int GetVertexInfoForPoint(point x);
//std::vector
point ComputeFeatureDerivative(int v, int nFeature);
int speedType;
// maps face index to speedInv
std::vector
// maps vertex index to abs_curv
std::vector
// maps face index to vec3 of edge lengths with edges in this order: {01, 12, 20}
std::vector
// maps vertex index to vertex index to distance?
std::vector< std::map
// maps vertex index to something to do with the geodesic computation
std::vector
// maps something to something
std::map
// Used for ComputeBaryCentricCoordinates when faceIndexMap is unavailable. KDtree *kd;
// Used for GetNearestVertex; double maxEdgeLength;
std::vector< std::vector
std::vector< std::vector
std::vector < std::vector
};
endif
```
Updated on 2026-03-31 at 16:02:11 +0000