X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageInfo.cxx;h=33d80cbf3551bdaae3af0b0934411d9df8e06aa6;hb=babf100c0d140f6b2525532d001b7794fb47a625;hp=dc1aae0e58cf07a8fc1cbff108e9c105dd512d53;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/tools/clitkImageInfo.cxx b/tools/clitkImageInfo.cxx index dc1aae0..33d80cb 100644 --- a/tools/clitkImageInfo.cxx +++ b/tools/clitkImageInfo.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.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 @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ /** ================================================= * @file clitkImageInfo.cxx @@ -29,6 +29,8 @@ #include "clitkImageInfo_ggo.h" #include "clitkIO.h" #include "clitkImageCommon.h" +#include "clitkCommon.h" +#include "vvImageReader.h" //==================================================================== int main(int argc, char * argv[]) @@ -60,7 +62,29 @@ int main(int argc, char * argv[]) else { std::cerr << "*** Warning : I could not read '" << args_info.inputs[i] << "' ***" << std::endl; } - } + + if (args_info.matrix_flag) { + vvImageReader::Pointer r = vvImageReader::New(); + r->SetInputFilename(args_info.inputs[i]); + r->Update(vvImageReader::IMAGE); + vtkMatrix4x4 * m = r->GetOutput()->GetTransform()[0]->GetMatrix(); + for(int i=0; i<4; i++) { + for(int j=0; j<4; j++) + std::cout << m->GetElement(i,j) << " "; + std::cout << std::endl; + } + + // inverse + m->Invert(); + for(int i=0; i<4; i++) { + for(int j=0; j<4; j++) + std::cout << m->GetElement(i,j) << " "; + std::cout << std::endl; + } + + } + } // end for + // this is the end my friend return 0;