It is currently Sat Aug 22, 2020 2:03 pm


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Accessing a volume's voxels
PostPosted: Mon Sep 26, 2011 5:58 am 

Joined: Sun Sep 25, 2011 7:36 am
Posts: 13
Hi,

I'm not a fan of dumb optimization (I guess no one is, named like that), so this is more a question than a suggestion:

Wouldn't it save a significant quantity of copies to have in SimpleVolume a method to access a given voxel by non-const reference ?

Cheers.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Accessing a volume's voxels
PostPosted: Mon Sep 26, 2011 5:51 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
This would work in the case of the SimpleVolume and the RawVolume because the data is all fixed in memory. But I think it is more complex in the case of the LargeVolume because the data you have obtained a reference to could later become invalidated by compression, paging, etc.

We could add the methods to just the SimpleVolume and RawVolume but on the other hand it's nice when the Volumes are interchangable. It also might make it hard if we did decide that the data needs to move around for some reason. Not that we have any plans for that, but this is the advantage of encapsulation.

I do see your point though... if we want to e.g. double a voxel's value then currently you have to retrieve it, double it, and then set the new value. It would be nice to do it in-place.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net