[vtkusers] Marking a pixel with a filled circle

Francois Bertel francois.bertel at kitware.com
Mon Dec 7 08:54:32 EST 2009


Hello,

I don't know about this class but you can find quickly how to fix the
error by looking at the documentation:

If you go to the documentation of  vtkImageStencilData, you'll see
that the "See also" section lists "vtkImageStencilSource" and
"vtkImageStencil".

"vtkImageStencilSource" is a superclass for sources that generate
vtkImageStencilData.

You'll see in the hierarchy diagram of "vtkImageStencilSource" a class
called "vtkImageToImageStencil", it is probably what you want to
connect to the second port of vtkImageBlend.

Regards.


On Mon, Dec 7, 2009 at 8:46 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Sun, Dec 6, 2009 at 11:38 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> On Sun, Dec 6, 2009 at 8:23 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>>
>>> Sorry, I somehow completely missed the part about vtkImageBlend. It seems
>>> like an enormous pain though - I tried to make an example:
>>> http://www.vtk.org/Wiki/VTK_Examples_Combine_Images
>>>
>>> but it seems to be expecting a vtkImageStencilData. I tried to use
>>> vtkImageStencil but I don't understand what is going on - can you help
>>> clarify?
>>
>> It doesn't need a vtkImageStencilData, the test just uses that feature
>> in order to test it.  Just give ImageBlend two images as input, it
>> doesn't need anything else.
>>
>>
>>> I'll work on a vtkSurfacePicker example and let you know if there are any
>>> questions/problems.
>>
>> There is an example, or at least, there is an example of it's subclass
>> vtkVolumePicker.  Look in
>> Examples/VolumeRendering/Python/VolumePicker.py.  There are also tests
>> (in tcl) that use VolumePicker and SurfacePicker.
>>
>> All the examples that I made are volume-centric, though.   There
>> aren't any good examples for using vtkSurfacePicker with images.
>>
>>
>>> Thanks for your help David G (too many David's around here, haha)!
>>
>> You're welcome.  There's never too many Davids, it makes it easier to
>> remember people's names if everyone's name's the same.
>>
>>   David
>>
>
> Hmm, that was the first thing I tried:
>
>  vtkSmartPointer<vtkImageBlend> blend = vtkSmartPointer<vtkImageBlend>::New();
>  blend->SetInputConnection(0, JPEGReader1->GetOutputPort());
>  blend->SetInputConnection(1, JPEGReader2->GetOutputPort());
>
> But the error was:
>
> Input for connection index 0 on input port index 1 for algorithm
> vtkImageBlend(0x97d7930) is of type vtkImageData, but a
> vtkImageStencilData is required.
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list