[Insight-users] output of the ConformalFlatteningMeshFilter is a black circle any ideas???

Muhammad Zeshan Afzal thebrandconcious at gmail.com
Thu Oct 6 19:24:57 EDT 2011


Hi,
     I am trying to use ConformalFlatteningMeshFilter. The output of
the filter is black for my case. Following is the code which has been
used. It is a modified version of the code submitted to the Insight
Journal by Mr. Y. Gao and can be found under the following link
http://www.insight-journal.org/browse/publication/112.  I am applying
it to the brain data which can also be found at the same link. I have
just changed it to reflect the class names and the method names given
in the relaese 3.2.

Code is as follows


  // Convert from vtkPolyData to ITKMesh
 // This function can originally be  found in the shipped code by Mr.Gao
  MeshType::Pointer  mesh = vtkPolyDataToITKMesh( polyData );

  //Here is the modified class name
  typedef itk::ConformalFlatteningMeshFilter< MeshType, MeshType>  FilterType;
  FilterType::Pointer filter = FilterType::New();

  //Setting the data and other method parameters
  filter->SetInput( mesh );
  filter->SetPolarCellIdentifier(100000);

  filter->MapToSphere();
  filter->SetScale( 5000 );

  // Execute the filter
  filter->Update();

  // Get the Smart Pointer to the Filter Output
  MeshType::Pointer newMesh = filter->GetOutput();

  // END itkConformalFlatteningFilter
  ///////////////////////////////////////////////////////////////////////

  // Convert from ITKMesh to vtkPolyData
  // This method can also be found in the code pf Mr. Y.Gao
  vtkPolyData* newPolyData = ITKMeshToVtkPolyData( newMesh );

  // Display the new polydata
  newPolyData->GetPointData()->SetScalars(
curv1->GetOutput()->GetPointData()->GetScalars() );
  // This function also give by Mr.Y Gao
  Display(newPolyData);


Thanks a lot

Cheers
M. Zeshan Afzal


More information about the Insight-users mailing list