X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkFilterWithAnatomicalFeatureDatabaseManagement.cxx;h=4d96ba3a7e3cbcd2ba19167715105a184f98137a;hb=HEAD;hp=6e3e5946c7228f0f3b5be1fc73c43d5e47aa6893;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx index 6e3e594..4d96ba3 100644 --- a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx +++ b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx @@ -25,6 +25,8 @@ FilterWithAnatomicalFeatureDatabaseManagement() { m_AFDB = NULL; SetAFDBFilename("default.afdb"); + SetAFDBPath("./"); + DisplayUsedStructuresOnlyFlagOff(); } //-------------------------------------------------------------------- @@ -42,10 +44,11 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB() void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() { GetAFDB()->SetFilename(GetAFDBFilename()); + GetAFDB()->SetPath(GetAFDBPath()); try { GetAFDB()->Load(); } catch (clitk::ExceptionObject e) { - std::cout << "Could not read '" << GetAFDBFilename() << "', create one AFDB." << std::endl; + std::cout << "******* Could not read '" << GetAFDBFilename() << "', create one AFDB. ********" << std::endl; GetAFDB(); } } @@ -53,11 +56,33 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() //-------------------------------------------------------------------- -clitk::AnatomicalFeatureDatabase * clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB() +clitk::AnatomicalFeatureDatabase::Pointer clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB() { - if (m_AFDB == NULL) { - m_AFDB = new clitk::AnatomicalFeatureDatabase; + if (!m_AFDB) { + m_AFDB = clitk::AnatomicalFeatureDatabase::New(); } return m_AFDB; } //-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +void clitk::FilterWithAnatomicalFeatureDatabaseManagement:: +AddUsedStructures(std::string station, std::string structure) +{ + if (!GetDisplayUsedStructuresOnlyFlag()) return; + std::cout << station << "\t" << structure; + bool founded = true; + bool tag = GetAFDB()->TagExist(structure); + if (tag) { + typedef itk::Image ImageType; + founded = GetAFDB()->CheckImage(structure); + if (!founded) { + std::cout << " \t Image not exist in DB "; + std::cout << "<" << GetAFDB()->GetTagValue(structure) << "> "; + } + } + if (!tag) std::cout << " \t Tag not found in DB"; + std::cout << std::endl; +} +//--------------------------------------------------------------------