ANIMA  4.0
animaLowMemLocalPatchCovarianceDistance.cxx
Go to the documentation of this file.
1 #include <iostream>
2 #include <tclap/CmdLine.h>
3 
5 
6 int main(int argc, char **argv)
7 {
8  TCLAP::CmdLine cmd("INRIA / IRISA - VisAGeS/Empenn Team", ' ',ANIMA_VERSION);
9 
10  TCLAP::ValueArg<std::string> dataLTArg("i","database","Database Image List",true,"","database image list",cmd);
11 
12  TCLAP::ValueArg<std::string> maskArg("m","maskname","Computation mask",true,"","computation mask",cmd);
13  TCLAP::ValueArg<std::string> resArg("o","outputmean","Average distance output image",true,"","Average distance output image",cmd);
14 
15  TCLAP::ValueArg<std::string> resStdArg("O","outputstd","Standard deviation output image",false,"","Standard deviation output image",cmd);
16 
17  TCLAP::ValueArg<unsigned int> nbpArg("p","numberofthreads","Number of threads to run on (default: all cores)",false,itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(),"number of threads",cmd);
18 
19  TCLAP::ValueArg<unsigned int> patchHSArg("","patchhalfsize","Patch half size in each direction (default: 1)",false,1,"patch half size",cmd);
20 
21  TCLAP::ValueArg<unsigned int> splitsArg("s","split","Split image for low memory (default: 2)",false,2,"Number of splits",cmd);
22  TCLAP::ValueArg<int> specSplitArg("S","splittoprocess","Specific split to process (use to run on cluster (default: -1 = all)",false,-1,"Split to process",cmd);
23  TCLAP::SwitchArg genOutputDescroArg("G","generateouputdescription","Generate ouptut description data",cmd,false);
24 
25  try
26  {
27  cmd.parse(argc,argv);
28  }
29  catch (TCLAP::ArgException& e)
30  {
31  std::cerr << "Error: " << e.error() << "for argument " << e.argId() << std::endl;
32  return(1);
33  }
34 
35  std::string dataName, maskName;
36  dataName = dataLTArg.getValue();
37  maskName = maskArg.getValue();
38 
40 
41  MainBridgeType *mainFilter = new MainBridgeType;
42  mainFilter->SetComputationMask(maskName);
43  mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
44 
45  mainFilter->SetPatchHalfSize(patchHSArg.getValue());
46  mainFilter->SetDatabaseNames(dataName);
47 
48  mainFilter->SetOutputMeanName(resArg.getValue());
49  mainFilter->SetOutputStdName(resStdArg.getValue());
50 
51  mainFilter->SetNbSplits(splitsArg.getValue());
52 
53  try
54  {
55  mainFilter->Update(specSplitArg.getValue(),genOutputDescroArg.getValue());
56  }
57  catch(itk::ExceptionObject &e)
58  {
59  std::cerr << e << std::endl;
60  return 1;
61  }
62 
63  delete mainFilter;
64 
65  return 0;
66 }
int main(int argc, char **argv)