[Insight-users] problem with image vector and boundary conditions overriding

mhg at unizar.es mhg at unizar.es
Fri Mar 18 13:25:05 EST 2005


Hi, 

we are using ITK to define a vector of images and we would like to impose 
constant boundary condition (zero boundary condition) to this vector of images.

Here is the code:

// includes...

//Type definition

const int dim=3;

typedef float PixelType;
typedef itk::Vector<PixelType, dim>  vPixelType;
typedef itk::Image<vPixelType, dim> vImageType;
typedef itk::NeighborhoodIterator< vImageType > vNeighborhoodIteratorType;
typedef itk::ConstantBoundaryCondition <vImageType> cbcType;

int main(){

//Defining image and neighborhood iterator
vImageType::Pointer image = vImageType::New();
image->Allocate();
vNeighborhoodIteratorType::RadiusType radius;
radius.Fill(1);
vNeighborhoodIteratorType nit(radius, image, image->GetRequestedRegion());

//Setting boundary condition
cbcType cbc;
nit.OverrideBoundaryCondition(&cbc);

//Fool code
vImageType::IndexType p={{0,0,0}};

nit.SetLocation(p);

for(int i=0;i<nit.Size();i++)
 std::cout<<nit.GetIndex(i)<<std::endl;

}

We could compile this code successfully, but in the linkage we get this error

ex error LNK2001: unresolved external symbol "public: static class 
itk::Vector<float,3> const itk::NumericTraits<class itk::Vector<float,3> 
>::Zero" (?Zero@?$NumericTraits at V?$Vector at M$02 at itk@@@itk@@2V?$Vector at M$02 at 2@B)

Thanks a lot!!!



More information about the Insight-users mailing list