[ITK-dev] [slicer-devel] Workaround for dynamic_cast on Mac OSX

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Mon Nov 14 15:06:39 EST 2016


JC,


On Nov 14, 2016, at 2:30 PM, Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com<mailto:jchris.fillionr at kitware.com>> wrote:

Hi Brad,

> Make an explicit instantiation library with the ITK classes part of the shared libraries' interfaces.

My understanding is that we have been working on this for the past year without much success. Getting this right across compiler is difficult and hard to maintain

It is a potential solutions for smaller projects which have a couple well defined ITK classes in the API. Yes is certainly is hard to maintain. SimpleITK did this and were are seeing some portabilities to this solution today. But SimpleITK’s motivation was for library size reduction and compilation efficiency.

This is why there is a additional suggestion of restoring ITK’s wrapping infrastructure to do explicit instantiation. With the terrific advancements of class_xml and the general infrastructure, it would be ideal to enable the option to instantiate the templated itk::Objects based on the CMake parameters used for languages wrapping. On a large scale I don’t see an alternative to automate the explicit instantiation.



Does Slicer use ITK objects any where in it’s public API’s?

Yes, in few places:


Do these really produce itk::Objects? Here is my quick view.

 Base/CLI/itkPluginUtilities.h

I see some template functions and an itk::ProcessObject in the interface. That does not look like the problematic pattern.

 Libs/vtkITK/*

The vtkITK infrastructure is an example of the proposed solution #4

 Libs/MRML/IDImageIO/*

This appears to be an ITK ImageIO Factory. This pattern should be correctly exports specified and not an issue with the templated ImageFileReader.

 Libs/MRML/Core/vtkITKTransformInverse.h

OK, this one could have issues ITK BSplines with ITK Images. Would need a close look.


I was hoping that after the ITK Transform factory most of the dynamic_cast issues would be gone. What is remaining?



Thanks
Jc


--
+1 919 869 8849

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20161114/8ff950aa/attachment.html>


More information about the Insight-developers mailing list