[Insight-developers] Insight Journal and ITK v4

Tom Vercauteren tom.vercauteren at m4x.org
Tue Dec 4 16:45:54 EST 2012


Hi folks,

I unfortunately have almost no time anymore to contribute to ITK. Yet,
I wanted to start fiddling with ITK 4 (I know it has been out for
quite some time already...) by cleaning up an old submission of mine
that needs some TLC to compile seamlessly with ITK 3 and 4:
http://hdl.handle.net/1926/510

I was happy to see that the code is now on github
  https://github.com/midas-journal/midas-journal-154
but I could not find anywhere in the Insight Journal documentation
whether (and how) I could use this repository to update the
submission.

Then I started without any porting effort to compile my old code with
ITK 4. I did not want to rely on any ITKv3Support mechanism as I
didn't want my code not to be native ITK4 in the end (I still have bad
memories about relying on Qt3Support a few years ago).

I first stumbled into a compilation error in ImageCompare.cxx:
  #error For ITKv4 compatibility, use
itk::Testing::ComparisonImageFilter instead of
itk::DifferenceImageFilter

Remembering that ImageCompare was part of the Insight Journal template
package, I went back and re-downloaded the template package.
Unfortunately, the template package has not been ported to ITK4 yet
and the ImageCompare.cxx file is still the same as the old one I had.

I could of course patch my local Insight Journal Template Package as
well as my other files and when everything will work fine, I could
also upload a new source package to the Insight Journal rather than
using github but this doesn't sound quite right. Did I miss something
or is it simply that the Insight Journal also needs some TLC to
properly handle ITK4?

That being said, are there any suggestions to handle seamlessly ITK 3
and 4 without imposition the use of ITKv3Support. I can see two
options right now:
1) Pepper the code with #if ITK_VERSION
2) Have two distinct files, one for ITK3, one for ITK4 and let cmake
choose which one to compile

Sorry for the long email and thanks for all the efforts that have been
made for ITK4 already.

Tom


More information about the Insight-developers mailing list