X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=3d3ffb1df97c5e17788e582b7f6c63db459e7f31;hb=c15dd7f9013f1c5bb6b4f5cac3cd1c92f57333f1;hp=3d6a0e3dd9a00b9e3be04944de361651bc5c1a96;hpb=b22b0ce7e3e8746029ab1203274914c20e749484;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index 3d6a0e3..3d3ffb1 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -1,8 +1,17 @@ #include #include + +#if defined(USE_GDCM) #include #include +#endif + +#if defined(USE_GDCM2) +#include +#include +#include +#endif #include @@ -65,6 +74,7 @@ namespace creaImageIO GimmickDebugMessage(3,"AttributeDescriptor : '"<GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); if( entry != 0) { @@ -127,6 +164,21 @@ namespace creaImageIO btest = true; } } +#endif +#if defined(USE_GDCM2) + const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge ! + const gdcm::Dicts &dicts = g.GetDicts(); + const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6 + + if(mGroup != 0 && mElement != 0) + { + gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(GetGroup(), GetElement())); + if( gdcm::VR::GetVRString(dictentry.GetVR()) == "DA") + { + btest = true; + } + } +#endif return btest; } @@ -136,6 +188,7 @@ namespace creaImageIO { bool btest = false; +#if defined(USE_GDCM) // Retrieve the name from gdcm dict GDCM_NAME_SPACE::DictEntry* entry = GDCM_NAME_SPACE::Global::GetDicts()->GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); if( entry != 0) @@ -145,6 +198,22 @@ namespace creaImageIO btest = true; } } +#endif + +#if defined(USE_GDCM2) + const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge ! + const gdcm::Dicts &dicts = g.GetDicts(); + const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6 + if(mGroup != 0 && mElement != 0) + { + gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(mGroup, mElement)); + if(gdcm::VR::GetVRString(dictentry.GetVR()) == "TM") + { + btest = true; + } + } +#endif + return btest; } @@ -153,8 +222,8 @@ namespace creaImageIO /// Decodes the type of the attribute void AttributeDescriptor::DecodeType(unsigned int& typ) const { - - + std::string type=""; +#if defined(USE_GDCM) // Retrieve the name from gdcm dict GDCM_NAME_SPACE::DictEntry* entry = GDCM_NAME_SPACE::Global::GetDicts() @@ -165,7 +234,16 @@ namespace creaImageIO typ = 2; return; } - std::string type = entry->GetVR().str(); + type = entry->GetVR().str(); +#endif +#if defined(USE_GDCM2) + const gdcm::Global& g = gdcm::Global::GetInstance(); // sum of all knowledge ! + const gdcm::Dicts &dicts = g.GetDicts(); + const gdcm::Dict &dict = dicts.GetPublicDict(); // Part 6 + gdcm::DictEntry dictentry = dict.GetDictEntry(gdcm::Tag(mGroup, mElement)); + type = gdcm::VR::GetVRString(dictentry.GetVR()); +#endif + GimmickDebugMessage(3,"VR Value is "<