<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="background-color:transparent">On Fri, Aug 31, 2012 at 5:29 AM, Raviteja, Allaparthi </span><span dir="ltr" style="background-color:transparent">&lt;<a href="mailto:Allaparthi.Raviteja@philips.com" target="_blank">Allaparthi.Raviteja@philips.com</a>&gt;</span><span style="background-color:transparent"> wrote:</span></p>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am trying to run the code for connected component  and I have a problem in reading the   “.mhd  “ file. The code and the error are as follows.</p></div></div></blockquote><div><br></div><div>You should be able to produce the same error with:</div>
<div><br></div><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">#include &quot;itkImageFileReader.h&quot;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
<br></p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">int main(int argc, char* argv[] )</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
{</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">                typedef   unsigned char  InternalPixelType;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
                const     unsigned int    Dimension = 2;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">    typedef itk::Image&lt; InternalPixelType, Dimension &gt;  InternalImageType;</p>
<p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">  typedef itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
 </p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">  ReaderType::Pointer reader = ReaderType::New();</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
   char *inputfile=&quot;d:\\EnhancedOutputImage2.mhd&quot;;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">  reader-&gt;SetFileName(inputfile);</p>
<p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">  reader-&gt;Update();</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
  return EXIT_SUCCESS;</p><p class="MsoNormal" style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"> </p><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">}</span> </div>
<div><br></div><div>correct? If so, it sounds like a problem with your file. You could try opening it with ParaView to see if that works?</div><div><br></div><div>David</div></div>