[Insight-users] Design question when using ITK classes

Hendrik Belitz hbelitz at darkon.info
Wed Feb 20 09:42:16 EST 2008


Hi Anja,

> However, with this scheme you are unable to have <i>class member variables</i> that are of templated type. Say for example, I need to read data from a file inside a class method. So, I find the underlying data type and dimensions and read the data. However, if I want to access this data later or basically store it in the class, how can I do that?
You do not need templated class members since you can just hold a pointer to the data in a (less or even non-templated) base class like itk::ImageBase (which is not templated by data type). If you also
need independence of dimension, use itk::DataObject instead. Of course this means that you have to downcast it using dynamic_cast<> again later. 

Hope this helps,
 Hendrik

-------------------------------------------------------------------
Brilliance is typically the act of an individual, but incredible
stupidity can usually be traced to an organization. - Jon Bentley

Hendrik Belitz, Computer Scientist
email: hbelitz at computer.org or hbelitz at ieee.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080220/c43996c1/attachment.htm


More information about the Insight-users mailing list