ANIMA  4.0
animaExpTensors.cxx
Go to the documentation of this file.
3 
4 #include <tclap/CmdLine.h>
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> inArg("i","inputlist","Log-tensors image",true,"","input log-tensor image",cmd);
11  TCLAP::ValueArg<std::string> resArg("o","outputfile","Result tensor image",true,"","result tensor image",cmd);
12 
13  TCLAP::ValueArg<unsigned int> nbpArg("T","nb-threads","Number of threads (default: all cores)",false,itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(),"Number of threads",cmd);
14  TCLAP::SwitchArg scaleArg("S","scale","The log-tensors have their non-diagonal terms scaled",cmd,false);
15 
16  try
17  {
18  cmd.parse(argc,argv);
19  }
20  catch (TCLAP::ArgException& e)
21  {
22  std::cerr << "Error: " << e.error() << "for argument " << e.argId() << std::endl;
23  return EXIT_FAILURE;
24  }
25 
26  typedef anima::ExpTensorImageFilter <double> MainFilterType;
27 
28  MainFilterType::Pointer mainFilter = MainFilterType::New();
29 
30  mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
31  mainFilter->SetScaleNonDiagonal(scaleArg.isSet());
32  mainFilter->SetInput(anima::readImage <MainFilterType::TInputImage> (inArg.getValue()));
33 
34  mainFilter->Update();
35 
36  std::cout << "Writing result to : " << resArg.getValue() << std::endl;
37 
38  anima::writeImage <MainFilterType::TOutputImage> (resArg.getValue(),mainFilter->GetOutput());
39 
40  return EXIT_SUCCESS;
41 }
int main(int argc, char **argv)