其他分享
首页 > 其他分享> > Tag being set does not match tag in DicomElement

Tag being set does not match tag in DicomElement

作者:互联网

Tag being set does not match tag in DicomElement

在处理Dicom 文件时,经常需要构建DicomSequenceItem ,此时要保证DicomElementSq的对象和DicomSequenceItem 一致,否则会在运行时发生异常

// 遇到的异常写法
	var wedgesSq = new DicomElementSq(DicomTags.WedgeSequence);
    sequenceItem[DicomTags.RecordedWedgeSequence] = wedgesSq;

使用上述写法时,编译正常,运行时会报错,提示
Tag being set does not match tag in DicomElement

// 修改后的写法
   var wedgesSq = new DicomElementSq(DicomTags.RecordedWedgeSequence);
   sequenceItem[DicomTags.RecordedWedgeSequence] = wedgesSq;

标签:set,DicomTags,Tag,being,tag,DicomElementSq,wedgesSq
来源: https://blog.csdn.net/weixin_44997008/article/details/119173169