Import 2017-06-07 23:51:09: master 50fd3ed5

Author Committer Branch Timestamp Parent
jcfr jcfr master 2016-01-19 12:34:44 master 799041a3
Changeset

BUG: Fix ResampleScalarVectorDWIVolume tests removing usage of dynamic_cast.

This commit fixes a regression introduced
by InsightSoftwareConsortium/ITK@d1e9fe2 (BUG: Ensure Transform IO
factories are registered once.) and integrated in r24836 (ENH: Update
ITKv4 to v4.9.0 release branch).

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.

This commit fixes the following tests compiled using gcc 4.4.3
and executed on Ubuntu 10.04:
ResampleScalarVectorDWIVolumeBSplineInterpolationTest
ResampleScalarVectorDWIVolumeBSplineWSInterpolationTest
ResampleScalarVectorDWIVolumeRotationAndAffineTest
ResampleScalarVectorDWIVolumeRotationNNTest

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

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