I have been developing an application that in one of it's processes uses the dcm2xml.exe utility to extract patient related information from a DICOMDIR file produced by eFilm 2.0. The application runs on the .Net framework, and I've come across a problem that I'm hoping someone here has the answer to.
The application calls the dcm2xml utility from a Process call during the label creation process. The process is supposed to run the dcm2xml utility and pull the resulting xml string back into the application to be parsed.
The problem that I am having is that when this application was a console application that ran on .Net 1.1, it ran fine. The xml would be pulled from the DICOMDIR file and I could parse the patient information that I needed. However, once I began porting the application over to a Windows form on .Net 2.0, the same script would no longer work.
I've posted the script below:
Code: Select all
//create process to run dcm2xml.exe to extract all data in xml format
//set process parameters
Process proc = new Process();
proc.StartInfo.FileName = "dcm2xml.exe";
proc.StartInfo.Arguments = "c:\\DICOMDIR";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
StreamReader sr = proc.StandardOutput;
//load xml data into a xmlDocument object for parsing
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(sr.ReadToEnd());
I would appreciate any advice, as this problem is very perplexing.