Dear All,<br><br>I have a stacked TIFF image that I am trying to load, and whenever I load it, I get the most ungodly runtime error.  It is not an ordinary TIFF, it&#39;s proprietary, and has all kinds of custom tags.   The most interesting part is that if I open said TIFF in ImageJ, and then save as a .tif, I can load it in ITK beautifully.  I can also manipulate it with LibTIFF tools in linux, so the format is clearly tif, and is clearly readable.  <div>

<br></div><div>The relevant code:</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

       typedef itk::Image&lt; unsigned char,  3 &gt;    InputImageType;</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

       typedef itk::ImageFileReader&lt; InputImageType &gt; ReaderType;</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

       ReaderType::Pointer reader = ReaderType::New();</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

       reader-&gt;SetFileName( filename_rep.toLocal8Bit().data() );</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

      <b> reader-&gt;Update(); //Runtime Error</b></blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

       this-&gt;itkStackedImage = reader-&gt;GetOutput();</blockquote><div><br></div><div>I also get this application output:</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

TIFFReadDirectory: Warning, file.tif: unknown field with tag 65092 (0xfe44) encountered.</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

terminate called after throwing an instance of &#39;std::bad_alloc&#39;</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

  what():  std::bad_alloc</blockquote></div><div><br></div><div>Could it be the tags?  Surely ITK would just ignore them, they are merely warnings.</div><div><br></div><div>To summarize, I get a runtime error when loading the original image.  When I simply open the image in ImageJ, and then save as a .tif, the above code works beautifully.</div>

</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><br></div><div>The platform is Windows XP, and I am using using ITK3.20.  I am also using Qt, so the compiler is mingw32.</div>

<div><br></div><div>Thank you,</div><div>George</div></span></div>