[Insight-users] is there a problem in boundary face calculator ?
devieill at irit.fr
devieill at irit.fr
Fri Oct 1 12:20:40 EDT 2010
Hello all,
the itk documentation state that the boundary face calculator should output
2N+1 region where N is considered to be the region/image dimension.
However when creating a itk::Image<double,2> containing 4 pixels and
running the following simple code :
____________________________________
typedef itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<
Image2D > FaceCalculatorType;
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< Image2D>
faceCalculator;
FaceCalculatorType::FaceListType faceList;
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<
Image2D>::FaceListType::iterator fit;
Image2D::RegionType region;
Image2D::IndexType index;
Image2D::SizeType size;
itk::Size<2> radius;
index[0] = 1;
index[1] = 0;
size[0] = 1;
size[1] = 2;
region.SetIndex(index);
region.SetSize(size);
radius[0]=1;
radius[1]=1;
faceList = faceCalculator(img1, region, radius);
std::cout << " face list number " << faceList.size() << std::endl ;
for (fit = faceList.begin(); fit!= faceList.end(); ++fit) {
std::cout << " current face is " << *fit << std::endl ;
}
_______________________________
I have the following output :
______________________________
face list number 4
current face is ImageRegion (0x25c0f10)
Dimension: 2
Index: [1, 1]
Size: [0, 0]
current face is ImageRegion (0x25c0f50)
Dimension: 2
Index: [1, 0]
Size: [1, 2]
current face is ImageRegion (0x25c0f90)
Dimension: 2
Index: [1, 0]
Size: [1, 1]
current face is ImageRegion (0x25c0fd0)
Dimension: 2
Index: [1, 1]
Size: [1, 1]
____________________________________
Despite the fact that there is NOT the right number of regions,
what bothers me the most is that one gets duplicated pixels, or to put it
simply the regions given by the algorithm are overlapping.
Assuming that one build a filter using neighboorhood filters this
become troublesome (imagine with multithreading...).
My question are :
1) is the boundary calculator broken ?
2) what should be used instead to design fast filters requiring a radius ?
3) Can one have neuman boundary conditions with it ?
Regards,
de Vieilleville François
More information about the Insight-users
mailing list