using PixelType = unsigned char;
static void
static void
int
main(int itkNotUsed(argc), char * itkNotUsed(argv)[])
{
CreateFixedImage(fixedImage);
CreateMovingImage(movingImage);
using LandmarkBasedTransformInitializerType =
using LandmarkContainerType = LandmarkBasedTransformInitializerType::LandmarkPointContainer;
using LandmarkPointType = LandmarkBasedTransformInitializerType::LandmarkPointType;
LandmarkContainerType fixedLandmarks;
LandmarkContainerType movingLandmarks;
LandmarkPointType fixedPoint;
LandmarkPointType movingPoint;
fixedPoint[0] = 10;
fixedPoint[1] = 10;
movingPoint[0] = 50;
movingPoint[1] = 50;
fixedLandmarks.push_back(fixedPoint);
movingLandmarks.push_back(movingPoint);
fixedPoint[0] = 10;
fixedPoint[1] = 20;
movingPoint[0] = 50;
movingPoint[1] = 60;
fixedLandmarks.push_back(fixedPoint);
movingLandmarks.push_back(movingPoint);
fixedPoint[0] = 20;
fixedPoint[1] = 10;
movingPoint[0] = 60;
movingPoint[1] = 50;
fixedLandmarks.push_back(fixedPoint);
movingLandmarks.push_back(movingPoint);
fixedPoint[0] = 20;
fixedPoint[1] = 20;
movingPoint[0] = 60;
movingPoint[1] = 60;
fixedLandmarks.push_back(fixedPoint);
movingLandmarks.push_back(movingPoint);
landmarkBasedTransformInitializer->SetFixedLandmarks(fixedLandmarks);
landmarkBasedTransformInitializer->SetMovingLandmarks(movingLandmarks);
transform->SetIdentity();
landmarkBasedTransformInitializer->SetTransform(transform);
landmarkBasedTransformInitializer->InitializeTransform();
resampleFilter->SetInput(movingImage);
resampleFilter->SetTransform(transform);
resampleFilter->SetUseReferenceImage(true);
resampleFilter->SetReferenceImage(fixedImage);
resampleFilter->SetDefaultPixelValue(200);
return EXIT_SUCCESS;
}
void
{
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
while (!imageIterator.IsAtEnd())
{
if (imageIterator.GetIndex()[0] > 10 && imageIterator.GetIndex()[0] < 20 && imageIterator.GetIndex()[1] > 10 &&
imageIterator.GetIndex()[1] < 20)
{
imageIterator.Set(255);
}
++imageIterator;
}
}
void
{
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
while (!imageIterator.IsAtEnd())
{
if (imageIterator.GetIndex()[0] > 50 && imageIterator.GetIndex()[0] < 60 && imageIterator.GetIndex()[1] > 50 &&
imageIterator.GetIndex()[1] < 60)
{
imageIterator.Set(100);
}
++imageIterator;
}
}