[Insight-users] ImageReadWrite.exe error

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 14 07:27:46 EDT 2006



Hi Jianglin,

Welcome to ITK !

Please read the ITK Software Guide

       http://www.itk.org/ItkSoftwareGuide.pdf

in particular the chapter:

         "Reading and Writing Images"

It will save you a lot of time.




The error message is telling you that you cannot use BMP
for saving an image whose pixel type is "SHORT" (16-bits).

Please look at the source code of the example that you are
trying to use. In line 95 you will see that the image pixel
type is defined as "short". That's the reason why you get
this error message.




If you change line 95 to be:

    "typedef           unsigned char         PixelType;"


Then you will be able to write to your BMP file.





Please note that BMP is a *VERY BAD* format for medical images.
BMP is ok for screenshots and for storing icons. If you are
seriously processing medical images, you should consider using
one of the many fileformats described in the IO chapter of the
ITK Software Guide.



    Regards,



       Luis



----------------------
ma jianglin wrote:
> Hi everyone,
>     
>     I am a new hand with ITK.  When I compile ITK successuflly, I want 
> to execute ImageReadWrite.exe which is at /Example/IO directory. My 
> platform   is windows, and when I execute the program by typing 
> "ImageReadWrite.exe inBMP.bmp outBMP", an error occurs. It says "bmp 
> files doen't support SHORT type".
>    I don't know what can I do for that. Would someone be kind enough and 
> tell me what to do?
>  
>    Best regards!
>  
>    Jianglin Ma
>  
>    8.13, 2006
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users




More information about the Insight-users mailing list