[vtkusers] Some questions to writing own vtk filters (design & interfaces etc, wrong Extent in input images)

Lodron, Gerald Gerald.Lodron at joanneum.at
Fri Oct 22 02:28:08 EDT 2010


Hi,

I wrote a VTK filter and have some questions to the design/pipeling:









I made (or wanted to made) a filter which takes at least two 3D images as input (maximum 4 inputs) and one image as output. Therefore i made:

class MyFilter : public vtkImageAlgorithm
{
    private:

       MyFilter () {this->SetNumberOfInputPorts(2);}

    public:
       void SetImage1(vtkImageData* poImage){this->SetInput(0, poImage);}
       void SetImage2(vtkImageData* poImage){this->SetInput(1, poImage);}
       void SetImage3(vtkImageData* poImage)

       {

            if(this->GetNumberOfInputPorts() < 3)

                this->SetNumberOfInputPorts(3);

           this->SetInput(2, poImage);

       }

       void SetImage4(vtkImageData* poImage)
       {

            if(this->GetNumberOfInputPorts() < 4)

                this->SetNumberOfInputPorts(4);

           this->SetInput(3, poImage);

       }

   private:

      void RequestData(....){...};

}

The problem is that the input images can have different sizes, e.g.:

First image: 512x512x160
Second image: 512x512x180
Third image: 256x256x160
Fourth image: 256x256x180

When i print the input images in RequestData i can see that Update Extent is larger than the Whole Extent, and that Dimensions and Extent field is wrong (values from the first image)! Do i need to specify anything more?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101022/eef29489/attachment.htm>


More information about the vtkusers mailing list