<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi all,<br>
<br>
I'm using <tt>vtkPolyDataToImageStencil</tt> to get all voxels
index inside of a surface. If I understand correctly, I have only
two choices here:<br>
- <tt>vtkImageStencil</tt> to create a new image<br>
- <tt>vtkImageStencilIterator</tt> to iterate on the values (of
another image)<br>
The problem is, I have a different goal in mind. I need the index of
all voxels inside a surface.<br>
<br>
I read the <tt>vtkPolyDataToImageStencil</tt> code and tried to
create my own "iterator" but there's probably something I don't
understand; <tt>GetNextExtent</tt> always return 0.<br>
<small><tt>bool GetNext(int& x1, int& x2, int& y,
int& z)</tt><tt><br>
</tt><tt>{</tt><tt><br>
// m_Y, m_Z and m_Iter == 0</tt></small><small><tt><br>
int maxX, maxY, maxZ, dump;</tt><tt><br>
</tt><tt> m_ImageStencilData->GetExtent(dump, maxX, dump,
maxY, dump, maxZ);</tt><tt><br>
</tt><tt> maxX *= 2; maxY *= 2; maxZ *= 2;</tt><tt><br>
</tt><tt><br>
</tt><tt> for ( ; m_Z <= maxZ; ++m_Z)</tt><tt><br>
</tt><tt> {</tt><tt><br>
</tt><tt> for ( ; m_Y <= maxY; ++m_Y)</tt><tt><br>
</tt><tt> {</tt><tt><br>
</tt><tt> if (m_ImageStencilData->GetNextExtent(x1, x2, 0,
maxX, m_Y, m_Z, m_Iter))</tt><tt><br>
</tt><tt> {</tt><tt><br>
</tt><tt> y = m_Y; z = m_Z;</tt><tt><br>
</tt><tt> return true;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> return false;</tt><tt><br>
</tt><tt>}</tt></small><br>
<br>
Is there a way to access all inside-voxels hidden in the <tt>vtkPolyDataToImageStencil</tt>?
By index or by index range, it's not important. I just want to know
to access them without useless work (like creating an image) because
it's gonna be called often; it needs to be fast. Thank you for your
time.<br>
<br>
Nil<br>
</body>
</html>