0

I'm trying to register two images using the ITK library and the DemonsRegistrationFilter. I have some problems setting up the two images that I want to register. When I compile, i get this error:

ImageType was not declared in this scope.

I first wanted to use the python wrapper but I didn't figure out how to do it so I have to code using c++ which I'm not really familiar. It is using template. If anybody can help or send me a simple working example, that would be great.

Regards,

Arnaud

ArnaudT
  • 93
  • 1
  • 1
  • 9

3 Answers3

1

Since you are interested in Python bindings, you may be interested in the the 0.9 version of SimpleITK currently has added the Demons registration filters. You can build it yourself on the current git master or download a packaged nightly version .

This will save you from some of these pesky C++ template issue.

blowekamp
  • 1,401
  • 7
  • 7
0

Are you sure you have compiled correctly both ITK and your project with cmake? Here is an example of registration http://www.itk.org/Wiki/ITK/Examples/Registration/LandmarkBasedTransformInitializer , but at this point what you should look first is the cmake file. Or maybe you have defined Imagetype inside a function and you are using it in another function. It's not even a problem of templates, it's from c++ scoping.

lib
  • 2,918
  • 3
  • 27
  • 53
0

If you have built ITK correctly and have verified the build using Hello-World-ITK (see Section 2.2.1 of the itk software guide), then all you need to do is to define ImageType before you use it in your image-file-reader/demons-filter.

So you need a line like this at the beginning of your program

typedef itk::Image<unsigned char, 3> ImageType; //Pixel type and dimension of your image
siavashk
  • 436
  • 7
  • 24