I am new to CC as well as DICOM world, am trying out to read the patient name and study details in the DICOMDIR file and save it in database, here is my code, am doing it in console application in C#
enter code here
{
DicomDirectory reader = new DicomDirectory("DICOMDIR");
reader.Load(@"D:\Sunil\Dataset\Metapex\pix\DICOMDIR");
DirectoryRecordSequenceItem record = reader.RootDirectoryRecord;
while (record != null)
{
String PatientId = record[DicomTags.PatientId];
String PatientName = record[DicomTags.PatientsName];
Console.WriteLine("Id - {0}\n Name - {1}", PatientId, PatientName);
record = record.NextDirectoryRecord;
}
Console.ReadLine();}
when i execute it there is no error, but DirectoryRecordSequenceItem "record" value is returning null in line 3, hence it is not entering the loop.
can anyone help why it is returning null value, am not able to find out even i put breakpoint n debug it.
thanks in advance
SUNIL