]> Creatis software - clitk.git/blobdiff - tools/clitkImageConvert.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / tools / clitkImageConvert.cxx
index b4fceed096e458a8898a1084c54cf1307b7f77a9..64bcfe180a32a50f9f8759341e6e63d0d1b3efba 100644 (file)
@@ -1,21 +1,22 @@
-/*-------------------------------------------------------------------------
-                                                                                
-Program:   clitk
-Language:  C++
-                                                                                
-Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
-l'Image). All rights reserved. See Doc/License.txt or
-http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
-                                                                                
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.  See the above copyright notices for more information.
-                                                                             
--------------------------------------------------------------------------*/
+/*=========================================================================
+  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 CLITKIMAGECONVERT_CXX
 #define CLITKIMAGECONVERT_CXX
-
 /**
    -------------------------------------------------
    * @file   clitkImageConvert.cxx
@@ -30,7 +31,8 @@ PURPOSE.  See the above copyright notices for more information.
 #include "clitkImageConvertGenericFilter.h"
 
 //-------------------------------------------------------------------=
-int main(int argc, char * argv[]) {
+int main(int argc, char * argv[])
+{
 
   // init command line
   GGO(clitkImageConvert, args_info);
@@ -47,19 +49,20 @@ int main(int argc, char * argv[]) {
   if (l.size() < 1) {
     std::cerr << "Error, you should give at least one --input option or one image filename on the commande line." << std::endl;
     exit(0);
-  }  
+  }
 
   // Create filter
   clitk::ImageConvertGenericFilter::Pointer filter = clitk::ImageConvertGenericFilter::New();
   filter->SetInputFilenames(l);
   filter->SetIOVerbose(args_info.verbose_flag);
   filter->SetOutputFilename(args_info.output_arg);
+  filter->EnableWriteCompression(args_info.compression_flag);
   if (args_info.type_given) filter->SetOutputPixelType(args_info.type_arg);
 
   // Go !
-  filter->Update();  
+  CLITK_TRY_CATCH_EXIT(filter->Update());
 
-  // this is the end my friend  
+  // this is the end my friend
   return 0;
 }
 //-------------------------------------------------------------------=