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

Function main

Modules/Pharmacokinetics/cmdapps/MRPerfusion.cpp:776–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

774}
775
776int main(int argc, char* argv[])
777{
778 mitkCommandLineParser parser;
779 setupParser(parser);
780 const std::map<std::string, us::Any>& parsedArgs = parser.parseArguments(argc, argv);
781
782 mitk::PreferenceListReaderOptionsFunctor readerFilterFunctor = mitk::PreferenceListReaderOptionsFunctor({ "MITK DICOM Reader v2 (autoselect)" }, { "" });
783
784 if (!configureApplicationSettings(parsedArgs))
785 {
786 return EXIT_FAILURE;
787 };
788
789 // Show a help message
790 if (parsedArgs.count("help") || parsedArgs.count("h"))
791 {
792 std::cout << parser.helpText();
793 return EXIT_SUCCESS;
794 }
795
796 //! [do processing]
797 try
798 {
799 image = mitk::IOUtil::Load<mitk::Image>(inFilename, &readerFilterFunctor);
800 std::cout << "Input: " << inFilename << std::endl;
801
802 if (!maskFileName.empty())
803 {
804 mask = mitk::IOUtil::Load<mitk::Image>(maskFileName, &readerFilterFunctor);
805 std::cout << "Mask: " << maskFileName << std::endl;
806 }
807 else
808 {
809 std::cout << "Mask: none" << std::endl;
810 }
811
812 if (modelName != MODEL_NAME_descriptive && modelName != MODEL_NAME_3SL && MODEL_NAME_2SL != modelName)
813 {
814 if (!aifMaskFileName.empty())
815 {
816 aifMask = mitk::IOUtil::Load<mitk::Image>(aifMaskFileName, &readerFilterFunctor);
817 std::cout << "AIF mask: " << aifMaskFileName << std::endl;
818 }
819 else
820 {
821 mitkThrow() << "Error. Cannot fit. Chosen model needs an AIF. Please specify AIF mask (--aifmask).";
822 }
823 if (!aifImageFileName.empty())
824 {
825 aifImage = mitk::IOUtil::Load<mitk::Image>(aifImageFileName, &readerFilterFunctor);
826 std::cout << "AIF image: " << aifImageFileName << std::endl;
827 }
828 else
829 {
830 std::cout << "AIF image: none (using signal image)" << std::endl;
831 }
832 }
833

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected