30 int main(
int argc,
char* argv[])
52 map<string, us::Any> parsedArgs = parser.
parseArguments(argc, argv);
53 if (parsedArgs.size()==0)
57 int searchRadius( 15 );
58 bool noCenterOfMass(
false );
61 std::string fiberFilename =
us::any_cast<std::string>(parsedArgs[
"fiberImage"]);
62 std::string parcellationFilename =
us::any_cast<std::string>(parsedArgs[
"parcellation"]);
63 std::string outputFilename =
us::any_cast<std::string>(parsedArgs[
"outputNetwork"]);
65 if (parsedArgs.count(
"radius"))
66 searchRadius = us::any_cast<int>(parsedArgs[
"radius"]);
69 if (parsedArgs.count(
"noCenterOfMass"))
70 noCenterOfMass = us::any_cast<bool>(parsedArgs[
"noCenterOfMass"]);
75 const std::string s1=
"", s2=
"";
78 std::vector<mitk::BaseData::Pointer> fiberInfile =
80 if( fiberInfile.empty() )
82 std::string errorMessage =
"Fiber Image at " + fiberFilename +
" could not be read. Aborting.";
90 std::vector<mitk::BaseData::Pointer> parcellationInFile =
92 if( parcellationInFile.empty() )
94 std::string errorMessage =
"Parcellation at " + parcellationFilename +
" could not be read. Aborting.";
105 connectomicsNetworkCreator->SetSegmentation( parcellationImage );
106 connectomicsNetworkCreator->SetFiberBundle( fiberBundle );
107 if( !noCenterOfMass )
109 connectomicsNetworkCreator->CalculateCenterOfMass();
111 connectomicsNetworkCreator->SetEndPointSearchRadius( searchRadius );
112 connectomicsNetworkCreator->CreateNetworkFromFibersAndSegmentation();
117 std::cout <<
"searching writer";
123 catch (itk::ExceptionObject e)
128 catch (std::exception e)
130 std::cout << e.what();
135 std::cout <<
"ERROR!?!";
itk::SmartPointer< Self > Pointer
Base of all data objects.
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 SaveBaseData(mitk::BaseData *data, const std::string &path)
SaveBaseData Convenience method to save arbitrary baseData.
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)
int main(int argc, char *argv[])
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)