2 #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> refLTArg(
"i",
"input",
"Test Image",
true,
"",
"test image",cmd);
11 TCLAP::ValueArg<std::string> dataLTArg(
"I",
"database",
"Database Image List",
true,
"",
"database image list",cmd);
13 TCLAP::ValueArg<std::string> maskArg(
"m",
"maskname",
"Computation mask",
true,
"",
"computation mask",cmd);
14 TCLAP::ValueArg<std::string> resArg(
"o",
"outputpval",
"P-values output image",
true,
"",
"P-values output image",cmd);
16 TCLAP::ValueArg<std::string> dbMeanDistAveArg(
"d",
"dbmeanave",
"DB average mean distance image",
true,
"",
"DB average mean distance image",cmd);
17 TCLAP::ValueArg<std::string> dbMeanDistStdArg(
"D",
"dbmeanstd",
"DB std mean distance image",
true,
"",
"DB std mean distance image",cmd);
18 TCLAP::ValueArg<std::string> dbCovDistAveArg(
"",
"dbcovave",
"DB average covariance distance image",
true,
"",
"DB average covariance distance image",cmd);
19 TCLAP::ValueArg<std::string> dbCovDistStdArg(
"",
"dbcovstd",
"DB std covariance distance image",
true,
"",
"DB std covariance distance image",cmd);
21 TCLAP::ValueArg<std::string> resScoreArg(
"O",
"outputscore",
"Score output image",
false,
"",
"Score output image",cmd);
22 TCLAP::ValueArg<std::string> resNumPatchesArg(
"",
"outputnpatches",
"Number of patches output image",
false,
"",
"Number of patches output image",cmd);
24 TCLAP::ValueArg<double> weightThrArg(
"w",
"weightthr",
"NL weight threshold: patches around have to be similar enough (default: 0.0)",
false,0.0,
"NL weight threshold",cmd);
25 TCLAP::ValueArg<double> meanThrArg(
"M",
"patchmeanthr",
"Tolerance for means test (test if meansTest > meanDatabase + M * stdDatabase, default: M=2.5)",
false,2.5,
"NL mean patch proportion",cmd);
26 TCLAP::ValueArg<double> varThrArg(
"c",
"patchcovthr",
"Tolerance for covariance test (test if covDist > meanDatabase + c * stdDatabase, default: c=2.5)",
false,2.5,
"NL covariance patch proportion",cmd);
27 TCLAP::ValueArg<double> betaArg(
"b",
"beta",
"Beta parameter for local noise estimation (default: 1)",
false,1,
"Beta for local noise estimation",cmd);
29 TCLAP::ValueArg<unsigned int> nbpArg(
"p",
"numberofthreads",
"Number of threads to run on (default: all cores)",
false,itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(),
"number of threads",cmd);
31 TCLAP::ValueArg<unsigned int> patchHSArg(
"",
"patchhalfsize",
"Patch half size in each direction (default: 1)",
false,1,
"patch half size",cmd);
32 TCLAP::ValueArg<unsigned int> patchSSArg(
"",
"patchstepsize",
"Patch step size for searching (default: 1)",
false,1,
"patch search step size",cmd);
33 TCLAP::ValueArg<unsigned int> patchNeighArg(
"n",
"patchneighborhood",
"Patch half neighborhood size (default: 2)",
false,2,
"patch search neighborhood size",cmd);
35 TCLAP::ValueArg<unsigned int> splitsArg(
"s",
"split",
"Split image for low memory (default: 2)",
false,2,
"Number of splits",cmd);
36 TCLAP::ValueArg<int> specSplitArg(
"S",
"splittoprocess",
"Specific split to process (use to run on cluster (default: -1 = all)",
false,-1,
"Split to process",cmd);
37 TCLAP::SwitchArg genOutputDescroArg(
"G",
"generateouputdescription",
"Generate ouptut description data",cmd,
false);
43 catch (TCLAP::ArgException& e)
45 std::cerr <<
"Error: " << e.error() <<
"for argument " << e.argId() << std::endl;
49 std::string dataName, maskName;
50 dataName = dataLTArg.getValue();
51 maskName = maskArg.getValue();
55 NLMeansPatientToGroupComparisonBridgeType *mainFilter =
new NLMeansPatientToGroupComparisonBridgeType;
57 mainFilter->SetNumberOfWorkUnits(nbpArg.getValue());
59 mainFilter->SetPatchHalfSize(patchHSArg.getValue());
60 mainFilter->SetSearchNeighborhood(patchNeighArg.getValue());
61 mainFilter->SetSearchStepSize(patchSSArg.getValue());
63 mainFilter->SetWeightThreshold(weightThrArg.getValue());
64 mainFilter->SetMeanThreshold(meanThrArg.getValue());
65 mainFilter->SetVarianceThreshold(varThrArg.getValue());
67 mainFilter->SetBetaParameter(betaArg.getValue());
69 mainFilter->SetDatabaseNames(dataName);
70 mainFilter->SetTestFileName(refLTArg.getValue());
72 mainFilter->SetDatabaseMeanDistanceAverageFileName(dbMeanDistAveArg.getValue());
73 mainFilter->SetDatabaseMeanDistanceStdFileName(dbMeanDistStdArg.getValue());
74 mainFilter->SetDatabaseCovarianceDistanceAverageFileName(dbCovDistAveArg.getValue());
75 mainFilter->SetDatabaseCovarianceDistanceStdFileName(dbCovDistStdArg.getValue());
77 mainFilter->SetOutputScoreName(resScoreArg.getValue());
78 mainFilter->SetOutputPValName(resArg.getValue());
79 mainFilter->SetOutputNPatchesName(resNumPatchesArg.getValue());
81 mainFilter->SetNbSplits(splitsArg.getValue());
85 mainFilter->Update(specSplitArg.getValue(),genOutputDescroArg.getValue());
87 catch(itk::ExceptionObject &e)
89 std::cerr << e << std::endl;
int main(int argc, char **argv)
void SetComputationMask(std::string &cMask)