[Pkg-exppsy-pynifti] [Nipy-devel] Image, design, usecases

Gael Varoquaux gael.varoquaux at normalesup.org
Mon May 11 22:16:13 UTC 2009


On Mon, May 11, 2009 at 03:12:03PM -0700, Matthew Brett wrote:
> But, precise counterproposal being that Image class should be a
> wrapper round the VTK image model, with an affine or .... ?  Then
> you'd surely have to ask whether you had a simple thing all the time:

> if img.is_regularly_spaced:
>    data = img.data
> else:
>    raise ValueError

> No?

VTK has different data structures for data regularly spaced or not (
see 
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/data.html#vtk-data-structures
it has pictures, and we really tried to make it comprehensible), so the
test you are talking about is simply an 'isinstance'. A the different
data structures do exhibit common interfaces for common problems. The VTK
guys have thought out there library very well.

I am not actually suggesting we should have a dependency on VTK (unless
the whole community suddenly felt an urge), but I think the community
(and not only nipy) should study the concepts behind VTK quite well, and
try to learn from VTK... 

Gaël



More information about the Pkg-exppsy-pynifti mailing list