[Insight-users] Setting fixed image
Christoph Palm
christoph.palm at web.de
Fri Feb 23 04:18:17 EST 2007
Hi Tony,
unfortunately I didn't work with meshes and points before.
Nevertheless, I would say, that it makes now sense to
build up a new PointsContainer object with
> PointsContainer::Pointer pointsContainer = PointsContainer::New();
According to the documentation, mesh->GetPoints() results in a
PointsContainer* , so I would try
PointsContainer *pointsContainer = mesh->GetPoints();
Regards
Christoph
On Thu, 2007-02-22 at 13:16 -0800, tony hakki wrote:
> Thank you for your fast reply. I tried your suggestions .Unfortunately
> I could't accomplish it :( First Suggestions seems really good. But
> error is strange. What might the reason do you think? Sorry for my
> inconvenience again:(
> When I try like that :
>
> typedef PointSetType::PointsContainer PointsContainer;
>
> PointsContainer::Pointer pointsContainer = PointsContainer::New();
>
> pointsContainer = mesh->GetPoints();
>
> itk::PointSet<float, 3>::Pointer pointSet =
> itk::PointSet<float,3>::New();
>
> pointSet->SetPoints(pointsContainer);
>
>
>
> registrationMethod->SetFixedPointSet(pointSet);
>
> It gives that error:
>
> :\documents and settings\aydemir\desktop\itktovtk\teste.cpp(234) :
> error C2679: binary '=' : no operator found which takes a right-hand
> operand of type 'itk::VectorContainer<TElementIdentifier,TElement>
> *' (or there is no acceptable conversion)
>
> 1> with
>
> 1> [
>
> 1>
> TElementIdentifier=itk::DefaultStaticMeshTraits<vtkFloatingPointType,3,2,vtkFloatingPointType,vtkFloatingPointType>::PointIdentifier,
>
> 1> TElement=itk::Point<double,3>
>
> 1> ]
>
> 1> c:\programme\itk\itk-src-windows\code\common
> \itksmartpointer.h(113): could be 'itk::SmartPointer<TObjectType>
> &itk::SmartPointer<TObjectType>::operator =(const
> itk::SmartPointer<TObjectType> &)'
>
> 1> with
>
> 1> [
>
> 1>
> TObjectType=itk::VectorContainer<itk::DefaultStaticMeshTraits<PixelType,3,3>::PointIdentifier,itk::Point<float,3>>
>
> 1> ]
>
> 1> c:\programme\itk\itk-src-windows\code\common
> \itksmartpointer.h(117): or 'itk::SmartPointer<TObjectType>
> &itk::SmartPointer<TObjectType>::operator
> =(itk::VectorContainer<TElementIdentifier,TElement> *)'
>
> 1> with
>
> 1> [
>
> 1>
> TObjectType=itk::VectorContainer<itk::DefaultStaticMeshTraits<PixelType,3,3>::PointIdentifier,itk::Point<float,3>>,
>
> 1>
> TElementIdentifier=itk::DefaultStaticMeshTraits<PixelType,3,3>::PointIdentifier,
>
> 1> TElement=itk::Point<float,3>
>
> 1> ]
>
> 1> while trying to match the argument list
> '(itk::SmartPointer<TObjectType>,
> itk::VectorContainer<TElementIdentifier,TElement> *)'
>
> 1> with
>
> 1> [
>
> 1>
> TObjectType=itk::VectorContainer<itk::DefaultStaticMeshTraits<PixelType,3,3>::PointIdentifier,itk::Point<float,3>>
>
> 1> ]
>
> 1> and
>
> 1> [
>
> 1>
> TElementIdentifier=itk::DefaultStaticMeshTraits<vtkFloatingPointType,3,2,vtkFloatingPointType,vtkFloatingPointType>::PointIdentifier,
>
> 1> TElement=itk::Point<double,3>
>
> 1> ]
>
>
> When I try like that
> registrationMethod->SetFixedPointSet(mesh->GetPoints()) ;
> It gives that error:
> c:\documents and settings\aydemir\desktop\itktovtk\teste.cpp(349) :
> error C2664:
> 'itk::PointSetToImageRegistrationMethod<TFixedPointSet,TMovingImage>::SetFixedPointSet' : cannot convert parameter 1 from 'itk::VectorContainer<TElementIdentifier,TElement> *' to 'const itk::PointSet<TPixelType,VDimension> *'
>
> 1> with
>
> 1> [
>
> 1> TFixedPointSet=FixedPointSetType,
>
> 1> TMovingImage=MovingImageType
>
> 1> ]
>
> 1> and
>
> 1> [
>
> 1>
> TElementIdentifier=itk::DefaultStaticMeshTraits<vtkFloatingPointType,3,2,vtkFloatingPointType,vtkFloatingPointType>::PointIdentifier,
>
> 1> TElement=itk::Point<double,3>
>
> 1> ]
>
> 1> and
>
> 1> [
>
> 1> TPixelType=PixelType,
>
> 1> VDimension=3
>
> 1> ]
>
> 1> Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast
>
>
>
> ----- Original Message ----
> From: Robert Tamburo <robert.tamburo at gmail.com>
> To: tony hakki <tony2007vtk at yahoo.com>
> Cc: Christoph Palm <christoph.palm at web.de>; insight-users at itk.org
> Sent: Thursday, February 22, 2007 9:46:15 PM
> Subject: Re: [Insight-users] Setting fixed image
>
> You need to pass the point set from the mesh to the function. This is
> how I did it a while ago:
>
>
> PointsContainer::Pointer pointsContainer = PointsContainer::New();
> pointsContainer = mesh->GetPoints();
>
>
> itk::PointSet<float, 3>::Pointer pointSet =
> itk::PointSet<float,3>::New();
> pointSet->SetPoints(pointsContainer);
>
>
> registrationMethod->SetFixedPointSet(pointSet);
>
>
> ****Note that registrationMethod is templated over itk::PointSet
>
>
> I don't recall the specifics of the classes involved but you may be
> able to directly set the points from the mesh, i.e.,
> registrationMethod->SetFixedPointSet(mesh->GetPoints()) if you
> template the registration class over itk::PointsContainer (if
> possible).
>
>
>
>
> > registrationMethod->SetFixedPointSet(
>
> On Feb 22, 2007, at 3:00 PM, tony hakki wrote:
>
> >
> > Hi christoph;
> > first of all I want to thank your kind reply. I read my stl data
> > with VTK then I converted poly data to itk mesh. And mesh is the
> > result of vtkpolydata to itk mesh converting process. When I use
> > second one (registrationMethod->SetFixedPointSet(mesh);) It gives
> > the following error. I am really looking forward to your next reply.
> > Thanks
> > Tony
> >
> > c:\documents and settings\aydemir\desktop\itktovtk\teste.cpp(348) :
> > error C2664:
> > 'itk::PointSetToImageRegistrationMethod<TFixedPointSet,TMovingImage>::SetFixedPointSet' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'const itk::PointSet<TPixelType,VDimension> *'
> >
> > 1> with
> >
> > 1> [
> >
> > 1> TFixedPointSet=FixedPointSetType,
> >
> > 1> TMovingImage=MovingImageType
> >
> > 1> ]
> >
> > 1> and
> >
> > 1> [
> >
> > 1> TObjectType=itk::Mesh<vtkFloatingPointType,3,MeshTraits>
> >
> > 1> ]
> >
> > 1> and
> >
> > 1> [
> >
> > 1> TPixelType=PixelType,
> >
> > 1> VDimension=3
> >
> > 1> ]
> >
> > 1> No user-defined-conversion operator available that can perform
> > this conversion, or the operator cannot be called
> >
> > 1>Build log was saved at "file://c:\Documents and Settings\aydemir
> > \Desktop\itktovtk\Debug\BuildLog.htm"
> >
> >
> >
> > ----- Original Message ----
> > From: Christoph Palm <christoph.palm at web.de>
> > To: tony hakki <tony2007vtk at yahoo.com>
> > Sent: Thursday, February 22, 2007 6:56:11 PM
> > Subject: Re: [Insight-users] Setting fixed image
> >
> > Hi Tony,
> >
> > the error message as result of the first try seems to be clear:
> > GetOutput() is a function e.g. of a filter, not of a object like
> > image or mesh. What happens, if you try your second suggestion?
> > How is your mesh generated?
> >
> > -- Christoph
> >
> > On Thu, 2007-02-22 at 07:38 -0800, tony hakki wrote:
> > > Hello dear ITK users;
> > > I would like to set fixed image when implement a pointset to image
> > > registration.
> > > I Try like that;
> > > registrationMethod->SetFixedPointSet(mesh->GetOutput()); //mesh is
> > itk
> > > mesh
> > >
> > > I also tried like that;
> > >
> > > registrationMethod->SetFixedPointSet(mesh);
> > >
> > >
> > >
> > > It gives that error:
> > >
> > > >c:\documents and settings\aydemir\desktop\itktovtk
> > \teste.cpp(366) :
> > > error C2039: 'GetOutput' : is not a member of
> > > 'itk::Mesh<TPixelType,VDimension,TMeshTraits>'
> > >
> > > 1> with
> > >
> > > 1> [
> > >
> > > 1> TPixelType=vtkFloatingPointType,
> > >
> > > 1> VDimension=3,
> > >
> > > 1> TMeshTraits=MeshTraits
> > >
> > > 1> ]
> > >
> > >
> > >
> > > How Can I set fixed image using itk mesh format. I hope somebody
> > will
> > > help me. Thank you very much
> > >
> > > Tony
> >
> > >
> >
> > www.chripa.de/AtWork
> > ----
> >
>
More information about the Insight-users
mailing list