Hi Martin,<div><br></div><div>Thanks much, I'll give it a try!</div><div><br></div><div>Mark<br><div><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 11:30 PM, Martn Ulken <span dir="ltr"><<a href="mailto:martinulken@googlemail.com">martinulken@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Hi,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">I used a pointer to have a simple access using a standard C-array. Perhaps this piece of code helps:</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US">vtkUnsignedCharArray* test= vtkUnsignedCharArray::SafeDownCast(image2->GetPointData()->GetScalars());</span></p>
<p class="MsoNormal"><span lang="EN-US">test2= test->GetPointer(0);</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Now you should be able to access the pixel data by using test2[i].</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Good Luck </span><span lang="EN-US" style="font-family:Wingdings">J</span><span lang="EN-US"></span></p><p class="MsoNormal"><span lang="EN-US">Martin</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt">Von:</span></b><span style="font-size:10.0pt"> <a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>] <b>Im Auftrag von </b>Mark Roden<br>
<b>Gesendet:</b> Dienstag, 30. November 2010 05:38<br><b>An:</b> VTK<br><b>Betreff:</b> [vtkusers] access points quickly</span></p></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal">Hi all,</p>
<div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">How can I access points in an image without bounds checking?</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Right now, there's <span><span style="font-size:10.0pt">GetScalarComponentAsDouble, but this is s-l-o-w when iterating through all the points in an image. Is there an iterator class similar to ITK? As I mentioned earlier, I'm trying to speed up vtkDijkstraImageGeodesicPath::BuildAdjacency. This method's major time sink is GetScalarComponentAsDouble. Can I just use vtkImageIterator and make the path templated to the image type? Is that the kosher VTK way of rewriting this method, or is it not OK to use an image iterator when I don't necessarily know the base type of the data?</span></span></p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"><span><span style="font-size:10.0pt">Thanks,</span></span></p></div><div><p class="MsoNormal"><span><span style="font-size:10.0pt">Mark</span></span></p>
</div></div></div></div></div></blockquote></div><br></div></div>