[Nipy-devel] Latest and greatest in visualization of MRI data?

Gael Varoquaux gael.varoquaux@normalesup....
Tue Jan 25 04:53:31 CST 2011

On Tue, Jan 25, 2011 at 11:44:34AM +0100, Stephan Gerhard wrote:
> Hi Gael,

> > For interactive: I use Mayavi to slice the data and use the following
> > function to expose a volume in it:

> > http://nipy.sourceforge.net/nipy/stable/api/generated/nipy.neurospin.viz_tools.maps_3d.html#nipy.neurospin.viz_tools.maps_3d.affine_img_src 

> I looked into the function and saw that the affine is used only for
> origin and spacing. Do you know if there is a way to take the full
> affine into account, e.g. positioning the ArraySource in 3D space with
> rotations?

For rotations, you need to define a different VTK structure, namely the
structured grid:
whereas the code I use is based on ImageData:

While it is fairly easy to adapt the code to structured grid, you can no
longer use the 'ImagePlaneWidget' to slice them, and must use a
'ScalarCutPlane'. The difference between the two is the interpolation
technique used to compute the data on the plane: ImagePlaneWidget uses
sinc interpolation, and thus is very fast, but work only if the axes of
your grid are aligned with the principal axis. ScalarCutPlane is much

This is why I suggest that, for interactive visualization, you resample
your data to have a diagonal affine: it will give you much smoother



More information about the Nipy-devel mailing list