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 ===========================================================================**/
20 #include "clitkRelativePositionAnalyzer_ggo.h"
21 #include "clitkRelativePositionAnalyzerGenericFilter.h"
23 //--------------------------------------------------------------------
24 int main(int argc, char * argv[]) {
27 GGO(clitkRelativePositionAnalyzer, args_info);
31 typedef clitk::RelativePositionAnalyzerGenericFilter<args_info_clitkRelativePositionAnalyzer> FilterType;
32 FilterType::Pointer filter = FilterType::New();
34 // Set filename from the AFDB if needed
35 #define SetOptionFromAFDBMacro(ARGS, OPTIONNAME, OPTION) \
36 if (ARGS.OPTIONNAME##_given) { \
37 if (ARGS.OPTION##_given) { \
38 std::cerr << "Warning --"#OPTION" is ignored" << std::endl; \
40 std::string f = afdb->GetTagValue(ARGS.OPTIONNAME##_arg); \
41 f = std::string(args_info.afdb_path_arg)+"/"+f; \
42 filter->AddInputFilename(f); \
44 else if (!ARGS.OPTION##_given) { \
45 std::cerr << "Error on the command line please provide --"#OPTION" or --"#OPTIONNAME"." << std::endl; \
46 return EXIT_FAILURE; \
50 filter->SetArgsInfo(args_info);
52 NewAFDB(afdb, args_info.afdb_arg);
53 // The order is important. If --supportName and --support are
54 // given, the first is set before, so the second ignored
55 SetOptionFromAFDBMacro(args_info, supportName, support);
56 SetOptionFromAFDBMacro(args_info, objectName, object);
57 SetOptionFromAFDBMacro(args_info, targetName, target);
62 } catch(std::runtime_error e) {
63 std::cout << e.what() << std::endl;
68 } // This is the end, my friend
69 //--------------------------------------------------------------------