Hi Luis,<br>thanks for your quick response. Here my source code, part 1 is the image I generate, and in part 2 this image is then used as the input image.<br><br>Part 1:<br> ...<br> ImageType::Pointer image = ImageType::New();
<br> // The image region should be initialized<br> ImageType::IndexType start;<br> ImageType::SizeType size;<br> size[0] = imageSize[0]; // size along X<br> size[1] = imageSize[1]; // size along Y<br> size[2] = imageSize[2];
<br> start[0] = 0; // first index on X<br> start[1] = 0; // first index on Y<br> start[2] = 0;<br><br> ImageType::RegionType region;<br> region.SetSize( size );<br> region.SetIndex( start );<br><br>
// Pixel data is allocated<br> image->SetRegions( region );<br> image->Allocate();<br><br> ImageType::PixelType normalise = size[0]*size[0];<br> for(int k = 0; k < size[2]; k++) {<br> for(int j = 0; j < size[1]; j++) {
<br> for(int i = 0; i < size[0]; i++) {<br> ImageType::IndexType index;<br> index[0] = i; index[1] = j; index[2] = k;<br> ImageType::PixelType elastic = i*i;<br> elastic = elastic / normalise;
<br> elastic = elastic * maxDeform;<br> elastic *= -1;<br> image->SetPixel(index, elastic);<br> }<br> }<br> }<br> ...<br><br>Part 2:<br> ...<br> // build up neighborhood iteration stuff
<br> typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType faceList;<br> NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType> bC;<br> ConstNeighborhoodIterator<InputImageType>::RadiusType radius;
<br> radius.Fill(1);<br> faceList = bC(input, input->GetRequestedRegion(), radius);<br> typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType::iterator fit;<br><br> // TODO: Why are non-boundary not first element?
<br> fit = faceList.begin();<br> //for(unsigned int i = 0; i < 6; i++) fit++;<br> for(; fit != faceList.end(); ++fit) {<br> ConstNeighborhoodIterator<InputImageType> bit(radius, input, *fit);<br><br>
// build up image iterator<br> ImageRegionIterator<OutputImageType> out(output, *fit);<br><br> // loop over neighborhoods and write to output image<br> for(; !bit.IsAtEnd(); ++bit, ++out) {
<br><br> out.Set( bit.GetCenterPixel() );<br><br> }<br> }<br> ...<br><br>Chris<br><br><div><span class="gmail_quote">On 10/11/07, <b class="gmail_sendername">Luis Ibanez</b> <<a href="mailto:luis.ibanez@kitware.com">
luis.ibanez@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi Christof,<br><br>Can you post to the list a minimum source code example illustrating
<br>this behavior ?<br><br>It sounds like a bug, but we need a way to reproduce it in order<br>to track any potential problem.<br><br><br> Thanks<br><br><br> Luis<br><br><br>------------------------<br>Christof Seiler wrote:
<br>> Hi all,<br>> I want to use the NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<br>> class but I ran into the following problem.<br>><br>> I call:<br>> ...<br>> faceList = faceCalculator(input, input->GetRequestedRegion(), radius);
<br>> ...<br>> and in the user's guide it says:<br>> "The first element in the list is always the inner region, which may or<br>> may not be important depending on the application."<br>><br>> but in fact I get boundary faces first and the non-boundary element is
<br>> in last position.<br>><br>> What am I missing?<br>> Thanks in advance.<br>> Chris<br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br></blockquote></div><br>