[Insight-users] reading and writing images - basic example

Luis Ibanez luis . ibanez at kitware . com
Thu, 24 Jul 2003 17:45:50 -0400


Hi Tejas,

If the data in your Dicom files was stored in 16bits/pixel
chances are that the viewer you are using for PNG is not
normalizing the image data at view time. With the default
dinamic range you image may look as blank even if it contains
information.

You may try a viewer like ImageMagick display which has an option
for normalizing intensities, or you could use the ImageViewer
application in InsightApplications/ImageViewer.

JPEG is not supported by ITK at this point.

Please take a look at the FAQ entries
http://www . itk . org/cgi-bin/InsightFAQ/InsightFAQ?req=show&file=faq01 . 007 . htp
http://www . itk . org/cgi-bin/InsightFAQ/InsightFAQ?req=show&file=faq01 . 008 . htp


Regards


    Luis


------------------
tejas mehta wrote:
> Luis,
>  
> I tried doing two things:
>  
> 1) reading ".dcm" and writing to ".png" - works but my new image is blank
>  
> 2) reading ".jpg" and writing to ".jpg" - doesn't work, doesn't even 
> read the file
> The error:
> itk::exceptionobject
> location:"unknown"
> file:c:\......\code\IO\itkanalyseimageIO.cxx
> line: 1002
> description: file cannot be read
>  
>  
> Tejas
> 
> */Luis Ibanez <luis . ibanez at kitware . com>/* wrote:
> 
> 
>     Hi Tejas,
> 
>     ITK ImageIO objects recognize formats
>     by the extension of the filename.
> 
>     Your DICOM file must have extension ".dcm"
>     in order to be recognized by the ITK DICOM
>     reader.
> 
>     Note that, in addition to the filename extension,
>     some further checking is done by the readers in
>     order to verify that the file complies with the
>     expected format.
> 
> 
>     Regards,
> 
> 
>     Luis
> 
> 
>     ------------------------
>     tejas mehta wrote:
>      > Hi,
>      >
>      > I am trying to run c:\Examples\IO\ImageReadWrite.exe and getting an
>      > error. The file I am reading is a dicom file. The error I get is :
>      >
>      > ExceptionObject Caught!
>      > No ImageIO Set or none could be created
>      >
>      >
>      > Please help
>      >
>      > Thanks,
>      > Tejas
>      > ps: Luis I got the application running, thanks!!!!!
>      >
>     ! >
>     ------------------------------------------------------------------------
>      > Do you Yahoo!?
>      > Yahoo! SiteBuilder
>      > - Free,
>      > easy-to-use web site design software
> 
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder 
> <http://us . rd . yahoo . com/evt=10469/*http://sitebuilder . yahoo . com> - Free, 
> easy-to-use web site design software