ANIMA  4.0
animaMajorityLabelVoting.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> inputArg("i","input-images","Input images",true,"","Label input images (list or 4D image)",cmd);
11  TCLAP::ValueArg<std::string> consensusImageArg("o","consensus-image","consensus label image",true,"","consensus image",cmd);
12 
13  try
14  {
15  cmd.parse(argc,argv);
16  }
17  catch (TCLAP::ArgException& e)
18  {
19  std::cerr << "Error: " << e.error() << "for argument " << e.argId() << std::endl;
20  return EXIT_FAILURE;
21  }
22 
23  typedef itk::Image <unsigned int, 3> ImageType;
25 
26  VotingFilterType::Pointer votingFilter = VotingFilterType::New();
27  anima::setMultipleImageFilterInputsFromFileName <ImageType,VotingFilterType> (inputArg.getValue(),votingFilter);
28 
29  votingFilter->Update();
30 
31  anima::writeImage <ImageType> (consensusImageArg.getValue(), votingFilter->GetOutput());
32 
33  return EXIT_SUCCESS;
34 }
int main(int argc, char **argv)