Hello,
I have a question concerning the cloning of mitk::Images.
What is currently the correct way to clone an const image instance?
The code documented in the documentation
(http://docs.mitk.org/nightly-qt4/MitkImagePage.html#MitkImagePage_Cloning)
results in "deprecated" warnings on the current trunk because of the call of
mitk::Image::GetData().
The introduced accessors (ImageReadAccessor) cannot be used directly due to
their Interface. The constructor of ImageAccessorBase forces the passing of a
non const pointer to the image.
In cases like mine, where I have a class with only access to a const pointer
this would imply the need of a const cast. I would prefer to avoid such things
(const_cast as well as deprecated functions).
What is the correct way to proceed? In my case for cloning const.
Apart from my concrete question: Wouldn't it be useful to allow accessors that
can, where sensible (e.g. read accessors), also take const images? In my case I
could oversee the risks of a const_cast, but it may not always be that simple
and in addition it would help to keep const correctness in the code.
Kind regards,
Ralf Floca
------------------------------------------------------------------
Dr. Ralf Floca
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum)
Member of the Helmholtz Association
E071 Research Group
Software Development for Integrated Diagnostics and Therapy (SIDT)
Im Neuenheimer Feld 280
D-69120 Heidelberg
Phone: +49 (6221) 42 2560
E-Mail: [email protected]<mailto:[email protected]>
Web: www.dkfz.de<http://www.dkfz.de>
------------------------------------------------------------------
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users