[Insight-developers] SimpleITK - sitk::Image with copy on write

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Mar 18 08:15:24 EDT 2011


Hello,

At the last TCON we discussed correcting the reference counting in the wrapped languages or implementing copy on write in the stik.Image class.

I was a proponent of implementing COW as it would allow to treat sitk::Image just like an object with assignment, copy constructors, and other operators.

After doing a little more mushing:

https://github.com/blowekamp/SimpleITK/commit/505cd55460fbac246b01ad231dd349390629ae6c#diff-1
https://github.com/blowekamp/SimpleITK/commit/810366642d63fcf53b16fb293dc7f3727d922015

I feel fairly confident that this is the correct approach. And should work out well. The caveat with the mushings is that the signature of the Execute methods need to change from:

Image *Execute( const Image *) 
to
Image Execute( const Image & )

Brad


========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110318/9347087b/attachment.htm>


More information about the Insight-developers mailing list