[vtkusers] remove vtkImageBlend item

David Gobbi david.gobbi at gmail.com
Mon Feb 7 02:19:24 EST 2011


Hi Mauro,

The answer is that it makes no difference to the efficiency.
Each time the filter executes, it does the following:
- it copies the first input to the output
- it blends all the other inputs into the output, one by one

It doesn't matter if you remove and re-add the first input versus
whether you just change around the other inputs.  It will take the
same amount of time to execute in each case.

Also, I'm fairly sure you understand this next point, but just in
case, here it is: calling AddInputConnection does not cause the
filter to execute, it only makes a connection.

 - David


On Sun, Feb 6, 2011 at 10:56 PM, Mauro Maiorca <mauromaiorca at gmail.com> wrote:
> Hi David,
>
> sorry, I wasn't clear enough, I'll try again.
> Suppose I've got a big image, and I have to add/remove little objects
> in just one little area of the image (thus leaving most of the image
> as it was). My concern is whether in this particular case it's more
> efficient to RemoveAllInputs and add all them again (including the big
> image) or removing/re-adding just the little objects (without
> removing/re-adding the big image)?
>
> cheers,
> Mauro
>
>
> On Fri, Feb 4, 2011 at 3:13 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>> Hi Mauro,
>> I'm not quite sure what you mean.  Calling GetOutputPort() doesn't
>> cause anything to happen, all it does is return a handle that can be
>> used to make a pipeline connection.  Nothing is loaded until the
>> pipeline is executed, and even then VTK uses timestamps to make
>> sure that the data will only be loaded once.
>>  - David
>>
>> On Thu, Feb 3, 2011 at 8:18 AM, Mauro Maiorca <mauromaiorca at gmail.com>
>> wrote:
>>>
>>> Hi David,
>>>
>>> thank you very much for your quick reply and your clarification! It
>>> makes all sense now, and it works!
>>> But, how can I keep track of a particular object, then?
>>> I don't mind redrawing all the canvas, but I'm concerned about a
>>> reasonably big image (i.e. up to 4096x4096 pixel): I assume each call
>>> to blend->AddInputConnection(0,color->GetOutputPort()) will re-load
>>> the whole image, unless AddInputConnection has a really smart
>>> buffering policy (is it the case?).
>>>
>>> cheers,
>>> Mauro
>>
>



More information about the vtkusers mailing list