MCPcopy Create free account
hub / github.com/MITK/MITK / setupParser

Function setupParser

Modules/ModelFit/cmdapps/GenericFitting.cpp:59–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57
58
59void setupParser(mitkCommandLineParser& parser)
60{
61 // set general information about your MiniApp
62 parser.setCategory("Dynamic Data Analysis Tools");
63 parser.setTitle("Generic Fitting");
64 parser.setDescription("MiniApp that allows to make a pixel based fitting on the intensity signal over time for a given model function.");
65 parser.setContributor("DKFZ MIC");
66 //! [create parser]
67
68 //! [add arguments]
69 // how should arguments be prefixed
70 parser.setArgumentPrefix("--", "-");
71 // add each argument, unless specified otherwise each argument is optional
72 // see mitkCommandLineParser::addArgument for more information
73 parser.beginGroup("Model parameters");
74 parser.addArgument(
75 "function", "f", mitkCommandLineParser::String, "Model function", "Function that should be used to fit the intensity signals. Options are: \"Linear\" or \"<Parameter Number>\" (for generic formulas).", us::Any(std::string("Linear")));
76 parser.addArgument(
77 "formular", "y", mitkCommandLineParser::String, "Generic model function formular", "Formular of a generic model (if selected) that will be parsed and fitted.", us::Any());
78 parser.endGroup();
79 parser.beginGroup("Required I/O parameters");
80 parser.addArgument(
81 "input", "i", mitkCommandLineParser::File, "Input file", "input 3D+t image file", us::Any(), false, false, false, mitkCommandLineParser::Input);
82 parser.addArgument("output",
83 "o",
84 mitkCommandLineParser::File,
85 "Output file template",
86 "where to save the output parameter images. The specified path will be used as template to determine the format (via extension) and the name \"root\". For each parameter a suffix will be added to the name.",
87 us::Any(),
88 false, false, false, mitkCommandLineParser::Output);
89 parser.endGroup();
90
91 parser.beginGroup("Optional parameters");
92 parser.addArgument(
93 "mask", "m", mitkCommandLineParser::File, "Mask file", "Mask that defines the spatial image region that should be fitted. Must have the same geometry as the input image!", us::Any(), true, false, false, mitkCommandLineParser::Input);
94 parser.addArgument(
95 "verbose", "v", mitkCommandLineParser::Bool, "Verbose Output", "Whether to produce verbose output");
96 parser.addArgument(
97 "roibased", "r", mitkCommandLineParser::Bool, "Roi based fitting", "Will compute a mean intensity signal over the ROI before fitting it. If this mode is used a mask must be specified.");
98 parser.addArgument("help", "h", mitkCommandLineParser::Bool, "Help:", "Show this help text");
99 parser.endGroup();
100 //! [add arguments]
101}
102
103bool configureApplicationSettings(std::map<std::string, us::Any> parsedArgs)
104{

Callers 1

mainFunction · 0.70

Calls 9

setCategoryMethod · 0.80
setContributorMethod · 0.80
setArgumentPrefixMethod · 0.80
beginGroupMethod · 0.80
addArgumentMethod · 0.80
endGroupMethod · 0.80
AnyClass · 0.50
setTitleMethod · 0.45
setDescriptionMethod · 0.45

Tested by

no test coverage detected