2 #include <tclap/CmdLine.h> 7 int main(
int argc,
char **argv)
9 TCLAP::CmdLine cmd(
"INRIA / IRISA - VisAGeS/Empenn Team",
' ',ANIMA_VERSION);
11 TCLAP::ValueArg<std::string> refODFArg(
"i",
"inputodf",
"ODF Test Image",
true,
"",
"ODF test image",cmd);
12 TCLAP::ValueArg<std::string> dataODFArg(
"I",
"databaseodf",
"ODF Database Image List",
true,
"",
"ODF database image list",cmd);
14 TCLAP::ValueArg<std::string> maskArg(
"m",
"maskname",
"Computation mask",
true,
"",
"computation mask",cmd);
15 TCLAP::ValueArg<std::string> resArg(
"o",
"outputname",
"Z-Score output image",
true,
"",
"Z-Score output image",cmd);
16 TCLAP::ValueArg<std::string> resPValArg(
"O",
"outpvalname",
"P-value output image",
true,
"",
"P-Value output image",cmd);
18 TCLAP::ValueArg<std::string> statTestArg(
"t",
"stat-test",
"Statistical test to use ([fisher],chi)",
false,
"fisher",
"statistical test",cmd);
19 TCLAP::ValueArg<double> expVarArg(
"e",
"expvar",
"PCA threshold: threshold on eigenvalues to compute the new basis (default: 0.9)",
false,0.9,
"PCA threshold",cmd);
20 TCLAP::ValueArg<unsigned int> numEigenArg(
"E",
"numeigenpca",
"Number of eigenvalues to keep (default: 6)",
false,6,
"Number of PCA eigen values",cmd);
22 TCLAP::ValueArg<unsigned int> nbpArg(
"p",
"numberofthreads",
"Number of threads to run on (default: all cores)",
false,itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(),
"number of threads",cmd);
23 TCLAP::ValueArg<unsigned int> nbThetaArg(
"T",
"theta",
"Number of theta values (theta varies between 0 and pi/2",
false,0,
"number of theta values",cmd);
24 TCLAP::ValueArg<unsigned int> nbPhiArg(
"P",
"phi",
"Number of phi values (theta varies between 0 and 2 pi",
false,0,
"number of phi values",cmd);
26 TCLAP::ValueArg<std::string> samplesFileNameArg(
"d",
"sampledirectionsfile",
"Samples directions in a text file",
false,
"",
"Samples directions file",cmd);
28 TCLAP::ValueArg<unsigned int> splitsArg(
"s",
"split",
"Split image for low memory (default: 2)",
false,2,
"Number of splits",cmd);
29 TCLAP::ValueArg<int> specSplitArg(
"S",
"splittoprocess",
"Specific split to process (use to run on cluster (default: -1 = all)",
false,-1,
"Split to process",cmd);
30 TCLAP::SwitchArg genOutputDescroArg(
"G",
"generateouputdescription",
"Generate ouptut description data",cmd,
false);
36 catch (TCLAP::ArgException& e)
38 std::cerr <<
"Error: " << e.error() <<
"for argument " << e.argId() << std::endl;
42 std::string dataODFName, maskName;
43 dataODFName = dataODFArg.getValue();
44 maskName = maskArg.getValue();
48 MultiAtlasZScoreBridgeType *mainFilter =
new MultiAtlasZScoreBridgeType;
50 mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
52 mainFilter->SetNumEigenValuesPCA(numEigenArg.getValue());
53 mainFilter->SetExplainedRatio(expVarArg.getValue());
55 mainFilter->SetDataODFFileNames(dataODFName);
56 mainFilter->SetTestODFFileName(refODFArg.getValue());
59 samplesFileNameArg.getValue());
61 mainFilter->SetSampleDirections(sampleDirections);
63 if (statTestArg.getValue() ==
"chi")
64 mainFilter->SetStatisticalTestType(MultiAtlasZScoreBridgeType::MainFilterType::CHI_SQUARE);
66 mainFilter->SetStatisticalTestType(MultiAtlasZScoreBridgeType::MainFilterType::FISHER);
68 mainFilter->SetOutputName(resArg.getValue());
69 mainFilter->SetOutputPValName(resPValArg.getValue());
71 mainFilter->SetNbSplits(splitsArg.getValue());
75 mainFilter->Update(specSplitArg.getValue(),genOutputDescroArg.getValue());
77 catch(itk::ExceptionObject &e)
79 std::cerr << e << std::endl;
void SetComputationMask(std::string &cMask)
int main(int argc, char **argv)
std::vector< std::vector< double > > InitializeSampleDirections(unsigned int nbTheta, unsigned int nbPhi, std::string sampleDirFileName)