[vtkusers] Creating an ImageData from the bounds of a PolyData

David Gobbi david.gobbi at gmail.com
Tue Dec 8 17:46:54 EST 2009


On Tue, Dec 8, 2009 at 3:17 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
[snip]
> I am suggesting that it should be included with the vtkImageData
> class. When you ask for the cell/voxel center, there is even more of a
> mess that shows up in the form of spacing/2 in all dimensions to get
> from the corner of the cell to the center of the cell. This mess
> should be dealt with/though about only once and then wrapped into
> nice, intuitive accessors for users.

Hi David,

I know that it is tempting to add new convenience methods, but it goes
against a very important concept in software design: minimalism.  The
VTK classes (and vtkImageData in particular) already have very
cluttered interfaces.  Changes to the interface should be made
wholistically, i.e. the interface should make sense as a whole and
should be nice and consistent with other VTK data classes.  Adding new
methods that do this specific task can create a headache for the
developers who maintain the classes.

It's better to make filter classes that operate on the data, like
Jerome's class.  For imagedata itself, you should make a wiki page
that says what interfaces you want added, so that the developers can
consider all the changes as a whole.  But in general, as a user, you
shouldn't be manipulating the vtk data object directly (or, as I said
once before, the pipeline gods will eventually strike you down).

   David



More information about the vtkusers mailing list