Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. void cmSurfs::processSurface()
  2. //------------------------------------------------------------------
  3. {
  4. vtkPolyData *vtkPDaux(vtkPolyData::New()), *vtkPDaux1;
  5. vtkPolyData *subpart_Surface[4];
  6.  
  7. SplitSurface(subpart_Surface);
  8.  
  9. if (m_meshType==LV_mesh || m_meshType==biV_mesh) {
  10. for(int i=0; i<m_NroSurfs; i++)
  11. { ////// 0: lv_endo, 1: lv_epi, 2: rv_endo, 3: rv_epi ////////
  12. // calculates the normals to every surface cell
  13. subpart_normals_array[i] = vtkDoubleArray::New();
  14. cmUtils::ComputeSurfaceNormals(subpart_Surface[i], subpart_normals_array[i]);
  15. // initialize point and cell locators, used to speed up searching of closest points;
  16. subpart_cellLocator[i] = vtkCellLocator::New();
  17. subpart_cellLocator[i]->SetDataSet(subpart_Surface[i]);
  18. subpart_cellLocator[i]->BuildLocator();
  19. }
  20.  
  21. // extract anatomical landmarks: 'mitral centroid' and 'apex' using subpart_Surface[0]: lv_endo
  22. cmUtils::GetPolyDataEdge(subpart_Surface[0],vtkPDaux,0)->GetCenter(m_mitralCentroid);
  23. cmUtils::GetFurthestPoint(subpart_Surface[0],m_mitralCentroid,m_apex);
  24. CalculateLVaxisDirectionAndLength();
  25.  
  26. //SetInitPkjPt();
  27. //SetExtraPkjPt(subpart_Surface[0],m_mitralCentroid,m_initPkjPt,m_apex,m_extraPkjPt,0);
  28.  
  29. if (m_meshType==biV_mesh) {
  30. vtkPDaux1=vtkPolyData::New();
  31. vtkPDaux1=cmUtils::GetPolyDataRegion(m_surfsPd, vtkPDaux1, ID_RV_an, ID_RV_an, m_scalarIDname.c_str());
  32. if (vtkPDaux1) {
  33. vtkPDaux1->GetCenter(m_RVanCentre); vtkPDaux1->Delete();
  34. } else {
  35. // *** cmUtils::ExitMessage(" processSurface... : couldn't define RVanCentre will be problems adding fixed Pkj");
  36. for(int i=0; i<3; i++) m_RVanCentre[i]=0.0;
  37. }
  38. cmUtils::GetClosestPoint(subpart_Surface[2],m_apex,m_RVapex);
  39. // SetExtraPkjPt(subpart_Surface[2],m_RVanCentre,m_initPkjPt,m_RVapex,m_RVextraPkjPt,2);
  40. }
  41.  
  42. vtkPDaux->Delete(); vtkPDaux = vtkPolyData::New(); // cleans the PolyData structure. IS THIS REQUIRED?
  43. vtkPDaux = cmUtils::GetPolyDataRegion(m_surfsPd, vtkPDaux, ID_leftPK, ID_leftPK, m_scalarIDname.c_str()); // gets left Purkinje points from surface
  44. m_hasPurkinje = (vtkPDaux ? true : false);
  45.  
  46. if (vtkPDaux) vtkPDaux->Delete();
  47. } else cmUtils::ExitMessage(" processSurface... : problems processing surface. Only works with biventricular or left ventricle surface meshes");
  48.  
  49. for(int i=0; i<m_NroSurfs; i++) subpart_Surface[i]->Delete();
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement