comparison OrthancServer/FromDcmtkBridge.cpp @ 308:fbf2b2282086

inplace modification of series and studies
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2012 10:44:26 +0100
parents 326d5a4a5af3
children 26efccdff583
comparison
equal deleted inserted replaced
307:485db3b07740 308:fbf2b2282086
659 output.AnswerBuffer(serialized, "application/octet-stream"); 659 output.AnswerBuffer(serialized, "application/octet-stream");
660 } 660 }
661 } 661 }
662 662
663 663
664
665 bool ParsedDicomFile::GetTagValue(std::string& value,
666 const DicomTag& tag)
667 {
668 DcmTagKey k(tag.GetGroup(), tag.GetElement());
669 DcmDataset& dataset = *file_->getDataset();
670 DcmElement* element = NULL;
671 if (!dataset.findAndGetElement(k, element).good() ||
672 element == NULL)
673 {
674 return false;
675 }
676
677 std::auto_ptr<DicomValue> v(FromDcmtkBridge::ConvertLeafElement(*element));
678
679 if (v.get() == NULL)
680 {
681 value = "";
682 }
683 else
684 {
685 value = v->AsString();
686 }
687
688 return true;
689 }
690
691
664 void FromDcmtkBridge::Convert(DicomMap& target, DcmDataset& dataset) 692 void FromDcmtkBridge::Convert(DicomMap& target, DcmDataset& dataset)
665 { 693 {
666 target.Clear(); 694 target.Clear();
667 for (unsigned long i = 0; i < dataset.card(); i++) 695 for (unsigned long i = 0; i < dataset.card(); i++)
668 { 696 {