View Full Version : subsampling a volume

alark

08-25-2003, 06:38 AM

Hi,

It might be quite obvious to many but I cant seem to resample a volume to a lower resolution. For example, if I have a 512x512x512 volume, how would I resample it to 256x256x256 volume. I would greatly appreciate any help.

thanks a lot,

alark

davepermen

08-25-2003, 06:53 AM

small[x,y,z] = (

big[2x,2y,2z] +

big[2x,2y,2z+1] +

big[2x,2y+1,2z] +

big[2x,2y+1,2z+1] +

big[2x+1,2y,2z] +

big[2x+1,2y,2z+1] +

big[2x+1,2y+1,2z] +

big[2x+1,2y+1,2z+1]

)/8

simple boxfilter.. do this for each small[] texel.

alark

08-25-2003, 01:34 PM

hi,

i tried this but am getting some weird output. does the volume have to be a regular volume like 512x512x512 or 256^3. My volume is 512x512x256 and i am trying to resample it to 256x256x128. Its looking like each of the 8 components is seperate and i see eight different sections of the volume sort of. Hope that makes some sense. Here is a screenshot to make it easier to understand.

[img]http://www.geocities.com/alark_j/vol.jpg[img]

The central oval is the actual volume.

thanks,

alark

[This message has been edited by alark (edited 08-26-2003).]

jwatte

08-25-2003, 03:16 PM

Sounds like you're not properly compensating for the pixel format of your pixels. Note that the pseudo-code didn't separate out R, G, B and A; your real code of course has to do that.

Just do the same technique used to resize 2D textures/bitmaps and add one more dimension.

Powered by vBulletin® Version 4.2.5 Copyright © 2018 vBulletin Solutions Inc. All rights reserved.