[ITK-dev] Improvements to the DataObjectDecorator for read/write access

Bradley Lowekamp blowekamp at mail.nih.gov
Tue May 27 08:59:58 EDT 2014


Hello,

I was looking into getting Transform classes to be more pipeline-able. As they are not derived from the DataObject they are required to be decorated with the DataObjectDecorator class.

I quickly realized that when the Transform was modified it's wasn't propagated to the DataObjectDecorator so I have a proposed patch here:

http://review.source.kitware.com/#/c/15529/2

After further use of the class, I can see how it likely evolved from the SimpleDataObjectDecorator. For non-itk::Object classes there is no MTime, so the decorators restricts access to the held component to read only. However for many of the use cases with the Transform class the held component is being const cast violating the initial design.

So it appears to me the evolution of the DataObjectDecorator needs to support read/write access for itk::Objects. Therefore support to propagate the MTime from the itk::Object and allow writable access via a GetModifiable method is required. Additionally this will dictate changing to a non-const smart pointer.

Additionally I'd like to propose the addition of a Graft method for this decorator, which would just shallow copy the data object via coping the pointer under safe conditions.

Thanks for the feedback before I get too far into the issue.
Brad


More information about the Insight-developers mailing list