| 375 | } |
| 376 | |
| 377 | int main(int argc, char* argv[]) |
| 378 | { |
| 379 | mitkCommandLineParser parser; |
| 380 | setupParser(parser); |
| 381 | const std::map<std::string, us::Any>& parsedArgs = parser.parseArguments(argc, argv); |
| 382 | |
| 383 | mitk::PreferenceListReaderOptionsFunctor readerFilterFunctor = mitk::PreferenceListReaderOptionsFunctor({ "MITK DICOM Reader v2 (autoselect)" }, { "" }); |
| 384 | |
| 385 | if (!configureApplicationSettings(parsedArgs)) |
| 386 | { |
| 387 | return EXIT_FAILURE; |
| 388 | }; |
| 389 | |
| 390 | // Show a help message |
| 391 | if (parsedArgs.count("help") || parsedArgs.count("h")) |
| 392 | { |
| 393 | std::cout << parser.helpText(); |
| 394 | return EXIT_SUCCESS; |
| 395 | } |
| 396 | |
| 397 | if (!captions.empty() && inFilenames.size() != captions.size()) |
| 398 | { |
| 399 | std::cerr << "Cannot dump images. Number of given captions does not equal number of given images."; |
| 400 | return EXIT_FAILURE; |
| 401 | }; |
| 402 | |
| 403 | //! [do processing] |
| 404 | try |
| 405 | { |
| 406 | std::cout << "Load images:" << std::endl; |
| 407 | for (auto path : inFilenames) |
| 408 | { |
| 409 | std::cout << "Input: " << path << std::endl; |
| 410 | auto image = mitk::IOUtil::Load<mitk::Image>(path, &readerFilterFunctor); |
| 411 | images.push_back(image); |
| 412 | |
| 413 | } |
| 414 | |
| 415 | if (!maskFileName.empty()) |
| 416 | { |
| 417 | mask = mitk::IOUtil::Load<mitk::Image>(maskFileName, &readerFilterFunctor); |
| 418 | std::cout << "Mask: " << maskFileName << std::endl; |
| 419 | } |
| 420 | else |
| 421 | { |
| 422 | std::cout << "Mask: none" << std::endl; |
| 423 | } |
| 424 | |
| 425 | doDumping(); |
| 426 | storeCSV(); |
| 427 | |
| 428 | std::cout << "Processing finished." << std::endl; |
| 429 | |
| 430 | return EXIT_SUCCESS; |
| 431 | } |
| 432 | catch (const itk::ExceptionObject& e) |
| 433 | { |
| 434 | MITK_ERROR << e.what(); |
nothing calls this directly
no test coverage detected