SimpleITK
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::ImageFileWriter::SetFileName
Self & SetFileName(const std::string &fileName)
itk::simple::TransformixImageFilter::LogToConsoleOn
Self & LogToConsoleOn()
itk::simple::TransformixImageFilter::Execute
Image Execute()
itk::simple::ReadParameterFile
SITKElastix_EXPORT std::map< std::string, std::vector< std::string > > ReadParameterFile(const std::string filename)
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:60
SimpleITK.h
itk::simple::ImageFileReader::SetFileName
Self & SetFileName(const std::string &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::TransformixImageFilter::SetTransformParameterMap
Self & SetTransformParameterMap(const std::vector< std::map< std::string, std::vector< std::string > > > parameterMapVector)
itk::simple
Definition:
sitkAdditionalProcedures.h:29
itk::simple::ImageFileWriter
Write out a SimpleITK image to the specified file location.
Definition:
sitkImageFileWriter.h:48
Generated on
unknown
for SimpleITK by
1.8.17 |
Privacy Policy