#include <iostream>
#include <stdlib.h>
#include <iomanip>
{
public:
: m_Filter(m)
{}
void
{
using sitk::operator<<;
std::ios state(NULL);
state.copyfmt(std::cout);
std::cout << std::fixed << std::setfill(' ') << std::setprecision(5);
std::cout << std::setw(3) << m_Filter.GetElapsedIterations();
std::cout << " = " << std::setw(10) << m_Filter.GetMetric();
std::cout << std::endl;
std::cout.copyfmt(state);
}
private:
};
int
main(int argc, char * argv[])
{
if (argc < 4)
{
std::cerr << "Usage: " << argv[0] << " <fixedImageFilter> <movingImageFile> <outputTransformFile>" << std::endl;
return 1;
}
moving = matcher.
Execute(moving, fixed);
IterationUpdate cmd(filter);
std::cout << "-------" << std::endl;
std::cout <<
" RMS: " << filter.
GetRMSChange() << std::endl;
return 0;
}
An implementation of the Command design pattern for callback.
Deformably register two images using the demons algorithm.
Self & SetStandardDeviations(std::vector< double > StandardDeviations)
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
uint32_t GetElapsedIterations() const
Number of iterations run.
Self & SetNumberOfIterations(uint32_t NumberOfIterations)
Image Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField)
Normalize the grayscale values for a source image by matching the shape of the source image histogram...
Image Execute(const Image &image, const Image &referenceImage)
Self & SetNumberOfHistogramLevels(uint32_t NumberOfHistogramLevels)
Self & SetNumberOfMatchPoints(uint32_t NumberOfMatchPoints)
Self & ThresholdAtMeanIntensityOn()
The Image class for SimpleITK.
virtual int AddCommand(itk::simple::EventEnum event, itk::simple::Command &cmd)
Add a Command Object to observer the event.
SITKIO_EXPORT Image ReadImage(const PathType &filename, PixelIDValueEnum outputPixelType=sitkUnknown, const std::string &imageIO="")
ReadImage is a procedural interface to the ImageFileReader class which is convenient for most image r...
@ sitkIterationEvent
Occurs with some algorithms that run for a fixed or undetermined number of iterations.
SITKCommon_EXPORT void WriteTransform(const Transform &transform, const PathType &filename)