<div>I think I ran into the same problem awhile back. I attached an error listener to the DICOM reader, and it generates an error when a non-DICOM file is encountered. When this happens, I would check the error and if it was just a non-DICOM file I would continue processing. Not the best solution, but it worked.</div>

<div>&nbsp;</div>
<div>That was just for the demo projects I wrote, for actual image viewer stuff I used boost or native win32 methods for recursively going through a folder looking for only dcm files myself.</div>
<div>&nbsp;</div>
<div>Mark<br><br></div>
<div class="gmail_quote">On Mon, Apr 14, 2008 at 8:03 AM, &lt;<a href="mailto:polys_poly@hotmail.com">polys_poly@hotmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" name="Compose message area" bgcolor="#ffffff">
<div><font face="Arial" size="2">
<div><font face="Arial" size="2"></font><font face="Arial" size="2">Hello,</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">I want to read some DICOM images from a folder that also contains other files (not DICOM) for example .txt files. I use the following code</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">vtkDICOMImageReader* pRead = vtkDICOMImageReader::New();<br>pRead-&gt;SetDirectoryName(strPath.c_str());<br>pRead-&gt;Update();</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">But when it tries to read&nbsp;a .txt file for example&nbsp;I get error. Is there any way&nbsp;I can modify this code so&nbsp;I can read ONLY the DICOM images contained in the specific folder?</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">Thanks in advance,</font></div>
<div><font face="Arial" size="2">Polys</font></div></font></div></div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br></blockquote></div><br>