1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef CLITKIMAGECONVERT_CXX
19 #define CLITKIMAGECONVERT_CXX
21 -------------------------------------------------
22 * @file clitkImageConvert.cxx
23 * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
24 * @date 03 Jul 2006 10:28:32
25 -------------------------------------------------*/
28 #include "clitkImageConvert_ggo.h"
30 #include "clitkImageCommon.h"
31 #include "clitkImageConvertGenericFilter.h"
33 //-------------------------------------------------------------------=
34 int main(int argc, char * argv[])
38 GGO(clitkImageConvert, args_info);
41 // Get list of filenames
42 std::vector<std::string> l;
43 for(unsigned int i=0; i<args_info.input_given; i++) {
44 l.push_back(args_info.input_arg[i]);
46 for(unsigned int i=0; i<args_info.inputs_num; i++) {
47 l.push_back(args_info.inputs[i]);
50 std::cerr << "Error, you should give at least one --input option or one image filename on the commande line." << std::endl;
55 clitk::ImageConvertGenericFilter::Pointer filter = clitk::ImageConvertGenericFilter::New();
56 filter->SetInputFilenames(l);
57 filter->SetIOVerbose(args_info.verbose_flag);
58 filter->SetOutputFilename(args_info.output_arg);
59 filter->EnableWriteCompression(args_info.compression_flag);
60 if (args_info.type_given) filter->SetOutputPixelType(args_info.type_arg);
63 CLITK_TRY_CATCH_EXIT(filter->Update());
65 // this is the end my friend
68 //-------------------------------------------------------------------=
70 #endif /* end #define CLITKIMAGECONVERT_CXX */