[SciPy-User] Arbitrary max-intensity projection

Chris Weisiger cweisiger at msg.ucsf.edu
Fri Sep 9 17:01:53 EDT 2011


VTK seems to be difficult to build for Python -- I should have
mentioned that this needs to integrate into an existing Python program
that's already been written, so a standalone app doesn't really meet
my needs. The goal is to extend the functionality of a program that my
users use to examine their data, not to solve a one-off problem. I've
downloaded VTK's source and tried to build it, but I'm getting link
errors right now, so this could be a rather hairy procedure all told.

mayavi appears to be limited to source builds or the paid Enthought
distribution? If I want to build it myself, I need...VTK. :)

So in other words, my options currently appear to be, in no particular order,
1) Roll my own
2) Figure out how to build VTK with Python, at which point the problem is simple
3) Build VTK without Python, then figure out how to build mayavi
against that VTK, with Python, at which point the problem is simple

-Chris

On Thu, Sep 8, 2011 at 8:13 PM, David Baddeley
<david_baddeley at yahoo.com.au> wrote:
> This gets even easier if you use mayavi
>
> from enthought.mayavi import mlab
> f = mlab.figure()
> v = mlab.pipeline.volume(mlab.pipeline.scalar_field(data.astype('uint8')))
>
> you can then use the pipeline tool to (graphically) change the "Volume mapper type" to "RayCastMapper" and the "Ray cast function type" to "RayCastMIPFunction". (There's probably also a programatic way to do this)
>
> cheers,
> David
>
> --- On Fri, 9/9/11, Christoph Gohlke <cgohlke at uci.edu> wrote:
>
>> From: Christoph Gohlke <cgohlke at uci.edu>
>> Subject: Re: [SciPy-User] Arbitrary max-intensity projection
>> To: scipy-user at scipy.org
>> Received: Friday, 9 September, 2011, 11:13 AM
>>
>>
>> On 9/8/2011 3:29 PM, Chris Weisiger wrote:
>> > I have a 3D volume of image data. I want to do a
>> max-intensity
>> > projection of that data along an arbitrary axis (that
>> is, not
>> > necessarily orthogonal). For example, projecting along
>> the axis<1, 0,
>> > .5>  would generate results like looking at
>> the data a bit from above.
>> > Basically we're faking 3D views of our data.
>> >
>> > OpenGL 3D textures don't work due to the size of the
>> image data in
>> > question (e.g. 512x512x60). Someone suggested
>> reimplementing
>> > Amanatides&  Woo, which is a fairly simple
>> voxel raytracer. However,
>> > that doesn't mean it's trivial to implement, and I'd
>> rather not
>> > reinvent and optimize the wheel if at all possible.
>> Does anyone have
>> > any suggestions for known solutions to this problem?
>> >
>> > -Chris
>>
>>
>> Did you try VTK's vtkVolumeRayCastMIPFunction function as
>> suggested before?
>>
>> <http://www.vtk.org/doc/release/5.8/html/a02285.html>
>> <http://www.uppmax.uu.se/Members/andersh/vtk-with-python/volume-rendering/Volume.py/view?searchterm=None>
>>
>>
>> OpenGL 3D textures should work if you successively render
>> sub-volumes in
>> the correct position and order. MIP can also be implemented
>> with
>> object-aligned 2D textures.
>>
>> Christoph
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list