I have designed four classes (Patient, Study, Series, Image) which should hold the information of the related tags.
First I tried to read the private tag values like this:
var tag = DicomTag.Parse("2001,107B");
var value = file.Dataset.Get<string>(tag);
and this:
var tag = DicomTag.Parse("2001,107B");
var item = (from dicomItem in file.Dataset
where dicomItem.Tag.Group == tag.Group && dicomItem.Tag.Element == tag.Element
select dicomItem as DicomElement).SingleOrDefault();
var value = item==null?string.Empty:item.Get<string>();
and this:
var value = file.Dataset.Get<string>(file.Dataset.GetPrivateTag(DicomTag.PatientBirthName));
All of them returned me null / an empty string, but I don't really understand this result. My file isn't null (otherwise --> exception) and that tag can't be empty. Can you eventually explain me the possibilities of this occurence and how to solve it?
Thank you