From: David Sarrut Date: Thu, 14 Jun 2012 13:36:15 +0000 (+0200) Subject: Add option do display required structures X-Git-Tag: v1.3.0~27^2~6 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3da534185c1e1cbe298995b06f762f96b878cb91;p=clitk.git Add option do display required structures --- diff --git a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx index 6db7c4b..9732057 100644 --- a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx +++ b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx @@ -26,6 +26,7 @@ FilterWithAnatomicalFeatureDatabaseManagement() m_AFDB = NULL; SetAFDBFilename("default.afdb"); SetAFDBPath("./"); + DisplayUsedStructuresOnlyFlagOff(); } //-------------------------------------------------------------------- @@ -63,3 +64,25 @@ clitk::AnatomicalFeatureDatabase::Pointer clitk::FilterWithAnatomicalFeatureData 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 typename 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; +} +//-------------------------------------------------------------------- diff --git a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h index a1f9f29..a44405b 100644 --- a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h +++ b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h @@ -41,24 +41,15 @@ namespace clitk { // Run-time type information (and related methods) itkTypeMacro(FilterWithAnatomicalFeatureDatabaseManagement, Object); - // Set/Get filename - // itkBooleanMacro(AFDBFilenameGivenFlag); - // itkSetMacro(AFDBFilenameGivenFlag, bool); - // itkGetConstMacro(AFDBFilenameGivenFlag, bool); - // GGO_DefineOption_Flag(afdb, SetAFDBFilenameGivenFlag); - - // itkBooleanMacro(AFDBPathGivenFlag); - // itkSetMacro(AFDBPathGivenFlag, bool); - // itkGetConstMacro(AFDBPathGivenFlag, bool); - // GGO_DefineOption_Flag(afdb_path, SetAFDBPathGivenFlag); - itkSetMacro(AFDBFilename, std::string); itkGetConstMacro(AFDBFilename, std::string); - // GGO_DefineOption_WithTest(afdb, SetAFDBFilename, std::string, AFDBFilenameGivenFlag); itkSetMacro(AFDBPath, std::string); itkGetConstMacro(AFDBPath, std::string); - // GGO_DefineOption_WithTest(afdb_path, SetAFDBPath, std::string, AFDBPathGivenFlag); + + itkGetConstMacro(DisplayUsedStructuresOnlyFlag, bool); + itkSetMacro(DisplayUsedStructuresOnlyFlag, bool); + itkBooleanMacro(DisplayUsedStructuresOnlyFlag); void WriteAFDB(); void LoadAFDB(); @@ -71,11 +62,14 @@ namespace clitk { virtual ~FilterWithAnatomicalFeatureDatabaseManagement() {} std::string m_AFDBFilename; - // bool m_AFDBFilenameGivenFlag; std::string m_AFDBPath; - // bool m_AFDBPathGivenFlag; clitk::AnatomicalFeatureDatabase::Pointer m_AFDB; + // For debug: display used structures but do not perform + // segmentation + bool m_DisplayUsedStructuresOnlyFlag; + void AddUsedStructures(std::string station, std::string structure); + private: FilterWithAnatomicalFeatureDatabaseManagement(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented