private static void ReadMedia(string fileName) { var dicomDirectory = DicomDirectory.Open(fileName); foreach (var patientRecord in dicomDirectory.RootDirectoryRecordCollection) { Console.WriteLine( "Patient: {0} ({1})", patientRecord.Get <string>(DicomTag.PatientName), patientRecord.Get <string>(DicomTag.PatientID)); foreach (var studyRecord in patientRecord.LowerLevelDirectoryRecordCollection) { Console.WriteLine("\tStudy: {0}", studyRecord.Get <string>(DicomTag.StudyInstanceUID)); foreach (var seriesRecord in studyRecord.LowerLevelDirectoryRecordCollection) { Console.WriteLine("\t\tSeries: {0}", seriesRecord.Get <string>(DicomTag.SeriesInstanceUID)); foreach (var imageRecord in seriesRecord.LowerLevelDirectoryRecordCollection) { Console.WriteLine( "\t\t\tImage: {0} [{1}]", imageRecord.Get <string>(DicomTag.ReferencedSOPInstanceUIDInFile), imageRecord.Get <string>(Dicom.DicomTag.ReferencedFileID)); } } } } }
public void Open_DicomDirFile_Succeeds() { var dir = DicomDirectory.Open(@".\Test Data\DICOMDIR"); var expected = DicomUID.MediaStorageDirectoryStorage.UID; var actual = dir.FileMetaInfo.MediaStorageSOPClassUID.UID; }
public void Open_MediaStorageSOPInstanceUID_ShouldBeConsistent() { var dir = DicomDirectory.Open(@".\Test Data\DICOMDIR"); var expected = dir.FileMetaInfo.Get <DicomUID>(DicomTag.MediaStorageSOPInstanceUID).UID; var actual = dir.MediaStorageSOPInstanceUID.UID; Assert.Equal(expected, actual); }
public void Open_DicomDirStream_Succeeds() { using (var stream = File.OpenRead(@".\Test Data\DICOMDIR")) { DicomDirectory dir = DicomDirectory.Open(stream); var expected = DicomUID.MediaStorageDirectoryStorage.UID; var actual = dir.FileMetaInfo.MediaStorageSOPClassUID.UID; } }