29 int main(
int argc,
char* argv[])
34 parser.
setCategory(
"Fiber Tracking and Processing Methods");
35 parser.
setDescription(
"Load image and save as specified file type.");
42 map<string, us::Any> parsedArgs = parser.
parseArguments(argc, argv);
43 if (parsedArgs.size()==0)
48 string outName =
us::any_cast<
string>(parsedArgs[
"out"]);
54 if ( baseData.size()>0 &&
dynamic_cast<Image*
>(baseData[0].GetPointer()) )
58 else if ( baseData.size()>0 &&
dynamic_cast<FiberBundle*
>(baseData[0].GetPointer()) )
60 mitk::IOUtil::Save(dynamic_cast<FiberBundle*>(baseData[0].GetPointer()) ,outName.c_str());
63 std::cout <<
"File type currently not supported!";
65 catch (itk::ExceptionObject e)
70 catch (std::exception e)
72 std::cout << e.what();
77 std::cout <<
"ERROR!?!";
static void Save(const mitk::BaseData *data, const std::string &path)
Save a mitk::BaseData instance.
void setContributor(std::string contributor)
DataCollection - Class to facilitate loading/accessing structured data.
ValueType * any_cast(Any *operand)
std::map< std::string, us::Any > parseArguments(const StringContainerType &arguments, bool *ok=nullptr)
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)
Image class for storing images.
Base Class for Fiber Bundles;.
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)