[Insight-users] problem in reading and writing an image file

David Doria daviddoria at gmail.com
Tue Feb 15 07:16:38 EST 2011


On Tue, Feb 15, 2011 at 4:55 AM, john smith <mkitkinsightuser at gmail.com>wrote:

> Well,
> I made the changes in the directory file but there are still some problems
> in the command prompt window:
> 1) When I am trying to convert a inputfile.jpg to an outputfile.png, then I
> get the .png file but I cannot see anything as it is a black screen
> 2) When I am trying to convert a inputfile.jpg to an outputfile.jpg, then I
> have again an exception caught, which says that JPEG supports unsigned
> char/int only
>
> Could somebody explain me why I face these two problems? Using an
> itk::CastImageFilter<> or an itk::RescaleIntensityImageFilter<> would
> propably solve this problem?
>
> Thanks in advance
>
>
JPEG indeed only supports unsigned char/int. You could use the
CastImageFilter if you only want to change the type of the pixels, or the
RescaleIntensityImageFilter if you want to stretch the value range while
changing the type.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110215/45f1fd07/attachment.htm>


More information about the Insight-users mailing list