[vtk-developers] vtkAlgorithm suggestion
Miller, James V (Research)
millerjv at crd.ge.com
Tue Mar 9 09:39:59 EST 2004
I just saw the vtkAlgorithm classes in the respository. I have a
suggestion. I noticed the "inputs" and "outputs" are indexed based (inputs
are specified via a numeric id). I think implementing subclasses of
Algorithm will be cleaner if the inputs and outputs are specified via
strings. The developer can indicate whatever string names they want to
associate with their inputs and outputs. If none are specified, a default
like "Input0" could be used.
The code may look like:
someAlgorithm->SetInputConnection("gradient",
someOtherAlgorithm->GetOutputConnection("gradient"));
or something like that.
When you have algorithm classes that have a number of inputs and outputs in
becomes a nuisance to remember mapping from integer index to contextual
meaning for the input/output.
I had played around with this in ITK and generally liked the feeling.
Instead of storing inputs and outputs in vectors, they were stored in maps
(string->DataObject). For scheduling reasons, I didn't get a chance to put
this into ITK. But I am starting to put in DataObject wrappers around
standard scalars so that algorithm parameters (say a threshold) can
themselves be a DataObject. In the few algorithms I have tried this on, you
can up with more inputs and outputs than you can remember the numeric id
for.
Jim Miller
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301
millerjv at research.ge.com <mailto:millerjv at research.ge.com>
james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005,
Cell: (518) 505-7065, Fax: (518) 387-6981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20040309/37bac9d2/attachment.html>
More information about the vtk-developers
mailing list