<div dir="ltr"><div>Dear All, </div><div><br></div><div>I used the following code to read DICOM file , but it always enter the catch , am I forget something </div><div><br></div><div><br></div><div>typedef signed short InputPixelType;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>const unsigned int InputDimension = 2;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::Image< InputPixelType, InputDimension > InputImageType;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageFileReader< InputImageType > ReaderType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef InputImageType::SizeType SizeType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ReaderType::Pointer reader = ReaderType::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>reader->SetFileName( "IM35" );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::GDCMImageIO ImageIOType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ImageIOType::Pointer gdcmImageIO = ImageIOType::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader->SetImageIO( gdcmImageIO );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>try</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>reader->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div> }</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>catch (itk::ExceptionObject & e)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr << "exception in file reader " << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr << e << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>// return EXIT_FAILURE;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div> }</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>any suggestion please </div></div>