int
main(int, char *[])
{
using PixelType = ImageMaskSpatialObject::PixelType;
using ImageType = ImageMaskSpatialObject::ImageType;
region.SetIndex(index);
image->SetRegions(region);
image->Allocate(true);
insideRegion.SetSize(insideSize);
Iterator it(image, insideRegion);
it.GoToBegin();
while (!it.IsAtEnd())
{
++it;
}
maskSO->SetImage(image);
maskSO->Update();
auto inside = itk::MakeFilled<ImageMaskSpatialObject::PointType>(20);
std::cout << "Is my point " << inside << " inside my mask? "
<< maskSO->IsInsideInWorldSpace(inside) << std::endl;
auto outside = itk::MakeFilled<ImageMaskSpatialObject::PointType>(45);
std::cout << "Is my point " << outside << " outside my mask? "
<< !maskSO->IsInsideInWorldSpace(outside) << std::endl;
return EXIT_SUCCESS;
}
Implementation of an image mask as spatial object.
A multi-dimensional iterator templated over image type that walks a region of pixels.
void SetSize(const SizeType &size)
Define additional traits for native types such as int or float.
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
void SetIndex(const IndexValueType val[VDimension])