]> Creatis software - clitk.git/blob - tools/clitkRelativePositionDataBaseBuilder.cxx
GateAsciiImageIO is now cross-platform using itksys::RegularExpression
[clitk.git] / tools / clitkRelativePositionDataBaseBuilder.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 // clitk
20 #include "clitkRelativePositionDataBaseBuilder_ggo.h"
21 #include "clitkRelativePositionDataBaseBuilderGenericFilter.h"
22
23 //--------------------------------------------------------------------
24 int main(int argc, char * argv[]) {
25
26   // Init command line
27   GGO(clitkRelativePositionDataBaseBuilder, args_info);
28   CLITK_INIT;
29
30   // Filter
31   typedef clitk::RelativePositionDataBaseBuilderGenericFilter<args_info_clitkRelativePositionDataBaseBuilder> FilterType;
32   FilterType::Pointer filter = FilterType::New();
33   
34   // Set options
35   filter->SetArgsInfo(args_info);
36   
37   // Add an input to determine the type of image
38   NewAFDB(afdb, args_info.afdb_arg);
39   std::string f = afdb->GetTagValue(args_info.supportName_arg);
40   f = std::string(args_info.afdb_path_arg)+"/"+f;
41   filter->AddInputFilename(f);
42   
43   try {
44     filter->Update();
45   } catch(std::runtime_error e) {
46     std::cout << e.what() << std::endl;
47     return EXIT_FAILURE;
48   }
49
50   return EXIT_SUCCESS;
51 } // This is the end, my friend
52 //--------------------------------------------------------------------