[vtkusers] iterating through vtkImageStencilData

David Gobbi david.gobbi at gmail.com
Wed Jul 21 10:40:01 EDT 2010


Hi Prathamesh,

Take a look at the code for the filters that use vtkImageStencilData,
for example see vtkImageAccumulate.cxx at line 200.  The
vtkImageStencilData does not store the raw pixel data.  It uses a form
of run-length encoding instead.

  David


On Wed, Jul 21, 2010 at 8:31 AM, Prathamesh Kulkarni
<prathameshmkulkarni at gmail.com> wrote:
> Hi David,
>
> Thanks for the direction. The documentation does not make it very clear to
> me. Could you please point/cook me a little example for accessing pixel
> values of vtkImageStencilData using the method you suggested? If I am able
> to do it, I'll post it out.
>
>
> Prathamesh
>
> On Tue, Jul 20, 2010 at 6:34 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> Hi Prathamesh,
>>
>> You can use the following method of vtkImageStencilData to do the
>> iteration:
>>
>>  int vtkImageStencilData::GetNextExtent(int &r1, int &r2, int xMin,
>>            int xMax, int yIdx, int zIdx, int &iter);
>>
>> The documentation describes what each of the parameters is for.  I
>> started work on a proper iterator for vtkImageStencilData many, many
>> years ago but never found time to finish it.
>>
>>  David
>>
>>
>> On Tue, Jul 20, 2010 at 5:00 PM, Prathamesh Kulkarni
>> <prathameshmkulkarni at gmail.com> wrote:
>> > Hello all,
>> >
>> > I want to be able to write vtkImageStencilData to text files in a CSV
>> > format
>> > in order to be analyzed in some other software.
>> >
>> > I could not find a way to iterate through vtkImageStencilData similar to
>> > vtkImageData.
>> >
>> > One idea is to convert the vtkImageStencilData to vtkImageData and then
>> > use
>> > vtkImageIterator. However, I do not know how to perform this conversion.
>> >
>> > Has anyone tried this before? How?
>> >
>> > Thanks,
>> > Prathamesh
>> >
>> > _______________________________________________
>> > 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
>> >
>> >
>
>



More information about the vtkusers mailing list