]> Creatis software - clitk.git/blobdiff - tools/clitkAffineTransformGenericFilter.h
Add tool to convert Elastix param into matrix file
[clitk.git] / tools / clitkAffineTransformGenericFilter.h
index 2be7ec6004721f22cafa3a56f0c83175239e140d..39506326f572a2bb614da44524c64547879eda41 100644 (file)
@@ -1,3 +1,20 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to: 
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
+
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
+
+  It is distributed under dual licence
+
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
 #ifndef clitkAffineTransformGenericFilter_h
 #define clitkAffineTransformGenericFilter_h
 
@@ -70,6 +87,11 @@ namespace clitk
     //----------------------------------------  
     void Update();
 
+    template<unsigned int Dimension, class PixelType>
+      static
+      typename itk::Matrix<double, Dimension+1, Dimension+1>
+      createMatrixFromElastixFile(std::vector<std::string> & filename, bool verbose=true);
+
   protected:
 
     //----------------------------------------  
@@ -86,6 +108,10 @@ namespace clitk
     template <unsigned int Dimension, class PixelType>  void UpdateWithDimAndPixelType();
     template <unsigned int Dimension, class PixelType>  void UpdateWithDimAndVectorType();
 
+    static bool GetElastixValueFromTag(std::ifstream & is, std::string tag, std::string & value); 
+    static void GetValuesFromValue(const std::string & s, 
+                                   std::vector<std::string> & values);
+
     //----------------------------------------  
     // Data members
     //----------------------------------------