<div dir="ltr">I find it very complicated to port into my code. All I need to do is to write the pixel values corresponding to the stencil into a text file (in any order). I tried getting the extent of the stencil by:<br><br>
vtkImplicitFunctionToImageData->GetExtent(); but this gives me the whole extent of the InformationInput (vtkImageData). Isn't there a simple way to do this? My idea is to iterate over vtkImageData using extent of the stencil. Is this a good/viable idea?<br>
<br>Prathmesh<br><br><div class="gmail_quote">On Wed, Jul 21, 2010 at 9:40 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Prathamesh,<br>
<br>
Take a look at the code for the filters that use vtkImageStencilData,<br>
for example see vtkImageAccumulate.cxx at line 200. The<br>
vtkImageStencilData does not store the raw pixel data. It uses a form<br>
of run-length encoding instead.<br>
<br>
David<br>
<br>
<br>
On Wed, Jul 21, 2010 at 8:31 AM, Prathamesh Kulkarni<br>
<div><div></div><div class="h5"><<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>> wrote:<br>
> Hi David,<br>
><br>
> Thanks for the direction. The documentation does not make it very clear to<br>
> me. Could you please point/cook me a little example for accessing pixel<br>
> values of vtkImageStencilData using the method you suggested? If I am able<br>
> to do it, I'll post it out.<br>
><br>
><br>
> Prathamesh<br>
><br>
> On Tue, Jul 20, 2010 at 6:34 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
>><br>
>> Hi Prathamesh,<br>
>><br>
>> You can use the following method of vtkImageStencilData to do the<br>
>> iteration:<br>
>><br>
>> int vtkImageStencilData::GetNextExtent(int &r1, int &r2, int xMin,<br>
>> int xMax, int yIdx, int zIdx, int &iter);<br>
>><br>
>> The documentation describes what each of the parameters is for. I<br>
>> started work on a proper iterator for vtkImageStencilData many, many<br>
>> years ago but never found time to finish it.<br>
>><br>
>> David<br>
>><br>
>><br>
>> On Tue, Jul 20, 2010 at 5:00 PM, Prathamesh Kulkarni<br>
>> <<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>> wrote:<br>
>> > Hello all,<br>
>> ><br>
>> > I want to be able to write vtkImageStencilData to text files in a CSV<br>
>> > format<br>
>> > in order to be analyzed in some other software.<br>
>> ><br>
>> > I could not find a way to iterate through vtkImageStencilData similar to<br>
>> > vtkImageData.<br>
>> ><br>
>> > One idea is to convert the vtkImageStencilData to vtkImageData and then<br>
>> > use<br>
>> > vtkImageIterator. However, I do not know how to perform this conversion.<br>
>> ><br>
>> > Has anyone tried this before? How?<br>
>> ><br>
>> > Thanks,<br>
>> > Prathamesh<br>
>> ><br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the VTK FAQ at:<br>
>> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>