Chaste
Release::2017.1
|
#include <HeartGeometryInformation.hpp>
Public Member Functions | |
HeartGeometryInformation (AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &rMesh, const std::string &rEpiFile, const std::string &rEndoFile, bool indexFromZero) | |
HeartGeometryInformation (AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &rMesh, const std::string &rEpiFile, const std::string &rLVFile, const std::string &rRVFile, bool indexFromZero) | |
HeartGeometryInformation (std::string nodeHeterogeneityFileName) | |
HeartRegionType | GetHeartRegion (unsigned nodeIndex) const |
std::vector< double > & | rGetDistanceMapEpicardium () |
std::vector< double > & | rGetDistanceMapEndocardium () |
std::vector< double > & | rGetDistanceMapRightVentricle () |
std::vector< double > & | rGetDistanceMapLeftVentricle () |
const std::vector< unsigned > & | rGetNodesOnEpiSurface () |
const std::vector< unsigned > & | rGetNodesOnEndoSurface () |
const std::vector< unsigned > & | rGetNodesOnLVSurface () |
const std::vector< unsigned > & | rGetNodesOnRVSurface () |
const std::vector< HeartLayerType > & | rGetLayerForEachNode () |
double | CalculateRelativeWallPosition (unsigned nodeIndex) |
void | DetermineLayerForEachNode (double epiFraction, double endoFraction) |
void | WriteLayerForEachNode (std::string outputDir, std::string file) |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBoxOfEpi () |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBoxOfEndo () |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBoxOfLV () |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBoxOfRV () |
Static Public Attributes | |
static const HeartRegionType | LEFT_VENTRICLE_WALL =1001 |
static const HeartRegionType | RIGHT_VENTRICLE_WALL =1002 |
static const HeartRegionType | LEFT_SEPTUM =1003 |
static const HeartRegionType | RIGHT_SEPTUM =1004 |
static const HeartRegionType | LEFT_VENTRICLE_SURFACE =1005 |
static const HeartRegionType | RIGHT_VENTRICLE_SURFACE =1006 |
static const HeartRegionType | UNKNOWN =1007 |
Private Member Functions | |
void | GetNodesAtSurface (const std::string &rSurfaceFileName, std::vector< unsigned > &rSurfaceNodes, bool indexFromZero=true) const |
void | ProcessLine (const std::string &rLineFromFile, std::set< unsigned > &rSurfaceNodeIndexSet, unsigned offset) const |
double | GetDistanceToEndo (unsigned nodeIndex) |
double | GetDistanceToEpi (unsigned nodeIndex) |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBoxOfSurface (const std::vector< unsigned > &rSurfaceNodes) |
Private Attributes | |
std::vector< unsigned > | mEpiSurface |
std::vector< unsigned > | mEndoSurface |
std::vector< unsigned > | mLVSurface |
std::vector< unsigned > | mRVSurface |
AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > * | mpMesh |
std::vector< double > | mDistMapEpicardium |
std::vector< double > | mDistMapEndocardium |
std::vector< double > | mDistMapRightVentricle |
std::vector< double > | mDistMapLeftVentricle |
unsigned | mNumberOfSurfacesProvided |
std::vector< HeartLayerType > | mLayerForEachNode |
Static Private Attributes | |
static const double | LEFT_SEPTUM_SIZE = 2.0/3.0 |
static const double | RIGHT_SEPTUM_SIZE = 1.0/3.0 |
This class provides a method to calculate the relative position of a node with respect to two (or three) given surfaces.
Definition at line 62 of file HeartGeometryInformation.hpp.
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation | ( | AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > & | rMesh, |
const std::string & | rEpiFile, | ||
const std::string & | rEndoFile, | ||
bool | indexFromZero | ||
) |
Constructor for a two surface mesh. File formats: list of nodes, either one per line or multiple (e.g. nodes in each boundary element on surface).
rMesh | reference to the mesh |
rEpiFile | a file containing a list of global node indices on the epicardial surface |
rEndoFile | a file containing a list of global node indices on the endocardial surface |
indexFromZero | true for native triangles files. false for Memfem files which are indexed from 1. |
Definition at line 53 of file HeartGeometryInformation.cpp.
References DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface(), HeartGeometryInformation< SPACE_DIM >::mDistMapEndocardium, HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium, HeartGeometryInformation< SPACE_DIM >::mEndoSurface, HeartGeometryInformation< SPACE_DIM >::mEpiSurface, HeartGeometryInformation< SPACE_DIM >::mNumberOfSurfacesProvided, and HeartGeometryInformation< SPACE_DIM >::mpMesh.
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation | ( | AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > & | rMesh, |
const std::string & | rEpiFile, | ||
const std::string & | rLVFile, | ||
const std::string & | rRVFile, | ||
bool | indexFromZero | ||
) |
Constructor for a three surface mesh. File formats: list of nodes, either one per line or multiple (e.g. nodes in each boundary element on surface).
rMesh | reference to the mesh |
rEpiFile | a file containing a list of global node indices on the epicardial surface |
rRVFile | a file containing a list of global node indices on the endocardial right ventricular surface (can be empty string) |
rLVFile | a file containing a list of global node indices on the endocardial left ventricular surface (can be empty string) |
indexFromZero | true for native triangles files. false for Memfem files which are indexed from 1. |
If either rRVFile or rLVfile are the empty string, then it is assumed that this is a wedge preparation for left or right ventricle, respectively. That is, the ventricle with a non-empty string. If both are empty strings then throws exception.
Definition at line 72 of file HeartGeometryInformation.cpp.
References DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), EXCEPTION, HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface(), HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium, HeartGeometryInformation< SPACE_DIM >::mDistMapLeftVentricle, HeartGeometryInformation< SPACE_DIM >::mDistMapRightVentricle, HeartGeometryInformation< SPACE_DIM >::mEpiSurface, HeartGeometryInformation< SPACE_DIM >::mLVSurface, HeartGeometryInformation< SPACE_DIM >::mNumberOfSurfacesProvided, HeartGeometryInformation< SPACE_DIM >::mpMesh, and HeartGeometryInformation< SPACE_DIM >::mRVSurface.
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation | ( | std::string | nodeHeterogeneityFileName | ) |
Alternative constructor that takes in the file containing a list of numbers (as many as the number of nodes). Each number specifies the layer for the corresponding node.
This constructor should be called if the heterogeneities have /already/ been computed by an instance of this class and written to file by the WriteLayerForEachNode() method.
nodeHeterogeneityFileName | the file name. |
Definition at line 108 of file HeartGeometryInformation.cpp.
References EXCEPTION, HeartGeometryInformation< SPACE_DIM >::mLayerForEachNode, and HeartGeometryInformation< SPACE_DIM >::mpMesh.
|
inline |
Definition at line 341 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 330 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 352 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 363 of file HeartGeometryInformation.hpp.
|
private |
rSurfaceNodes | The indices of the nodes which represent this surface |
Definition at line 408 of file HeartGeometryInformation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistributedVectorFactory(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), DistributedVectorFactory::IsGlobalIndexLocal(), and HeartGeometryInformation< SPACE_DIM >::mpMesh.
Referenced by HeartGeometryInformation< ELEMENT_DIM >::CalculateBoundingBoxOfEndo(), HeartGeometryInformation< ELEMENT_DIM >::CalculateBoundingBoxOfEpi(), HeartGeometryInformation< ELEMENT_DIM >::CalculateBoundingBoxOfLV(), and HeartGeometryInformation< ELEMENT_DIM >::CalculateBoundingBoxOfRV().
double HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition | ( | unsigned | nodeIndex | ) |
nodeIndex | index is the index of the node in the mesh |
Definition at line 331 of file HeartGeometryInformation.cpp.
References HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetDistanceToEpi().
Referenced by HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode(), and HeartGeometryInformation< ELEMENT_DIM >::rGetLayerForEachNode().
void HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode | ( | double | epiFraction, |
double | endoFraction | ||
) |
Compute which layer (endocardial, midmyocardial or epicardial) each node is in
epiFraction | is the fraction of wall designed to be epicardial layer |
endoFraction | is the fraction of wall designed to be endocardial layer |
Definition at line 346 of file HeartGeometryInformation.cpp.
References HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition(), EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), HeartGeometryInformation< SPACE_DIM >::mLayerForEachNode, and HeartGeometryInformation< SPACE_DIM >::mpMesh.
Referenced by HeartConfigRelatedCellFactory< SPACE_DIM >::FillInCellularTransmuralAreas(), and HeartGeometryInformation< ELEMENT_DIM >::rGetLayerForEachNode().
|
private |
Helper method to calculate the distance between the node and the Endocardial surface as defined to be the closest surface to the node out of left ventricle and right ventricle.
nodeIndex | is the index of the node in the mesh |
Definition at line 270 of file HeartGeometryInformation.cpp.
References HeartGeometryInformation< SPACE_DIM >::GetHeartRegion(), HeartGeometryInformation< SPACE_DIM >::LEFT_SEPTUM, HeartGeometryInformation< SPACE_DIM >::LEFT_VENTRICLE_SURFACE, HeartGeometryInformation< SPACE_DIM >::LEFT_VENTRICLE_WALL, HeartGeometryInformation< SPACE_DIM >::mDistMapEndocardium, HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium, HeartGeometryInformation< SPACE_DIM >::mDistMapLeftVentricle, HeartGeometryInformation< SPACE_DIM >::mDistMapRightVentricle, HeartGeometryInformation< SPACE_DIM >::mNumberOfSurfacesProvided, NEVER_REACHED, HeartGeometryInformation< SPACE_DIM >::RIGHT_SEPTUM, HeartGeometryInformation< SPACE_DIM >::RIGHT_VENTRICLE_SURFACE, HeartGeometryInformation< SPACE_DIM >::RIGHT_VENTRICLE_WALL, and HeartGeometryInformation< SPACE_DIM >::UNKNOWN.
Referenced by HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition().
|
private |
Helper method to calculate the distance between the node and the Epicardial surface
nodeIndex | is the index of the node in the mesh |
Definition at line 325 of file HeartGeometryInformation.cpp.
References HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium.
Referenced by HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition().
HeartRegionType HeartGeometryInformation< SPACE_DIM >::GetHeartRegion | ( | unsigned | nodeIndex | ) | const |
nodeIndex | index is the index of the node in the mesh |
Definition at line 236 of file HeartGeometryInformation.cpp.
References HeartGeometryInformation< SPACE_DIM >::LEFT_SEPTUM, HeartGeometryInformation< SPACE_DIM >::LEFT_SEPTUM_SIZE, HeartGeometryInformation< SPACE_DIM >::LEFT_VENTRICLE_WALL, HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium, HeartGeometryInformation< SPACE_DIM >::mDistMapLeftVentricle, HeartGeometryInformation< SPACE_DIM >::mDistMapRightVentricle, NEVER_REACHED, HeartGeometryInformation< SPACE_DIM >::RIGHT_SEPTUM, HeartGeometryInformation< SPACE_DIM >::RIGHT_VENTRICLE_WALL, and HeartGeometryInformation< SPACE_DIM >::UNKNOWN.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo().
|
private |
Takes in a file of all the nodes on ONE PARTICULAR surface of the mesh (eg the right ventricular endo-cardial surface) and collects all the nodes on that surface in one vector.
rSurfaceFileName | The surface file, lists global node indices on this surface. The number of lines in this file and entries per line doesn't matter. Just have to be separated by whitespace and returns. But these files would tend to be: EITHER: multiple entries on one line – all nodes in each boundary element, OR: simply a list of the nodes on the surface. |
rSurfaceNodes | The returned vector of nodes indices on this surface |
indexFromZero | True for native triangles files. False for Memfem files which are indexed from 1. |
Definition at line 176 of file HeartGeometryInformation.cpp.
References EXCEPTION, HeartGeometryInformation< SPACE_DIM >::mpMesh, HeartGeometryInformation< SPACE_DIM >::ProcessLine(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::rGetNodePermutation().
Referenced by HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation().
|
private |
Helper function for GetNodesAtSurface
rLineFromFile | A line in a surface file. |
rSurfaceNodeIndexSet | The nodes in the element corresponding to this line. |
offset | is the lowest index of a node in the original mesh (0 for native triangles or 1 for MEMFEM). |
Definition at line 156 of file HeartGeometryInformation.cpp.
References EXCEPTION.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface().
|
inline |
Definition at line 237 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 228 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 257 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 247 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 294 of file HeartGeometryInformation.hpp.
Referenced by HeartConfigRelatedCellFactory< SPACE_DIM >::FillInCellularTransmuralAreas().
|
inline |
Definition at line 271 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 264 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 278 of file HeartGeometryInformation.hpp.
|
inline |
Definition at line 285 of file HeartGeometryInformation.hpp.
void HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode | ( | std::string | outputDir, |
std::string | file | ||
) |
Write the layer for each node. DetermineLayerForEachNode() must have been called first.
outputDir | Output directory - note not cleaned |
file | Output file |
Definition at line 378 of file HeartGeometryInformation.cpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), HeartGeometryInformation< SPACE_DIM >::mLayerForEachNode, HeartGeometryInformation< SPACE_DIM >::mpMesh, and OutputFileHandler::OpenOutputFile().
Referenced by HeartGeometryInformation< ELEMENT_DIM >::rGetLayerForEachNode().
|
static |
Left portion of the septum
Definition at line 162 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().
|
staticprivate |
Area of the septum considered to belong to the left septum (relative to 1)
Definition at line 67 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().
|
static |
Endocardial surface of the left ventricle
Definition at line 166 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo().
|
static |
Left ventricular wall
Definition at line 158 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().
|
private |
Vector to store the distance map to endocardium
Definition at line 134 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetDistanceMapEndocardium().
|
private |
Vector to store the distance map to epicardium
Definition at line 131 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), HeartGeometryInformation< SPACE_DIM >::GetDistanceToEpi(), HeartGeometryInformation< SPACE_DIM >::GetHeartRegion(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetDistanceMapEpicardium().
|
private |
Vector to store the distance map to the left ventricle surface
Definition at line 140 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), HeartGeometryInformation< SPACE_DIM >::GetHeartRegion(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetDistanceMapLeftVentricle().
|
private |
Vector to store the distance map to the right ventricle surface
Definition at line 137 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), HeartGeometryInformation< SPACE_DIM >::GetHeartRegion(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetDistanceMapRightVentricle().
|
private |
The nodes on the endocardial surface (only used in the 2 surface case)
Definition at line 75 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetNodesOnEndoSurface().
|
private |
The nodes on the epicardial surface
Definition at line 72 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetNodesOnEpiSurface().
|
private |
Vector to store the layer for each node
Definition at line 146 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), HeartGeometryInformation< ELEMENT_DIM >::rGetLayerForEachNode(), and HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode().
|
private |
The nodes on the endocardial left ventricular surface (only used in the 3 surface case)
Definition at line 78 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetNodesOnLVSurface().
|
private |
Flag used to tell the methods whether two or three surfaces have been supplied
Definition at line 143 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation().
|
private |
The mesh of the problem
Definition at line 128 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfSurface(), HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode(), HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface(), HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode().
|
private |
The nodes on the endocardial right ventricular surface (only used in the 3 surface case)
Definition at line 81 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation(), and HeartGeometryInformation< ELEMENT_DIM >::rGetNodesOnRVSurface().
|
static |
Right portion of the septum
Definition at line 164 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().
|
staticprivate |
Area of the septum considered to belong to the right septum (relative to 1)
Definition at line 69 of file HeartGeometryInformation.hpp.
|
static |
Endocardial surface of the right ventricle
Definition at line 168 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo().
|
static |
Right ventricular wall
Definition at line 160 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().
|
static |
Unknown node type (should never occur...)
Definition at line 170 of file HeartGeometryInformation.hpp.
Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().