[Insight-users] error on opening image

Luis Ibanez luis.ibanez at kitware.com
Wed Aug 11 09:33:23 EDT 2004


Hi Jian,

The Example

    Insight/Examples/IO/
                ImageReadWrite.cxx

writes your image using 16bits/pixel.

It maybe that your version of XV is not capable
of reading 16bits JPEG images.

You can simply modify the example, by going to
line #87 and replacing

       typedef unsigned short   PixelType;

with

       typedef unsigned char   PixelType;


then recompiling and running the example.


Please let us know if this works for you.


   Thanks



     Luis


---------------------------------------
Jian XIE wrote:
> The file I manipulated is in JPEG format, initially I can use xv to view
> the image. After some process ( I actually use the example code without
> modification, using the ITK ImageFileWriter, the image is just a normal 2
> D JPEG image. the example codes i execute is located at
> Examples/IO/ImageReadWrite.cxx) my xv cant open the output file which is
> alo in JPEG format.
> It says "Unsupport JPEG process: SOF type OXc2"
> I guess maybe it's my xv configuration problem??? since other programs
> like gimp or photoshop can open the output file without any problem.
> 
> Thanks for any help!!
> Jian
> 
> On Wed, 11 Aug 2004, Atwood, Robert C wrote:
> 
> 
>>what format of image file are you saving? If it is png, perhaps you have
>>an xv without png support? That is a patch to the original xv source and
>>the version number will appear as xv3.10a(PNG) It is also possible to
>>compile xv with various other formats turned on or off, if you have
>>obtained a binary it may not be entirely clear to you what is included.
>>The source and the png patch may be found at the official xv page at the
>>web site below and you can compile your own and ensure that it supports
>>as many formats as are available. As Luis said 'Isn't open source great?
>>:-) '
>>
>>
>> http://www.trilon.com/xv/
>>
>> according to the terms, you have to buy a license to actually use xv in
>>your work, a bargain at $25 . There is also another viewer I like called
>>qiv (quick viewer) , which is licensed under gpl
>>
>>http://www.klografx.net/qiv/index2.html
>>
>>
>>If it is not the viewer/format problem then ?? someone else better
>>advise  .. but you should post more information about the images or they
>>won't have enough to go on. like, exactly what error , exactly the name
>>of the file you save, dimensions and datatype of the image , exactly
>>which ITK writer for output and how it is instantiated ?
>>
>>
>>Robert
>>
>>
>>-----Original Message-----
>>From: insight-users-bounces at itk.org
>>[mailto:insight-users-bounces at itk.org] On Behalf Of Jian XIE
>>Sent: 11 August 2004 05:06
>>To: insight-users at itk.org
>>Subject: [Insight-users] error on opening image
>>
>>
>>Dear ITK buddies, I'm just wondering is anyone know why I cant use xv to
>>view the image after the image been processed by my image filter written
>>using ITK. This happen to all the example codes as well. but when using
>>application such as gimp, it's totally alright.
>>
>>thanks all
>>Jian
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org http://www.itk.org/mailman/listinfo/insight-users
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> _______________________________________________
> 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