22 int main(
int argc,
char* argv[])
38 std::map<std::string, us::Any> parsedArgs = parser.
parseArguments(argc, argv);
40 if (parsedArgs.size()==0)
44 if ( parsedArgs.count(
"help") || parsedArgs.count(
"h"))
50 std::string referenceName =
us::any_cast<std::string>(parsedArgs[
"reference"]);
51 std::string inputName =
us::any_cast<std::string>(parsedArgs[
"input"]);
52 std::string outputName =
us::any_cast<std::string>(parsedArgs[
"output"]);
58 boundingObject->FitGeometry(referenceImage->GetGeometry());
60 cutter->SetBoundingObject(boundingObject);
61 cutter->SetInput(imageToCrop);
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)
int main(int argc, char *argv[])
void setCategory(std::string category)
void setArgumentPrefix(const std::string &longPrefix, const std::string &shortPrefix)
std::string helpText() const
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.