26 int main(
int argc,
char* argv[] )
30 parser.
setTitle(
"Test basic hotspot functionality");
41 std::cout <<
"test...." << std::endl;
43 std::map<std::string, us::Any> parsedArgs = parser.
parseArguments(argc, argv);
44 std::cout <<
"parsedArgs.size()= " << parsedArgs.size() << std::endl;
45 if (parsedArgs.size()==0 || parsedArgs.count(
"help") || parsedArgs.count(
"h"))
54 std::string inputImageFile;
55 if (!parsedArgs.count(
"i") && !parsedArgs.count(
"input"))
57 inputImageFile =
"/home/fabian/MITK/MITK_platform_project/bin/MITK-superbuild/MITK-Data/Pic3D.nrrd";
61 inputImageFile =
us::any_cast<std::string>(parsedArgs[
"input"]);
65 if (parsedArgs.count(
"mask") || parsedArgs.count(
"m"))
67 std::string maskImageFile =
us::any_cast<std::string>(parsedArgs[
"mask"]);
72 if (parsedArgs.count(
"out") || parsedArgs.count(
"o") )
73 outFile = us::any_cast<std::string>(parsedArgs[
"out"]);
75 outFile =
"hotspotMiniApp_output.nrrd";
82 hotspotCalc->SetInputImage(inputImage);
83 hotspotCalc->SetHotspotRadiusInMM(10);
84 hotspotCalc->SetTimeStep(0);
88 outImage = hotspotCalc->GetMask();
90 catch(
const itk::ExceptionObject& e)
92 MITK_ERROR <<
"Failed - ITK Exception:" << e.what();
96 if (outImage !=
nullptr)
void setContributor(std::string contributor)
ValueType * any_cast(Any *operand)
int main(int argc, char *argv[])
std::map< std::string, us::Any > parseArguments(const StringContainerType &arguments, bool *ok=nullptr)
static bool SaveImage(mitk::Image::Pointer image, const std::string &path)
SaveImage Convenience method to save an arbitrary mitkImage.
void addArgument(const std::string &longarg, const std::string &shortarg, Type type, const std::string &argLabel, const std::string &argHelp=std::string(), const us::Any &defaultValue=us::Any(), bool optional=true, bool ignoreRest=false, bool deprecated=false)
void setCategory(std::string category)
void setArgumentPrefix(const std::string &longPrefix, const std::string &shortPrefix)
void setTitle(std::string title)
void setDescription(std::string description)
static mitk::Image::Pointer LoadImage(const std::string &path)
LoadImage Convenience method to load an arbitrary mitkImage.