]> Creatis software - clitk.git/commitdiff
- merger for gate
authordsarrut <dsarrut>
Tue, 30 Mar 2010 14:04:01 +0000 (14:04 +0000)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Fri, 26 Jul 2013 06:32:31 +0000 (08:32 +0200)
tests_dav/clitkMergeRootFiles.cxx [new file with mode: 0644]
tests_dav/clitkMergeRootFiles.ggo [new file with mode: 0644]

diff --git a/tests_dav/clitkMergeRootFiles.cxx b/tests_dav/clitkMergeRootFiles.cxx
new file mode 100644 (file)
index 0000000..b4b6721
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+   =================================================
+   * @file   clitkMergeRootFiles.cxx
+   * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
+   * @date   01 Apr 2009
+   * 
+   * @brief  
+   * 
+   =================================================*/
+
+#include "clitkMergeRootFiles_ggo.h"
+#include "clitkCommon.h"
+#include <string> 
+#include "TROOT.h"
+#include "TFile.h"
+#include "TFileMerger.h"
+
+//-----------------------------------------------------------------------------
+int main(int argc, char * argv[]) {
+
+  // init command line
+  GGO(clitkMergeRootFiles, args_info);
+
+  // Check parameters
+  if (args_info.input_given < 2) {
+    FATAL("Error, please provide at least two inputs files");
+  }
+
+  // Merge
+  TFileMerger * merger = new TFileMerger;
+  for (uint i=0; i<args_info.input_given; i++) merger->AddFile(args_info.input_arg[i]);
+  merger->OutputFile(args_info.output_arg);
+  merger->Merge();
+
+  // this is the end my friend  
+  return 0;
+}
+//-----------------------------------------------------------------------------
diff --git a/tests_dav/clitkMergeRootFiles.ggo b/tests_dav/clitkMergeRootFiles.ggo
new file mode 100644 (file)
index 0000000..4180c20
--- /dev/null
@@ -0,0 +1,12 @@
+# --------------------------------------------
+# file clitkMergeRootFiles.ggo
+package "clitkMergeRootFiles"
+version "1.0"
+purpose "Merge several ROOT files"
+# --------------------------------------------
+
+option "config"                -  "Config file"               string no
+option "input"                 i  "Input ROOT filenames"      string multiple yes
+option "output"                o  "Output ROOT filename"      string yes
+
+