[Insight-users] ImageToSpatialObjecMetric error

flavio flaviosime at yahoo.it
Mon May 26 07:24:41 EDT 2008


Hi to all itk user
I'm novice of itk and I'm trying to register a dicom image with a 
mesh_spatial_object of a mechanic frame using 
ImageToSpatialObjectRegistrationMethod
I wrote the code below , but i catch a strange error using 
ImageToSpatialObjectMetric (.... also if I used code from user manual)
Could you please help me ?

Best regards,
Flavio

---- CODE ----------
typedef itk::OrientedImage<unsigned short,3> ImageType;

// from pg 155 of manual
// definition of mesh
 typedef itk::DefaultDynamicMeshTraits< float , 3, 3 > MeshTrait;
 typedef itk::Mesh<float,3,MeshTrait> MeshType;
 typedef itk::MeshSpatialObject<MeshType> MeshSpatialObjectType;

....
// from model registration
// registration method
typedef itk::ImageToSpatialObjectRegistrationMethod< ImageType, 
MeshSpatialObjectType >RegistrationType;
RegistrationType::Pointer registration = RegistrationType::New();

// metric definition
typedef itk::ImageToSpatialObjectMetric< ImageType, 
MeshSpatialObjectType > MetricType;
MetricType::Pointer metric = MetricType::New();  // <- error is here

--------- ERROR -------------

:error C2679: binary '=' : no operator found which takes a right-hand 
operand of type 'itk::Object::Pointer' (or there is no acceptable 
conversion)
1>        
C:\ITK\InsightToolkit-3.6.0\Code\Common\itkSmartPointer.h(113): could be 
'itk::SmartPointer<TObjectType> 
&itk::SmartPointer<TObjectType>::operator =(const 
itk::SmartPointer<TObjectType> &)'
       with
       [
          
TObjectType=itk::ImageToSpatialObjectMetric<itk::OrientedImage<unsigned 
short,3>,itk::MeshSpatialObject<MeshType>>
       ]
       C:\ITK\InsightToolkit-3.6.0\Code\Common\itkSmartPointer.h(117):
       or 'itk::SmartPointer<TObjectType> 
&itk::SmartPointer<TObjectType>::operator 
=(itk::ImageToSpatialObjectMetric<TFixedImage,TMovingSpatialObject> *)'
      with
       [
          
TObjectType=itk::ImageToSpatialObjectMetric<itk::OrientedImage<unsigned 
short,3>,itk::MeshSpatialObject<MeshType>>,
            TFixedImage=itk::OrientedImage<unsigned short,3>,
            TMovingSpatialObject=itk::MeshSpatialObject<MeshType>
        ]
        while trying to match the argument list 
'(itk::SmartPointer<TObjectType>, itk::Object::Pointer)'
        with
        [
            
TObjectType=itk::ImageToSpatialObjectMetric<itk::OrientedImage<unsigned 
short,3>,itk::MeshSpatialObject<MeshType>>
        ]






More information about the Insight-users mailing list