Import 2017-06-07 23:51:09: master e3fac411

Author Committer Branch Timestamp Parent
jcfr jcfr master 2016-01-19 12:34:40 master 471cbdb8
Changeset

BUG: Fix ResampleDTI tests removing usage of dynamic_cast.

This commit fixes a regression introduced by r24836 (ENH: Update ITKv4 to
v4.9.0 release branch). Following the ITK update, the ITKIO transform
libraries are build as shared and dynamic_cast can NOT be used with
classes that are not explicitly instantiated and exported.

Following this ITK commit, the ITKIO transform libraries are build as
shared and dynamic_cast can NOT be used with templated classes that are
instantiated in a translation unit different than the one where they are
defined. It will work only if the classes are explicitly instantiated
and exported.

To workaround the issue, code that was relying on dynamic_cast is updated
to (1) ensure the objects are of the right type doing string comparison
and (2) then use static_cast instead of dynamic_cast.

See InsightSoftwareConsortium/ITK@d1e9fe2
and see http://stackoverflow.com/questions/8024010/why-do-template-class-functions-have-to-be-declared-in-the-same-translation-unit

This commit fixes the following tests compiled using gcc 4.4.3
and executed on Ubuntu 10.04:
ResampleDTIVolumeRotationNNTest
ResampleDTIVolume2RigidTransformsLinearTest
ResampleDTIVolumeBSplineWSInterpolationTest
ResampleDTIVolumeBSplineInterpolationTest

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24878 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Modules/CLI/ResampleDTIVolume/ResampleDTIVolume.cxx Diff File