![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00008 #ifndef IDEFORMATIONELASTIC_HH 00009 #define IDEFORMATIONELASTIC_HH 1 00010 00011 // (Optional) may be required if one want access to the image matrices 00012 #include "oImageSpace.hh" 00013 // Required to automatically add the class in the CASToR code 00014 #include "sAddonManager.hh" 00015 // Mother class of deformation model 00016 #include "vDeformation.hh" 00017 00018 #ifdef CASTOR_ELASTIX 00019 #include "itkImage.h" 00020 #include "itkPoint.h" 00021 // #include "itkRawImageIO.h" 00022 #include "itkImageFileReader.h" 00023 #include "itkImageFileWriter.h" 00024 00025 #include "elastixlib.h" 00026 #include "transformixlib.h" 00027 #include "elxParameterObject.h" 00028 #include "itkParameterFileParser.h" 00029 #endif 00030 00031 00032 #ifdef CASTOR_ELASTIX 00033 using namespace transformix; 00034 typedef TRANSFORMIX::ParameterMapType RegistrationParametersType; 00035 typedef itk::ParameterFileParser ParserType; 00036 typedef itk::ParameterFileParser::ParameterMapType ParameterMapType; 00037 00038 enum { Dimension = 3 }; 00039 typedef float PixelType; 00040 typedef itk::Image< PixelType, Dimension > ImageType; 00041 typedef ImageType::IndexType PixelIndex; 00042 typedef ImageType::RegionType RegionType; 00043 typedef ImageType::SizeType RegionSize; 00044 typedef ImageType::IndexType RegionStart; 00045 typedef ImageType::SpacingType SpacingType; 00046 typedef itk::ImageFileReader< ImageType > ReaderType; 00047 typedef itk::ImageFileWriter< ImageType > WriterType; 00048 #endif 00049 00050 00056 class iDeformationElastic : public vDeformation 00057 { 00058 // ----------------------------------------------------------------------------------------- 00059 // Constructor & Destructor 00060 public: 00065 iDeformationElastic(); 00070 ~iDeformationElastic(); 00071 00072 00073 // ----------------------------------------------------------------------------------------- 00074 // Public member functions 00075 public: 00076 // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line) 00077 FUNCTION_DEFORMATION(iDeformationElastic) 00084 int ReadAndCheckConfigurationFile(const string& a_fileOptions); 00091 int ReadAndCheckOptionsList(const string& a_listOptions); 00098 int CheckSpecificParameters(); 00105 int Initialize(); 00111 void ShowHelp(); 00121 int ApplyDeformations(FLTNB* ap_inputImage, FLTNB* ap_outputImage, int a_direction, int a_defIdx); 00122 00123 00124 // ----------------------------------------------------------------------------------------- 00125 // Private member functions 00126 private: 00127 00128 00129 // ----------------------------------------------------------------------------------------- 00130 // Data members 00131 private: 00132 vector<string> m_pathToFwdDeformationFiles; 00133 vector<string> m_pathToBwdDeformationFiles; 00134 //ParserType::Pointer file_parser; 00135 #ifdef CASTOR_ELASTIX 00136 ImageType::Pointer ITK_inputImage; 00137 ImageType::Pointer ITK_outputImage; 00138 PixelIndex m_PixelIndex; 00139 RegionType m_RegionInputImage; 00140 RegionSize m_RegionSizeInputImage; 00141 RegionStart m_RegionStartInputImage; 00142 SpacingType m_RegionSpacingInputImage; 00143 #endif 00144 }; 00145 00146 // Class for automatic insertion (set here the visible image deformation's name, put the class name as the parameters and do not add semi-colon at the end of the line) 00147 CLASS_DEFORMATION(deformationElastic,iDeformationElastic) 00148 00149 #endif