X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkAnatomicalFeatureDatabase.h;h=c1ed4fd17ea1c4407ac272e71619dcd28fee293c;hb=d7f456d86ca398a89ccf9de43ab68a2b50b8ca1f;hp=e2850e12259314053b1f49ac934df16dfd3cf80f;hpb=3c1886a2789de650bebcbcbc60e454b248f83e38;p=clitk.git diff --git a/segmentation/clitkAnatomicalFeatureDatabase.h b/segmentation/clitkAnatomicalFeatureDatabase.h index e2850e1..c1ed4fd 100644 --- a/segmentation/clitkAnatomicalFeatureDatabase.h +++ b/segmentation/clitkAnatomicalFeatureDatabase.h @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ #ifndef CLITKANATOMICALFEATUREDATABASE_H #define CLITKANATOMICALFEATUREDATABASE_H @@ -34,10 +34,17 @@ namespace clitk { class AnatomicalFeatureDatabase: public itk::Object { public: - AnatomicalFeatureDatabase(); - + // typedef typedef std::string TagType; + // New macro + typedef itk::Object Superclass; + typedef AnatomicalFeatureDatabase Self; + typedef itk::SmartPointer Pointer; + typedef itk::SmartPointer ConstPointer; + itkNewMacro(Self); + static Pointer New(std::string filename); + // Set/Get filename itkSetMacro(Filename, std::string); itkGetConstMacro(Filename, std::string); @@ -45,40 +52,57 @@ namespace clitk { // Read and write DB void Write(); void Load(); + itkGetConstMacro(Path, std::string); + itkSetMacro(Path, std::string); // Set Get landmarks typedef itk::Point PointType3D; void SetPoint3D(TagType tag, PointType3D & p); void GetPoint3D(TagType tag, PointType3D & p); double GetPoint3D(std::string tag, int dim); - + bool TagExist(std::string tag); + std::string GetTagValue(std::string tag); + // Set Get image void SetImageFilename(TagType tag, std::string f); - template - typename ImageType::Pointer GetImage(TagType tag); - template - void SetImage(TagType tag, - std::string f, - typename ImageType::Pointer image, - bool write=false); - template + + template + typename ImageType::Pointer GetImage(TagType tag, bool reload=false); + + template + bool CheckImage(TagType tag); + + template + void SetImage(TagType tag, std::string f, typename ImageType::Pointer image, bool write=false); + + template void ReleaseImage(TagType tag); // Set Get Double void SetDouble(TagType tag, double d); double GetDouble(TagType tag); + + // Remove Tag + void RemoveTag(TagType tag); protected: + AnatomicalFeatureDatabase(); + ~AnatomicalFeatureDatabase() {} + std::string m_Filename; + std::string m_Path; typedef itk::ImageBase<3> ImageBaseType; typedef std::map MapTagType; - typedef std::map MapTagImageType; + typedef std::map MapTagImageType; MapTagType m_MapOfTag; MapTagImageType m_MapOfImage; }; // end class //-------------------------------------------------------------------- +#define NewAFDB(NAME, FILE) \ + clitk::AnatomicalFeatureDatabase::Pointer NAME = clitk::AnatomicalFeatureDatabase::New(FILE); + #include "clitkAnatomicalFeatureDatabase.txx" } // end namespace clitk