Blob#
Synopsis#
Blob.
Results#
Output:
Bounds: [0, 0, 0, 0]
Code#
C++#
#include "itkBlobSpatialObject.h"
int
main(int itkNotUsed(argc), char * itkNotUsed(argv)[])
{
using BlobType = itk::BlobSpatialObject<2>;
// Create a list of points
BlobType::BlobPointListType points;
for (unsigned int i = 0; i < 20; ++i)
{
BlobType::BlobPointType point;
point.SetPositionInObjectSpace(i, i);
points.push_back(point);
}
auto blob = BlobType::New();
blob->SetPoints(points);
BlobType::BoundingBoxType::BoundsArrayType bounds = blob->GetMyBoundingBoxInWorldSpace()->GetBounds();
std::cout << "Bounds: " << bounds << std::endl;
return EXIT_SUCCESS;
}
Classes demonstrated#
-
template<unsigned int TDimension = 3>
class BlobSpatialObject : public itk::PointBasedSpatialObject<TDimension, SpatialObjectPoint<TDimension>> Spatial object representing a potentially amorphous object.
The BlobSpatialObject is a discretized representation of a “blob”, which can be taken to be an arbitrary, possibly amorphous shape. The representation is a list of the points (voxel centers) contained in the object. This can be thought of as an alternate way to represent a binary image.
- See
SpatialObjectPoint
- ITK Sphinx Examples: