Hi,<br>I found two things in your code that may create the described problem:<br>- in your loop over pixels, the in and out pointers are incremented twice. First in the component subloop with inPtr++<br>  and second when finishing the Y loop with inPtr += incY. Finally, the pointer will point out of the extent.<br>
- If you have multithreading enabled, the outExtent is splitted in the number of threads you are able to launch. I think that the inExtent is not changed, but you are using it as initial pointer position.<br><br>Try this:<br>
- remove the increment incY (and incZ if you want to try 3D) [lines 101-102 and 104-105]<br>- initialize the inPtr regarding the outExt, and not the inExt [lines 79-81]<br><br>HTH<br>Jerome<br><br><div class="gmail_quote">
2010/3/20 Christian Werner <span dir="ltr">&lt;<a href="mailto:christian.werner@rwth-aachen.de">christian.werner@rwth-aachen.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi David!<br>
<br>
Here is a complete working copy with everything you need. Unpack it in a seperate directory. Run cmake &amp;&amp; make then start the program with the labelMe.bmp as argument which is also included. The result will be called result.bmp.<br>

<br>
The result looks different from my first posting though, that was the ParaView output. Still something goes wrong, the image seems to be split in to halfes, an upper and a lower which both contain the input image squeezed.<br>

<br>
<br>
Best regards,<br><font color="#888888">
Christian</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
David Doria wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, Mar 19, 2010 at 3:58 PM, Christian Werner<br>
&lt;<a href="mailto:christian.werner@rwth-aachen.de" target="_blank">christian.werner@rwth-aachen.de</a>&gt; wrote:<br>
  <br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello!<br>
<br>
I am about to build a nice BinaryRemoveRegions filter that will scrap away<br>
groups of pixels that are below/above a certain size. I took the vtkMedian<br>
Filter as a template and cropped it down to the most basic code which<br>
traverses through the image in X-Y-Z order. There I wanted to check if<br>
everything goes fine by simple copying the input image to the output image.<br>
Unfortunately, the pointers to the InData are corrupt. You can see the<br>
result of the copying attached.<br>
<br>
It is pretty sure that the inData pointers are corrupt, and not the outData<br>
pointers since I managed to draw pixels every Xth row/column with correct<br>
results. I have attached the code.<br>
<br>
Could somebody give me a hint of what is causing this malfunction? Note that<br>
the actual x/y/z coordinates are crucial for my algorithm, because I have to<br>
check for neighboring pixels in all directions.<br>
<br>
<br>
Best regards,<br>
Christian<br>
    <br>
</blockquote>
<br>
Can you attach the header file and the test/example code?<br>
<br>
Thanks,<br>
<br>
David<br>
  <br>
</blockquote>
<br>
</div></div><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 <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: <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></blockquote></div><br>