Mercurial > hg > orthanc
comparison OrthancServer/ParsedDicomFile.cpp @ 1655:e40fd0d925c5
/tools/create-dicom can create tags with unknown VR
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Sep 2015 14:54:24 +0200 |
parents | 4e56b5a206b7 |
children | 09be34b2f30e |
comparison
equal
deleted
inserted
replaced
1654:3727a09e7b53 | 1655:e40fd0d925c5 |
---|---|
862 void ParsedDicomFile::Insert(const DicomTag& tag, | 862 void ParsedDicomFile::Insert(const DicomTag& tag, |
863 const std::string& value) | 863 const std::string& value) |
864 { | 864 { |
865 OFCondition cond; | 865 OFCondition cond; |
866 | 866 |
867 if (FromDcmtkBridge::IsPrivateTag(tag)) | 867 if (FromDcmtkBridge::IsPrivateTag(tag) || |
868 FromDcmtkBridge::IsUnknownTag(tag)) | |
868 { | 869 { |
869 // This is a private tag | 870 // This is a private tag |
870 // http://support.dcmtk.org/redmine/projects/dcmtk/wiki/howto_addprivatedata | 871 // http://support.dcmtk.org/redmine/projects/dcmtk/wiki/howto_addprivatedata |
871 | 872 |
872 DcmTag key(tag.GetGroup(), tag.GetElement(), EVR_OB); | 873 DcmTag key(tag.GetGroup(), tag.GetElement(), EVR_OB); |
913 return; | 914 return; |
914 } | 915 } |
915 } | 916 } |
916 else | 917 else |
917 { | 918 { |
918 if (FromDcmtkBridge::IsPrivateTag(tag)) | 919 if (FromDcmtkBridge::IsPrivateTag(tag) || |
920 FromDcmtkBridge::IsUnknownTag(tag)) | |
919 { | 921 { |
920 if (!element->putUint8Array((const Uint8*) value.c_str(), value.size()).good()) | 922 if (!element->putUint8Array((const Uint8*) value.c_str(), value.size()).good()) |
921 { | 923 { |
922 throw OrthancException(ErrorCode_InternalError); | 924 throw OrthancException(ErrorCode_InternalError); |
923 } | 925 } |
966 { | 968 { |
967 DcmTagKey k(tag.GetGroup(), tag.GetElement()); | 969 DcmTagKey k(tag.GetGroup(), tag.GetElement()); |
968 DcmDataset& dataset = *pimpl_->file_->getDataset(); | 970 DcmDataset& dataset = *pimpl_->file_->getDataset(); |
969 | 971 |
970 if (FromDcmtkBridge::IsPrivateTag(tag) || | 972 if (FromDcmtkBridge::IsPrivateTag(tag) || |
973 FromDcmtkBridge::IsUnknownTag(tag) || | |
971 tag == DICOM_TAG_PIXEL_DATA || | 974 tag == DICOM_TAG_PIXEL_DATA || |
972 tag == DICOM_TAG_ENCAPSULATED_DOCUMENT) | 975 tag == DICOM_TAG_ENCAPSULATED_DOCUMENT) |
973 { | 976 { |
974 const Uint8* data = NULL; // This is freed in the destructor of the dataset | 977 const Uint8* data = NULL; // This is freed in the destructor of the dataset |
975 long unsigned int count = 0; | 978 long unsigned int count = 0; |