28 int main(
int argc,
char* argv[] )
32 parser.
setTitle(
"Test basic hotspot functionality");
43 std::cout <<
"test...." << std::endl;
45 std::map<std::string, us::Any> parsedArgs = parser.
parseArguments(argc, argv);
46 std::cout <<
"parsedArgs.size()= " << parsedArgs.size() << std::endl;
47 if (parsedArgs.size()==0 || parsedArgs.count(
"help") || parsedArgs.count(
"h"))
56 std::string inputImageFile;
57 if (!parsedArgs.count(
"i") && !parsedArgs.count(
"input"))
59 inputImageFile =
"/home/fabian/MITK/MITK_platform_project/bin/MITK-superbuild/MITK-Data/Pic3D.nrrd";
63 inputImageFile =
us::any_cast<std::string>(parsedArgs[
"input"]);
66 std::string inputPFFile;
67 if (parsedArgs.count(
"planarfigure") || parsedArgs.count(
"p"))
69 inputPFFile =
us::any_cast<std::string>(parsedArgs[
"planarfigure"]);
73 inputPFFile =
"/home/fabian/MITK/MITK_platform_project/bin/MITK-superbuild/MITK-Data/Pic3D_rectangle.pf";
80 std::vector<mitk::BaseData::Pointer> loadedObjects;
85 if (planarFigure.IsNull())
91 catch (
const itk::ExceptionObject& e)
98 if (parsedArgs.count(
"out") || parsedArgs.count(
"o") )
99 outFile = us::any_cast<std::string>(parsedArgs[
"out"]);
101 outFile =
"planarFigureExtraction_output.nrrd";
108 planarFigMaskExtr->SetPlanarFigure(planarFigure);
109 planarFigMaskExtr->SetInputImage(inputImage);
114 outImage = planarFigMaskExtr->GetMask();
116 catch(
const itk::ExceptionObject& e)
118 MITK_ERROR <<
"Failed - ITK Exception:" << e.what();
123 std::cout <<
"origin: " << imageGeo->
GetOrigin()[0] <<
" " << imageGeo->
GetOrigin()[1] <<
" " << imageGeo->
GetOrigin()[2] << std::endl;
124 if (outImage !=
nullptr)
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
void setContributor(std::string contributor)
ValueType * any_cast(Any *operand)
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)
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage)
Load a file into the given DataStorage.
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.
BaseGeometry Describes the geometry of a data object.