HeartGeometryInformation< SPACE_DIM > Class Template Reference

#include <HeartGeometryInformation.hpp>

Inheritance diagram for HeartGeometryInformation< SPACE_DIM >:

Inheritance graph
[legend]
Collaboration diagram for HeartGeometryInformation< SPACE_DIM >:

Collaboration graph
[legend]

List of all members.

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 &surfaceFile, std::vector< unsigned > &rSurfaceNodes, bool indexFromZero=true) const
void ProcessLine (const std::string &line, 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


Detailed Description

template<unsigned SPACE_DIM>
class HeartGeometryInformation< SPACE_DIM >

This class provides a method to calculate the relative position of a node with respect to two (or three) given surfaces

Definition at line 55 of file HeartGeometryInformation.hpp.


Constructor & Destructor Documentation

template<unsigned SPACE_DIM>
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation ( AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &  rMesh,
const std::string &  rEpiFile,
const std::string &  rEndoFile,
bool  indexFromZero 
) [inline]

Constructor for a two surface mesh

Parameters:
rMesh,: reference to the mesh
rEpiFile,: file of elements on the epicardial surface
rEndoFile,: file of elements on the endocardial surface
indexFromZero true for native triangles files. false for Memfem files which are indexed from 1.

Definition at line 46 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.

template<unsigned SPACE_DIM>
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation ( AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > &  rMesh,
const std::string &  rEpiFile,
const std::string &  rLVFile,
const std::string &  rRVFile,
bool  indexFromZero 
) [inline]

Constructor for a three surface mesh

Parameters:
rMesh,: reference to the mesh
rEpiFile,: file of elements on the epicardial surface
rRVFile,: file of elements on the endocardial right ventricular surface
rLVFile,: file of elements on the endocardial left ventricular surface
indexFromZero true for native triangles files. false for Memfem files which are indexed from 1.

Definition at line 65 of file HeartGeometryInformation.cpp.

References DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), 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.

template<unsigned SPACE_DIM>
HeartGeometryInformation< SPACE_DIM >::HeartGeometryInformation ( std::string  nodeHeterogeneityFileName  )  [inline]

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.

Parameters:
nodeHeterogeneityFileName the file name.

Definition at line 90 of file HeartGeometryInformation.cpp.

References EXCEPTION, HeartGeometryInformation< SPACE_DIM >::mLayerForEachNode, and HeartGeometryInformation< SPACE_DIM >::mpMesh.


Member Function Documentation

template<unsigned SPACE_DIM>
void HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface ( const std::string &  surfaceFile,
std::vector< unsigned > &  rSurfaceNodes,
bool  indexFromZero = true 
) const [inline, private]

Takes in a file of all the surface elements 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

Parameters:
surfaceFile The surface file
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 161 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().

template<unsigned SPACE_DIM>
void HeartGeometryInformation< SPACE_DIM >::ProcessLine ( const std::string &  line,
std::set< unsigned > &  rSurfaceNodeIndexSet,
unsigned  offset 
) const [inline, private]

Helper function for GetNodesAtSurface

Parameters:
line 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 142 of file HeartGeometryInformation.cpp.

References EXCEPTION.

Referenced by HeartGeometryInformation< SPACE_DIM >::GetNodesAtSurface().

template<unsigned SPACE_DIM>
double HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo ( unsigned  nodeIndex  )  [inline, private]

template<unsigned SPACE_DIM>
double HeartGeometryInformation< SPACE_DIM >::GetDistanceToEpi ( unsigned  nodeIndex  )  [inline, private]

Helper method to calculate the distance between the node and the Epicardial surface

Parameters:
nodeIndex is the index of the node in the mesh
Returns:
the distance

Definition at line 309 of file HeartGeometryInformation.cpp.

References HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium.

Referenced by HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition().

template<unsigned SPACE_DIM>
ChasteCuboid< SPACE_DIM > HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfSurface ( const std::vector< unsigned > &  rSurfaceNodes  )  [inline, private]

template<unsigned SPACE_DIM>
HeartRegionType HeartGeometryInformation< SPACE_DIM >::GetHeartRegion ( unsigned  nodeIndex  )  const [inline]

template<unsigned SPACE_DIM>
std::vector<double>& HeartGeometryInformation< SPACE_DIM >::rGetDistanceMapEpicardium (  )  [inline]

Returns:
the distance map to the epicardium

Definition at line 207 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
std::vector<double>& HeartGeometryInformation< SPACE_DIM >::rGetDistanceMapEndocardium (  )  [inline]

Returns:
the distance map to the endocardium

Definition at line 216 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
std::vector<double>& HeartGeometryInformation< SPACE_DIM >::rGetDistanceMapRightVentricle (  )  [inline]

Returns:
the distance map to the right ventricle

Definition at line 226 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
std::vector<double>& HeartGeometryInformation< SPACE_DIM >::rGetDistanceMapLeftVentricle (  )  [inline]

Returns:
the distance map to the left ventricle

Definition at line 236 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
const std::vector<unsigned>& HeartGeometryInformation< SPACE_DIM >::rGetNodesOnEpiSurface (  )  [inline]

Get the nodes on the epicardial surface

Definition at line 243 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
const std::vector<unsigned>& HeartGeometryInformation< SPACE_DIM >::rGetNodesOnEndoSurface (  )  [inline]

Get the nodes on the endocardial surface

Definition at line 250 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
const std::vector<unsigned>& HeartGeometryInformation< SPACE_DIM >::rGetNodesOnLVSurface (  )  [inline]

Get the nodes on the endocardial left ventricular surface

Definition at line 257 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
const std::vector<unsigned>& HeartGeometryInformation< SPACE_DIM >::rGetNodesOnRVSurface (  )  [inline]

Get the nodes on the endocardial right ventricular surface

Definition at line 264 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
const std::vector<HeartLayerType>& HeartGeometryInformation< SPACE_DIM >::rGetLayerForEachNode (  )  [inline]

Get the layer for every node in the mesh.

Definition at line 273 of file HeartGeometryInformation.hpp.

Referenced by HeartConfigRelatedCellFactory< SPACE_DIM >::FillInCellularTransmuralAreas().

template<unsigned SPACE_DIM>
double HeartGeometryInformation< SPACE_DIM >::CalculateRelativeWallPosition ( unsigned  nodeIndex  )  [inline]

Calculates the relative position within the wall thickness (normalised to [0,1])

Parameters:
nodeIndex index is the index of the node in the mesh
Returns:
the relative position

Definition at line 315 of file HeartGeometryInformation.cpp.

References HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetDistanceToEpi().

Referenced by HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode().

template<unsigned SPACE_DIM>
void HeartGeometryInformation< SPACE_DIM >::DetermineLayerForEachNode ( double  epiFraction,
double  endoFraction 
) [inline]

Compute which layer (endocardial, midmyocardial or epicardial) each node is in

Parameters:
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 330 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().

template<unsigned SPACE_DIM>
void HeartGeometryInformation< SPACE_DIM >::WriteLayerForEachNode ( std::string  outputDir,
std::string  file 
) [inline]

Write the layer for each node. DetermineLayerForEachNode() must have been called first.

Parameters:
outputDir Output directory - note not cleaned
file Output file

Definition at line 363 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().

template<unsigned SPACE_DIM>
ChasteCuboid<SPACE_DIM> HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfEpi (  )  [inline]

Uses CalculateBoundingBoxOfSurface to calculate an axis-aligned bounding box of the nodes in the input epicardial surface

Definition at line 308 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
ChasteCuboid<SPACE_DIM> HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfEndo (  )  [inline]

Uses CalculateBoundingBoxOfSurface to calculate an axis-aligned bounding box of the nodes in the input endocardial surface

Definition at line 318 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
ChasteCuboid<SPACE_DIM> HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfLV (  )  [inline]

Uses CalculateBoundingBoxOfSurface to calculate an axis-aligned bounding box of the nodes in the input endocardial left ventricular surface

Definition at line 328 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
ChasteCuboid<SPACE_DIM> HeartGeometryInformation< SPACE_DIM >::CalculateBoundingBoxOfRV (  )  [inline]

Uses CalculateBoundingBoxOfSurface to calculate an axis-aligned bounding box of the nodes in the input endocardial left ventricular surface

Definition at line 338 of file HeartGeometryInformation.hpp.


Member Data Documentation

template<unsigned SPACE_DIM>
const double HeartGeometryInformation< SPACE_DIM >::LEFT_SEPTUM_SIZE = 2.0/3.0 [inline, static, private]

Area of the septum considered to belong to the left septum (relative to 1)

Definition at line 60 of file HeartGeometryInformation.hpp.

Referenced by HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().

template<unsigned SPACE_DIM>
const double HeartGeometryInformation< SPACE_DIM >::RIGHT_SEPTUM_SIZE = 1.0/3.0 [inline, static, private]

Area of the septum considered to belong to the right septum (relative to 1)

Definition at line 62 of file HeartGeometryInformation.hpp.

template<unsigned SPACE_DIM>
std::vector<unsigned> HeartGeometryInformation< SPACE_DIM >::mEpiSurface [private]

template<unsigned SPACE_DIM>
std::vector<unsigned> HeartGeometryInformation< SPACE_DIM >::mEndoSurface [private]

template<unsigned SPACE_DIM>
std::vector<unsigned> HeartGeometryInformation< SPACE_DIM >::mLVSurface [private]

template<unsigned SPACE_DIM>
std::vector<unsigned> HeartGeometryInformation< SPACE_DIM >::mRVSurface [private]

template<unsigned SPACE_DIM>
AbstractTetrahedralMesh<SPACE_DIM,SPACE_DIM>* HeartGeometryInformation< SPACE_DIM >::mpMesh [private]

template<unsigned SPACE_DIM>
std::vector<double> HeartGeometryInformation< SPACE_DIM >::mDistMapEpicardium [private]

template<unsigned SPACE_DIM>
std::vector<double> HeartGeometryInformation< SPACE_DIM >::mDistMapEndocardium [private]

template<unsigned SPACE_DIM>
std::vector<double> HeartGeometryInformation< SPACE_DIM >::mDistMapRightVentricle [private]

template<unsigned SPACE_DIM>
std::vector<double> HeartGeometryInformation< SPACE_DIM >::mDistMapLeftVentricle [private]

template<unsigned SPACE_DIM>
unsigned HeartGeometryInformation< SPACE_DIM >::mNumberOfSurfacesProvided [private]

template<unsigned SPACE_DIM>
std::vector<HeartLayerType> HeartGeometryInformation< SPACE_DIM >::mLayerForEachNode [private]

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::LEFT_VENTRICLE_WALL = 1001 [static]

Todo:
#1703 Perhaps add these constants to HeartConfig...
Left ventricular wall

Definition at line 143 of file HeartGeometryInformation.hpp.

Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo(), and HeartGeometryInformation< SPACE_DIM >::GetHeartRegion().

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::RIGHT_VENTRICLE_WALL = 1002 [static]

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::LEFT_SEPTUM = 1003 [static]

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::RIGHT_SEPTUM = 1004 [static]

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::LEFT_VENTRICLE_SURFACE = 1005 [static]

Endocardial surface of the left ventricle

Definition at line 151 of file HeartGeometryInformation.hpp.

Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo().

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::RIGHT_VENTRICLE_SURFACE = 1006 [static]

Endocardial surface of the right ventricle

Definition at line 153 of file HeartGeometryInformation.hpp.

Referenced by HeartGeometryInformation< SPACE_DIM >::GetDistanceToEndo().

template<unsigned SPACE_DIM>
const HeartRegionType HeartGeometryInformation< SPACE_DIM >::UNKNOWN = 1007 [static]


The documentation for this class was generated from the following files:

Generated on Tue May 31 14:33:31 2011 for Chaste by  doxygen 1.5.5