[Insight-users] about itk::mesh

barbababa tonimuusimaki at gmail.com
Tue Mar 20 11:58:39 EDT 2012


Though i have tried, i can not seem to be able to fix this:

Why does this:

    const int dim = 3;
    typedef unsigned char PType;
    typedef itk::Image< PType, dim > IType;

    typedef itk::ImageFileReader< IType > ReaderType;
    ReaderType::Pointer reader = ReaderType::New();
    reader->SetFileName( argv[fi] );
    reader->Update();    

    typedef itk::Mesh<double>                           MeshType;
    typedef MeshType::PointType                       PointType;
    typedef itk::BinaryMask3DMeshSource< IType, MeshType >   MeshSourceType;
    MeshSourceType::Pointer meshSource = MeshSourceType::New();
    meshSource->SetInput( reader->GetOutput() );
    meshSource->SetObjectValue( 255 );
   double isurf = 0;
      MeshType * mesh = meshSource->GetOutput();

      for( MeshSourceType::OutputMeshType::CellsContainerConstIterator it =
mesh->GetCells()->Begin(); it != mesh->GetCells()->End(); ++it )
        {
        const MeshType::CellType::PointIdentifierContainerType & pids =
it.Value()->GetPointIdsContainer();
        PointType p0 = mesh->GetPoint(pids[0]);
        PointType p1 = mesh->GetPoint(pids[1]);
        PointType p2 = mesh->GetPoint(pids[2]);
        isurf += itk::TriangleHelper<PointType>::ComputeArea(p0, p1, p2);
        }
  
      }




Produce an error:





check.cxx(210) : error C2039: 'PointIdentifierContainerType' : is not a
member of 'itk::CellInterface'
1> with
1> [
1> TPixelType=double,
1>
TCellTraits=itk::CellTraitsInfo<3,float,float,itk::DefaultStaticMeshTraits::PointIdentifier,itk::DefaultStaticMeshTraits::CellIdentifier,itk::DefaultStaticMeshTraits::CellFeatureIdentifier,itk::Point,itk::VectorContainer::PointIdentifier,itk::Point>,itk::DefaultStaticMeshTraits::UsingCellsContainer>
1> ]
1>..check.cxx(210) : error C4430: missing type specifier - int assumed.
Note: C++ does not support default-int
1>..check.cxx(210) : error C2143: syntax error : missing ';' before '&'
1>..check.cxx(210) : error C2065: 'pids' : undeclared identifier
1>..check.cxx(210) : error C2039: 'GetPointIdsContainer' : is not a member
of 'itk::CellInterface'
1> with
1> [
1> TPixelType=double,
1>
TCellTraits=itk::CellTraitsInfo<3,float,float,itk::DefaultStaticMeshTraits::PointIdentifier,itk::DefaultStaticMeshTraits::CellIdentifier,itk::DefaultStaticMeshTraits::CellFeatureIdentifier,itk::Point,itk::VectorContainer::PointIdentifier,itk::Point>,itk::DefaultStaticMeshTraits::UsingCellsContainer>
1> ]
1>..check.cxx(211) : error C2065: 'pids' : undeclared identifier
1>..check.cxx(211) : error C2660: 'itk::PointSet::GetPoint' : function does
not take 1 arguments
1> with
1> [
1> TPixelType=double,
1> VDimension=3,
1> TMeshTraits=itk::DefaultStaticMeshTraits
1> ]
1>..check.cxx(212) : error C2065: 'pids' : undeclared identifier
1>..check.cxx(212) : error C2660: 'itk::PointSet::GetPoint' : function does
not take 1 arguments
1> with
1> [
1> TPixelType=double,
1> VDimension=3,
1> TMeshTraits=itk::DefaultStaticMeshTraits
1> ]
1>..check.cxx(213) : error C2065: 'pids' : undeclared identifier
1>..check.cxx(213) : error C2660: 'itk::PointSet::GetPoint' : function does
not take 1 arguments
1> with
1> [
1> TPixelType=double,
1> VDimension=3,
1> TMeshTraits=itk::DefaultStaticMeshTraits
1> ]


I checked that PointIdentifierContainerType is a static public attribute. So
could this be some static vs non-static calling problem????

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/about-itk-mesh-tp7389563p7389563.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list