[vtk-developers] imaging pipeline

David Gobbi dgobbi at irus.rri.ca
Mon Jun 17 16:41:42 EDT 2002


I haven't looked very deeply into the insight code, but it
seems that the only difference between ITK and VTK here would
be that VTK would have to generate the 'pixel' functions at
runtime rather than compile time.

So with VTK it would probably amount to the run-time creation
of a lightweight pixel-conversion 'object' with a
ConvertScalar(const void *in, void *out) method.  To get around
the overhead of the function call, it might be best to include
a 'count' parameter in the method:
  ConvertScalar(const void *in, void *out, int count)

For something like a replacement for vtkImageMathematics, these
scalar conversion objects could be chained together to allow
functions of arbitrary complexity to be evaluated within a single
filter and with minimal memory overhead.  Combined with a function
parser to allow a user to specify a function as a string of ascii
text, this would make the application of 'basic arithmetic' to
images in VTK a lot more pleasant & much more efficient.

 - David


On Mon, 17 Jun 2002, Lorensen, William E (Research) wrote:

> That's how we do it in Insight.
>
> -----Original Message-----
> From: David Gobbi [mailto:dgobbi at irus.rri.ca]
> Sent: Monday, June 17, 2002 4:21 PM
> To: vtk-developers at public.kitware.com
> Subject: [vtk-developers] imaging pipeline
>
>
> Kind of along the same lines of how to best simplify the imaging
> pipelin, a huge number of filters simply map a each input voxel
> through a function to get each output voxel.
>
> All of these filters loop over the pixels in exactly the same manner,
> resulting in a lot of duplicated code (less so now that iterators
> have been introduced).
>
> Why can't these filters simply have a method that will generate a
> 'pixel in -> pixel out' function  e.g.
>
>     Func(void *inPtr, void *outPtr)
>
> and have all of the looping handled by the superclass?
>
> This could also lead to greater unification of the imaging
> and graphics pipelines, since these filters could be made to
> operate on any data that has scalar values, not necessarily
> just vtkImageData.
>
>  - David
>
> --
>   David Gobbi, MSc                       dgobbi at irus.rri.ca
>   Advanced Imaging Research Group
>   Robarts Research Institute, University of Western Ontario
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list