[Insight-users] a Strange error,what might the reason??
Luis Ibanez
luis.ibanez at kitware.com
Sun Feb 4 13:12:52 EST 2007
Hi Tony,
Thanks for posting the error message.
It makes thing very clear now.
You are confusing the use of PointSet and Images
in your code.
The ResampleImageFilter is intended for itkImages
only. You *cannot* use it for resampling a PointSet.
If you want to apply a geometrical transform to
a PointSet you *MUST* use the the TransformMeshFilter:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformMeshFilter.html
Note however, that if you are doing a PointSetToImageRegistration,
then the PointSet is the *FIXED* element and the image is the
*MOVING* element. This means that you need to resample the MOVING
image in to the reference system of the *FIXED* element. Since
your fixed element here is a point set, then you cannot get from
it the parameters of origin, spacing, and grid size that the resample
filter requires.
You will have to compute these values based on characteristics such
as the centroid of the pointset, their spread, and the resolution
that you want on the output image.
Note that, if you obtained your point set from a feature selection
in an original image, then you could naturally use the parameters
of that image in order to define the origin, spacing and grid size
of the resampling output.
Please read the ITK Software Guide:
http://www.itk.org/ItkSoftwareGuide.pdf
in particular the section on Geometrical Transformations and
the Registration chapter.
You are strugling with basic concepts that are already
explained in the ITK Software Guide.
Regards,
Luis
------------------
tony hakki wrote:
> Hello All
> (Especially Luis) ;
> I mave met a strange error that I have ever met before. I hope somebody
> will help me. I just want to get registration of one stl data(I
> converted it itk mesh) and the other is .raw extension 3d data.
> .
> .
> .
> .
> .
>
> typedef itk::ResampleImageFilter<
>
> MovingImageType,
>
> FixedImageType > ResampleFilterType;
>
> TransformType::Pointer finalTransform = TransformType::New();
>
> finalTransform->SetCenter( transform->GetCenter() );
>
> finalTransform->SetParameters( finalParameters );
>
> ResampleFilterType::Pointer resampler = ResampleFilterType::New(); //
> *until this line I have not met any error,But when I add just this
> part It gives 35 errors, I dont understand errors, I this part of code
> from ImageRegistration8.cxx which is in ITK folders*
>
> **
>
> *Here is the first part error of 35, *
>
> **
>
> c:\programme\itk\itk-src-windows\code\common\itkimagetoimagefilter.h(90)
> : error C2039: 'ImageDimension' : is not a member of
> 'itk::PointSet<TPixelType,VDimension>'
>
> 1> with
>
> 1> [
>
> 1> TPixelType=float,
>
> 1> VDimension=3
>
> 1> ]
>
> 1>
> c:\programme\itk\itk-src-windows\code\basicfilters\itkresampleimagefilter.h(74)
> : see reference to class template instantiation
> 'itk::ImageToImageFilter<TInputImage,TOutputImage>' being compiled
>
> 1> with
>
> 1> [
>
> 1> TInputImage=MovingImageType,
>
> 1> TOutputImage=FixedPointSetType
>
> 1> ]
>
> 1> c:\documents and settings\aydemir\desktop\itktovtk\teste.cpp(96) :
> see reference to class template instantiation
> 'itk::ResampleImageFilter<TInputImage,TOutputImage>' being compiled
>
> 1> with
>
> 1> [
>
> 1> TInputImage=MovingImageType,
>
> 1> TOutputImage=FixedPointSetType
>
> 1> ]
>
> 1>c:\programme\itk\itk-src-windows\code\common\itkimagetoimagefilter.h(90)
> : error C2065: 'ImageDimension' : undeclared identifier
>
> 1>c:\programme\itk\itk-src-windows\code\common\itkimagetoimagefilter.h(90)
> : error C2057: expected constant expression
>
>
More information about the Insight-users
mailing list