enthought / ensemble

High-level widgets for building Python applications
Other
4 stars 7 forks source link

Remove resampling of volume before visualization #47

Open pberkes opened 9 years ago

pberkes commented 9 years ago

We are resampling the volume data to 256 * 256 * 256 before visualization. That seems arbitrary, remove it unless we have a good reason for it.

pberkes commented 9 years ago

@jwiggins Do you remember why this is the case?

jwiggins commented 9 years ago

The reason is that volume data uses lots of GPU memory. For 8-bit function values, 256^3 is 16MB of memory, or 32MB for 16-bit. Additionally, the OpenGL driver on a computer might only accept power-of-two texture sizes.

512x512x256 might be a better maximum (64MB and 128MB, respectively). 512x512x512 seemed crazy Back in the Day™, but 256MB/512MB could actually be a possibility on contemporary high-end systems.

The smarter approach would be to ask the system what its limits are.

One caveat: VTK might have a hard-coded maximum. You should check.

pberkes commented 9 years ago

Resampling to a fix number of point in depth seems wrong, as you get a different resolution depending on the depth range.

jwiggins commented 9 years ago

I agree. The implementation is naive because I wrote this code so I could look at my personal CT scan.

I think some amount of resampling will be necessary because of the hardware constraints involved. However, there are far better ways to achieve this than how its being done now (with a hard-coded size and aspect ratio).