Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void cmSurfs::processSurface()
- //------------------------------------------------------------------
- {
- vtkPolyData *vtkPDaux(vtkPolyData::New()), *vtkPDaux1;
- vtkPolyData *subpart_Surface[4];
- SplitSurface(subpart_Surface);
- if (m_meshType==LV_mesh || m_meshType==biV_mesh) {
- for(int i=0; i<m_NroSurfs; i++)
- { ////// 0: lv_endo, 1: lv_epi, 2: rv_endo, 3: rv_epi ////////
- // calculates the normals to every surface cell
- subpart_normals_array[i] = vtkDoubleArray::New();
- cmUtils::ComputeSurfaceNormals(subpart_Surface[i], subpart_normals_array[i]);
- // initialize point and cell locators, used to speed up searching of closest points;
- subpart_cellLocator[i] = vtkCellLocator::New();
- subpart_cellLocator[i]->SetDataSet(subpart_Surface[i]);
- subpart_cellLocator[i]->BuildLocator();
- }
- // extract anatomical landmarks: 'mitral centroid' and 'apex' using subpart_Surface[0]: lv_endo
- cmUtils::GetPolyDataEdge(subpart_Surface[0],vtkPDaux,0)->GetCenter(m_mitralCentroid);
- cmUtils::GetFurthestPoint(subpart_Surface[0],m_mitralCentroid,m_apex);
- CalculateLVaxisDirectionAndLength();
- //SetInitPkjPt();
- //SetExtraPkjPt(subpart_Surface[0],m_mitralCentroid,m_initPkjPt,m_apex,m_extraPkjPt,0);
- if (m_meshType==biV_mesh) {
- vtkPDaux1=vtkPolyData::New();
- vtkPDaux1=cmUtils::GetPolyDataRegion(m_surfsPd, vtkPDaux1, ID_RV_an, ID_RV_an, m_scalarIDname.c_str());
- if (vtkPDaux1) {
- vtkPDaux1->GetCenter(m_RVanCentre); vtkPDaux1->Delete();
- } else {
- // *** cmUtils::ExitMessage(" processSurface... : couldn't define RVanCentre will be problems adding fixed Pkj");
- for(int i=0; i<3; i++) m_RVanCentre[i]=0.0;
- }
- cmUtils::GetClosestPoint(subpart_Surface[2],m_apex,m_RVapex);
- // SetExtraPkjPt(subpart_Surface[2],m_RVanCentre,m_initPkjPt,m_RVapex,m_RVextraPkjPt,2);
- }
- vtkPDaux->Delete(); vtkPDaux = vtkPolyData::New(); // cleans the PolyData structure. IS THIS REQUIRED?
- vtkPDaux = cmUtils::GetPolyDataRegion(m_surfsPd, vtkPDaux, ID_leftPK, ID_leftPK, m_scalarIDname.c_str()); // gets left Purkinje points from surface
- m_hasPurkinje = (vtkPDaux ? true : false);
- if (vtkPDaux) vtkPDaux->Delete();
- } else cmUtils::ExitMessage(" processSurface... : problems processing surface. Only works with biventricular or left ventricle surface meshes");
- for(int i=0; i<m_NroSurfs; i++) subpart_Surface[i]->Delete();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement