SimpleITK
Elastix/tfx.cxx
// This one header will include all SimpleITK filters and external
// objects.
#include <
SimpleITK.h
>
#include <iostream>
#include <stdlib.h>
namespace
sitk
=
itk::simple
;
int
main(
int
argc,
char
* argv[])
{
if
(argc < 3)
{
std::cerr <<
"Usage: "
<< argv[0] <<
" <inputImage> <parameterFile> <outputImage>\n"
;
return
1;
}
// Instantiate transformix
sitk::TransformixImageFilter
transformixImageFilter;
transformixImageFilter.
LogToConsoleOn
();
// Read input
sitk::ImageFileReader
reader;
reader.
SetFileName
(std::string(argv[1]));
transformixImageFilter.
SetMovingImage
(reader.
Execute
());
transformixImageFilter.
SetTransformParameterMap
(
sitk::ReadParameterFile
(argv[2]));
// Run warp
transformixImageFilter.
Execute
();
// Write result image
sitk::ImageFileWriter
writer;
writer.
SetFileName
(std::string(argv[3]));
writer.
Execute
(transformixImageFilter.
GetResultImage
());
return
0;
}
itk::simple::TransformixImageFilter::LogToConsoleOn
Self & LogToConsoleOn()
itk::simple::TransformixImageFilter::Execute
Image Execute()
itk::simple::TransformixImageFilter
Definition:
sitkTransformixImageFilter.h:33
itk::simple::ImageFileWriter::Execute
Self & Execute(const Image &)
itk::simple::ImageFileReader
Read an image file and return a SimpleITK Image.
Definition:
sitkImageFileReader.h:74
SimpleITK.h
itk::simple::ImageFileReader::SetFileName
Self & SetFileName(const PathType &fn)
itk::simple::TransformixImageFilter::GetResultImage
Image GetResultImage()
itk::simple::TransformixImageFilter::SetMovingImage
Self & SetMovingImage(const Image &movingImage)
itk::simple::ImageFileReader::Execute
Image Execute() override
Set/Get The output PixelType of the image.
itk::simple::ImageFileWriter::SetFileName
Self & SetFileName(const PathType &fileName)
itk::simple::TransformixImageFilter::SetTransformParameterMap
Self & SetTransformParameterMap(const std::vector< std::map< std::string, std::vector< std::string >>> parameterMapVector)
itk::simple
Definition:
sitkAdditionalProcedures.h:28
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
itk::simple::ImageFileWriter
Write out a SimpleITK image to the specified file location.
Definition:
sitkImageFileWriter.h:51
Generated on
unknown
for SimpleITK by
1.8.17 |
Privacy Policy