[Insight-users] question about save itkMesh

Quan Xue qxue at jouy.inra.fr
Wed Sep 5 08:47:03 EDT 2007


Hello:
      Thank for your responce.
      To the itkVTKPolyDataWriter, this filter uses the triangular data, 
which can be transfered from vtkPolyData by the vtk filter. 
      Should the pipeline  be "itkMesh -> vtkPolydata 
->vtkTriangle->itkVTKPolyDataWriter"?
      But I meet with the question in itkmesh to vtkpolydata. The 
existing class to transfer itkmesh is mainly defined by "itk::Mesh< 
double, 2, class::DefaultStaticmeshTraits<double, 2, 2, double, double, 
double, double> >". Yet the meshtype is defined "itk::Mesh< 
itk::Point<float,2>, 2, class::DefaultStaticMeshTraits<itk::Point<float, 
2>, 2, 2, float, float, itk::Point<float, 2> > >".
      i am in trouble to transfer the vector point to scalar point, that 
is from itk::Point<float, 2> to double(float).
      Best regards,
Quan
     
    

Luis Ibanez a écrit :
>
> Hi Quan,
>
> You may want to use the class
>
>      Insight/Code/Review/
>         itkVTKPolyDataWriter.*
>
>
> Note that you will have to insert a small
> modification, since this class assumes that
> the Mesh is a 3D mesh composed of triangular
> faces.
>
> In you case, however you have a polyline.
>
> ....
>
> Note that the Curve2DExtractor *DOES NOT* form
> lines. It only detects pixels that are good
> candidate to be part of a line.  I assume that
> somehow you are venturing to connecting pixels
> with their close neighbors in order to form lines.
>
>
>   Is that the case ?
>
>
>     Please let us know,
>
>
>       Thanks
>
>
>          Luis
>
>
> --------------------
> Quan Xue wrote:
>> Hello, ITK users:
>>        I meet with a question to save itkMesh object from 
>> Curves2DExtractor in InsightApplication into disk.
>>        From the mail list, I am trying to change teh itkMesh to 
>> vtkPolyData based on examples in vtk2itk.cxx, but I have the errors 
>> to tell me that the parameter should be converted.
>>        in vtk2itk the mesh type is defined as
>> typedef itk::Mesh< float, 3, itk::DefaultStaticMeshTraits<float, 3, 
>> 3, float, float> >floatMesh.
>>       but in ceExtractorConsoleBase.h
>> typedef itk::Point<float, 2> MeshPointDataType;
>> typedef itk::Mesh<MeshPointDataType, 3> MeshType
>> typedef itk::Mesh<MeshType::PointType, 2> ImageSpaceMeshType
>>      the error information is followed
>> error C2664: 'AddVisitor' : cannot convert parameter 1 from 'class 
>> itk::SmartPointer<class 
>> itk::CellInterfaceVisitorImplementation<double,class 
>> itk::CellTraitsInfo<2,float,float,u
>> nsigned long,unsigned long,unsigned long,class 
>> itk::Point<float,2>,class itk::VectorContainer<unsigned long,class 
>> itk::Point<float,2> >,class std::set<unsigned long,struct 
>> std::less<unsigned long>,class std::allocator<unsigned long> > 
>> >,class itk::T
>> riangleCell<class itk::CellInterface<class itk::Point<float,3>,class 
>> itk::CellTraitsInfo<2,float,float,unsigned long,unsigned 
>> long,unsigned long,class itk::Point<float,2>,class 
>> itk::VectorContainer<unsigned long,class itk::Point<float,2> >,class std
>> ::set<unsigned long,struct std::less<unsigned long>,class 
>> std::allocator<unsigned long> > > > >,class itk::VistVTKCellsClass> 
>> >' to 'class itk::CellInterfaceVisitor<class 
>> itk::Point<float,3>,class itk::CellTraitsInfo<2,float,float,unsigned 
>> long,unsi
>> gned long,unsigned long,class itk::Point<float,2>,class 
>> itk::VectorContainer<unsigned long,class itk::Point<float,2> >,class 
>> std::set<unsigned long,struct std::less<unsigned long>,class 
>> std::allocator<unsigned long> > > > *'
>>        No user-defined-conversion operator available that can perform 
>> this conversion, or the operator cannot be called
>> error C2664: 'AddVisitor' : cannot convert parameter 1 from 'class 
>> itk::SmartPointer<class 
>> itk::CellInterfaceVisitorImplementation<double,class 
>> itk::CellTraitsInfo<2,float,float,u
>> nsigned long,unsigned long,unsigned long,class 
>> itk::Point<float,2>,class itk::VectorContainer<unsigned long,class 
>> itk::Point<float,2> >,class std::set<unsigned long,struct 
>> std::less<unsigned long>,class std::allocator<unsigned long> > 
>> >,class itk::Q
>> uadrilateralCell<class itk::CellInterface<class 
>> itk::Point<float,3>,class itk::CellTraitsInfo<2,float,float,unsigned 
>> long,unsigned long,unsigned long,class itk::Point<float,2>,class 
>> itk::VectorContainer<unsigned long,class itk::Point<float,2> >,clas
>> s std::set<unsigned long,struct std::less<unsigned long>,class 
>> std::allocator<unsigned long> > > > >,class itk::VistVTKCellsClass> 
>> >' to 'class itk::CellInterfaceVisitor<class 
>> itk::Point<float,3>,class itk::CellTraitsInfo<2,float,float,unsigned 
>> long
>> ,unsigned long,unsigned long,class itk::Point<float,2>,class 
>> itk::VectorContainer<unsigned long,class itk::Point<float,2> >,class 
>> std::set<unsigned long,struct std::less<unsigned long>,class 
>> std::allocator<unsigned long> > > > *'
>>        No user-defined-conversion operator available that can perform 
>> this conversion, or the operator cannot be called
>> Error executing cl.exe.  _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>



More information about the Insight-users mailing list