David,<br><br>Hans Johnson has just made some changes to nifti utilities and itk classes. It turns out that since NIFTI appears before Analyze in the IO factory, you are probably using the NIFTI ImageIO class (whether you want to or not). I suggest that you update Utilities/nifti, Code/IO and testing/Code/IO. Then try your original code again.<br>
<br>I looked at the Analyze code and Analyze header and it seems that Analyze does not support anything other than unsiged char for RGB pixels. Hans can confirm this since he is the itk Analyze/Nifti expert.<br><br>Hans, in the long term will it be possible to process all analyze files with the nifti ImageIO class? Or at least remove most of the current AnalyzeImageIO code, perhaps by subclassing AnalyzeImageIO from itkNiftiImageIO?<br>
<br>Bill<br><br><div class="gmail_quote">On Mon, Feb 4, 2008 at 9:22 AM, David Lambiel &lt;<a href="mailto:dlambielitk@gmail.com">dlambielitk@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the response. Bug reported.<br>David<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Feb 4, 2008 2:56 PM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>David,</div>
<div>&nbsp;</div>
<div>This certainly looks like a bug. I just checked the code for itkAnalyzeImageIO.cxx. In ReadImageInformation there is a switch statement on the data type and the code does nothing for RGB data. I&#39;m not sure why it wrote an image, it should throw an exception.</div>



<div>&nbsp;</div>
<div>Can you submit a bug report? <a href="http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes" target="_blank">http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes</a></div>
<div>Also, if you have a small RGB image pleased attach it to the bug report.</div>
<div>&nbsp;</div>
<div>Thanks,</div>
<div>&nbsp;</div>
<div>Bill</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote"><div><div></div><div>On Mon, Feb 4, 2008 at 5:37 AM, David Lambiel &lt;<a href="mailto:dlambielitk@gmail.com" target="_blank">dlambielitk@gmail.com</a>&gt; wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"><div><div></div><div>Hello<br>When reading an Analyze file (hdr+img) that I just wrote a few second before, I jump into a &quot;segmentation fault&quot;.<br>


My image is an RGB image with an unsigned short pixel type.<br>ITK documentation tells me that an Analyze image file : <br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">containing usually uncompressed voxel data for the images in one of the several possible voxel formats: 
<ul>
<li>24 bit RGB, 8 bits per channel</li></ul></blockquote>Ok, so I imagine that my RGB-16bits-pixel will not be accepted for the Analyze format.<br>Question is, why does it write the RGB-16bits-pixel without problem or warning, but cannot read it ?<br>


I think it would be more logical to be able to read/write or nothing.<br>Or perhaps I&#39;missing something...<br><br>For info, I&#39;ve no problem with the same data using a raw image file (mdh+raw).<br>I could forward some code if necessary...<br>


<br>Thanks<br>David Lambiel<br clear="all"><br>-----------------------------------------------------------------<br>Swiss Federal Institute of Technology Lausanne (EPFL)<br>Signal Processing Laboratory 5<br>Station 11<br>


ELD 225 (Bātiment ELD)<br>1015 Lausanne<br>Switzerland <br></div></div>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br>

<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br><div class="Ih2E3d">---------------------------------------------------------------<br>Swiss Federal Institute of Technology Lausanne (EPFL)<br></div>Signal Processing Institute (ITS)<div>
<div></div><div class="Wj3C7c"><br>Signal Processing Laboratory 5<br>
Station 11<br>ELD 225 (Bātiment ELD)<br>1015 Lausanne<br>Switzerland
</div></div></blockquote></div><br>