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

Function main

Modules/ModelFit/cmdapps/GenericFitting.cpp:287–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287int main(int argc, char* argv[])
288{
289 mitkCommandLineParser parser;
290 setupParser(parser);
291
292 mitk::PreferenceListReaderOptionsFunctor readerFilterFunctor = mitk::PreferenceListReaderOptionsFunctor({ "MITK DICOM Reader v2 (autoselect)" }, { "" });
293
294 const std::map<std::string, us::Any>& parsedArgs = parser.parseArguments(argc, argv);
295 if (!configureApplicationSettings(parsedArgs))
296 {
297 return EXIT_FAILURE;
298 };
299
300 // Show a help message
301 if (parsedArgs.count("help") || parsedArgs.count("h"))
302 {
303 std::cout << parser.helpText();
304 return EXIT_SUCCESS;
305 }
306
307 //! [do processing]
308 try
309 {
310 image = mitk::IOUtil::Load<mitk::Image>(inFilename, &readerFilterFunctor);
311 std::cout << "Input: " << inFilename << std::endl;
312
313 if (!maskFileName.empty())
314 {
315 mask = mitk::IOUtil::Load<mitk::Image>(maskFileName, &readerFilterFunctor);
316 std::cout << "Mask: " << maskFileName << std::endl;
317 }
318 else
319 {
320 std::cout << "Mask: none" << std::endl;
321 }
322
323 if (roibased && mask.IsNull())
324 {
325 mitkThrow() << "Error. Cannot fit. Please specify mask if you select roi based fitting.";
326 }
327
328 std::cout << "Style: ";
329 if (roibased)
330 {
331 std::cout << "ROI based";
332 }
333 else
334 {
335 std::cout << "pixel based";
336 }
337 std::cout << std::endl;
338
339 doFitting();
340
341 std::cout << "Processing finished." << std::endl;
342
343 return EXIT_SUCCESS;
344 }

Callers

nothing calls this directly

Calls 9

parseArgumentsMethod · 0.80
countMethod · 0.80
helpTextMethod · 0.80
whatMethod · 0.80
setupParserFunction · 0.70
doFittingFunction · 0.70
emptyMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected