4 #include <tclap/CmdLine.h> 6 int main(
int argc,
char **argv)
8 TCLAP::CmdLine cmd(
"INRIA / IRISA - VisAGeS/Empenn Team",
' ',ANIMA_VERSION);
10 TCLAP::ValueArg<std::string> inArg(
"i",
"inputlist",
"Tensors image",
true,
"",
"input tensor image",cmd);
11 TCLAP::ValueArg<std::string> resArg(
"o",
"outputfile",
"Result log-tensor image",
true,
"",
"result log-tensor image",cmd);
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",
"Scale the output log-tensors non diagonal terms",cmd,
false);
20 catch (TCLAP::ArgException& e)
22 std::cerr <<
"Error: " << e.error() <<
"for argument " << e.argId() << std::endl;
28 MainFilterType::Pointer mainFilter = MainFilterType::New();
30 mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
31 mainFilter->SetScaleNonDiagonal(scaleArg.isSet());
33 mainFilter->SetInput(anima::readImage <MainFilterType::TInputImage> (inArg.getValue()));
37 std::cout <<
"Writing result to : " << resArg.getValue() << std::endl;
39 anima::writeImage <MainFilterType::TOutputImage> (resArg.getValue(),mainFilter->GetOutput());
int main(int argc, char **argv)