1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
3 Main authors : XX XX XX
6 - University of LYON http://www.universite-lyon.fr/
7 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
8 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the copyright notices for more information.
14 It is distributed under dual licence
15 - BSD http://www.opensource.org/licenses/bsd-license.php
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
18 =========================================================================*/
21 #include "clitkCommon.h"
22 #include "clitkMergeAsciiDoseActor_ggo.h"
24 //--------------------------------------------------------------------
25 int main(int argc, char * argv[]) {
28 GGO(clitkMergeAsciiDoseActor, args_info);
31 std::vector<double> input1;
32 clitk::readDoubleFromFile(args_info.input1_arg, input1);
36 std::vector<double> input2;
37 clitk::readDoubleFromFile(args_info.input2_arg, input2);
41 if (input1.size() != input2.size()) {
42 std::cerr << "Error. Please provide input file with the same number of values. Read "
43 << input1.size() << " in " << args_info.input1_arg
44 << " and " << input2.size() << " in " << args_info.input2_arg << std::endl;
49 for(unsigned int i=0; i<input1.size(); i++) {
50 input1[i] += input2[i];
55 clitk::openFileForWriting(os, args_info.output_arg);
56 os << "## Merge " << input1.size() << " values" << std::endl;
57 for(unsigned int i=0; i<input1.size(); i++) {
58 os << input1[i] << std::endl;
62 // This is the end my friend