[Insight-users] What is GetNeighborhoodIndex of the ShapedNeighborhoodIterator?

Dawood AlMasslawi masslawi at gmail.com
Mon Jul 18 09:00:43 EDT 2011


Hi David,

The GetNeighborhoodIndex method returns the index of the pixel at

an offset position from the center of the neighborhood, therefore this

method should have an offset as an argument. It's strange that you

didn't get any errors!

This method is implemented in "InsightToolkit\Code\Common\

itkNeighborhood.txx", line 184, check your version to make sure!

HTH,

Dawood


>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<

>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<


In something like this:
http://www.itk.org/Wiki/ITK/Examples/Iterators/ShapedNeighborhoodIterator_Manual

these lines:

 std::cout << "New position: " << iterator.GetIndex() << std::endl;

      std::cout << ci.GetNeighborhoodIndex() << " -> "
<< ci.GetNeighborhoodOffset() << " = " << ci.Get() << std::endl;

produce:

New position [8, 8]:
199 -> [0, -1] = 0
241 -> [0, 1] = 0

I understand the position (from GetIndex) and the offset (from
GetNeighborhoodOffset), but what are the values 199 and 241 that
GetNeighborhoodIndex returns for every pixel?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110718/1a90ecdf/attachment.htm>


More information about the Insight-users mailing list