ANIMA  4.0
animaGeneralizedFA.cxx
Go to the documentation of this file.
3 #include <tclap/CmdLine.h>
4 
5 int main(int argc, char **argv)
6 {
7  TCLAP::CmdLine cmd("INRIA / IRISA - VisAGeS/Empenn Team", ' ',ANIMA_VERSION);
8 
9  TCLAP::ValueArg<std::string> inArg("i","inputodf","ODF volume",true,"","ODF volume",cmd);
10  TCLAP::ValueArg<std::string> resArg("o","output","Result image",true,"","result GFA image",cmd);
11 
12  TCLAP::ValueArg<unsigned int> nbpArg("p","numberofthreads","Number of threads to run on (default: all cores)",false,itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(),"number of threads",cmd);
13 
14  try
15  {
16  cmd.parse(argc,argv);
17  }
18  catch (TCLAP::ArgException& e)
19  {
20  std::cerr << "Error: " << e.error() << "for argument " << e.argId() << std::endl;
21  return EXIT_FAILURE;
22  }
23 
24  typedef anima::GeneralizedFAImageFilter <double> MainFilterType;
25 
26  MainFilterType::Pointer mainFilter = MainFilterType::New();
27  mainFilter->SetInput(anima::readImage <MainFilterType::TInputImage> (inArg.getValue()));
28  mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
29 
30  mainFilter->Update();
31 
32  anima::writeImage <MainFilterType::TOutputImage> (resArg.getValue(),mainFilter->GetOutput());
33 
34  return EXIT_SUCCESS;
35 }
int main(int argc, char **argv)