[vtkusers] problem of class vtkImageAppendComponents

Mark Jefferson mark.jefferson at qq.com
Thu May 22 23:06:47 EDT 2008


Hi, Amy, 
   I still don't know why. and I still have many questions.
 1, how can I know the different type of inputs? if I use the vtkBMPReader, of course, its input is vtkAlgorithmOutput, if another one is vtkImageData, so they are different? 
   if one of input is the object pointer of vtkAlgorithmOutput, another is the object pointer of vtkImageAppendComponents, are they different? if they are different, I should use two input, isn't it?
 2, the type of vtkImageAppendComponents's output is vtkImageData, but all the output getting from vtkImageAppendComponents is always the first input when I write its output into a .vti or .vtk file, even though there are multi-inputs. could you tell me why?
   however, when I use vtkImageAppend, I could get a mixed image, why vtkImageAppendComponents doesn't work? could you give me more suggestion?
 3, as you said, "one input determines the position of the glyphs; another input determines the geometry to place at those positions, then multiple input ports are used". that is, if one input is the actor, another one is the actor's position, isn't it?
    from the document of this class, there should be (1 + 1) components in vtkImageAppendComponents's output, but in fact, there is only one components, it is the actor, isn't it? so, there is something wrong with class vtkImageAppendComponents?
 4, if I want to take two image reader as the inputs of vtkImageAppendComponents, they should use input port 0, the same input port, isn't it? but why there is only one image in its output?
   for example: 
 append->AddInput((vtkDataObject *)reader1->GetOuput()); 
 append->AddInput((vtkDataObject *)reader2->GetOuput());
   is there anything wrong? if no, why there is only reader1's output? where it the reader2's output? is there 2 components or 1?
   thank you for your help, but I still don't know them, could you help me? thanks a lot!
   M. J.
 ------------------------------------------------------------------------------------------------------------
 Hi Mark,

You can have multiple input connections on the same input port, and this 
is what is expected for vtkImageAppendComponents. Try using port 0 for 
both input connections. Only the first input port is used by this 
filter, which explains both the warning message you're seeing and why 
both components in the output are from the first input.

For filters in VTK that take multiple inputs, if the function of the 
inputs is the same (as is the case here -- all the input datasets will 
be appended together), then one input port with  multiple connections is 
used. If the function of the inputs is different (e.g., in the glyph 
filter -- one input determines the position of the glyphs; another input 
determines the geometry to place at those positions), then multiple 
input ports are used -- one input port for each different type of input.

Thanks for posting the code snippet and the warning message; it made it 
clearer what was likely going wrong.

- Amy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080523/fb22e642/attachment.htm>


More information about the vtkusers mailing list