On Tue, Dec 4, 2012 at 4:45 PM, Tom Vercauteren &lt;<a href="mailto:tom.vercauteren@m4x.org">tom.vercauteren@m4x.org</a>&gt; wrote:<br>&gt; Hi folks,<br>&gt;<br>&gt; I unfortunately have almost no time anymore to contribute to ITK. Yet,<br>
&gt; I wanted to start fiddling with ITK 4 (I know it has been out for<br>&gt; quite some time already...) by cleaning up an old submission of mine<br>&gt; that needs some TLC to compile seamlessly with ITK 3 and 4:<br>&gt; <a href="http://hdl.handle.net/1926/510">http://hdl.handle.net/1926/510</a><br>
&gt;<br>&gt; I was happy to see that the code is now on github<br>&gt;   <a href="https://github.com/midas-journal/midas-journal-154">https://github.com/midas-journal/midas-journal-154</a><br>&gt; but I could not find anywhere in the Insight Journal documentation<br>
&gt; whether (and how) I could use this repository to update the<br>&gt; submission.<br>&gt;<br>&gt; Then I started without any porting effort to compile my old code with<br>&gt; ITK 4. I did not want to rely on any ITKv3Support mechanism as I<br>
&gt; didn&#39;t want my code not to be native ITK4 in the end (I still have bad<br>&gt; memories about relying on Qt3Support a few years ago).<br>&gt;<br>&gt; I first stumbled into a compilation error in ImageCompare.cxx:<br>
&gt;   #error For ITKv4 compatibility, use<br>&gt; itk::Testing::ComparisonImageFilter instead of<br>&gt; itk::DifferenceImageFilter<br>&gt;<br>&gt; Remembering that ImageCompare was part of the Insight Journal template<br>
&gt; package, I went back and re-downloaded the template package.<br>&gt; Unfortunately, the template package has not been ported to ITK4 yet<br>&gt; and the ImageCompare.cxx file is still the same as the old one I had.<br>
&gt;<br>&gt; I could of course patch my local Insight Journal Template Package as<br>&gt; well as my other files and when everything will work fine, I could<br>&gt; also upload a new source package to the Insight Journal rather than<br>
&gt; using github but this doesn&#39;t sound quite right. Did I miss something<br>&gt; or is it simply that the Insight Journal also needs some TLC to<br>&gt; properly handle ITK4?<br>&gt;<br>&gt; That being said, are there any suggestions to handle seamlessly ITK 3<br>
&gt; and 4 without imposition the use of ITKv3Support. I can see two<br>&gt; options right now:<br>&gt; 1) Pepper the code with #if ITK_VERSION<br>&gt; 2) Have two distinct files, one for ITK3, one for ITK4 and let cmake<br>
&gt; choose which one to compile<br>&gt;<br>&gt; Sorry for the long email and thanks for all the efforts that have been<br>&gt; made for ITK4 already.<br>&gt;<br>&gt; Tom<br><br>I fixed a few of these things a while ago:<br>
<br>1) The use of itkDifferenceImageFilter which has been replaced by itkTestingComparisonImageFilter. <br>2) ::itk::OStringStream seems to now be simply std::ostringstream. <br>3) I used the ${ITK_LIBRARIES} variable in the CMakeLists.txt.). <br>
<br>I guess they still haven&#39;t been integrated. Perhaps since it is an open access journal, things like this template tarball should also be made publicly fixable (through Gerrit of course) so that they can be kept up to date by the community even if there is no funding.<br>
<br>I&#39;ll let someone else handle your question about easily supporting ITK3/4 :)<div><br>David</div>