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

john smith mkitkinsightuser at gmail.com
Tue Feb 15 04:55:36 EST 2011


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

2011/2/15 David Doria <daviddoria at gmail.com>

> On Mon, Feb 14, 2011 at 6:57 PM, john smith <mkitkinsightuser at gmail.com>wrote:
>
>> When I type project input.png output.jpg then I have an exception object
>> caught:
>> It is says:
>>
>> *itk::ImageFileReaderException <00C7EC24>
>> Location: "void_thiscall itk::ImageFileReader<class
>> itk::Image<short,2>,class
>> itk::**DefaultConvertPixelTraits<**short> >::GenerateOutputInformation<**
>> void>"
>> File: c:\.....\itkImageFileReader.**txx
>> Line: 146
>> Discription: Could not create IO object for file inputfile.png
>> The file doen't exist.
>> Filename = inputfile.png*
>>
>> Can you give an advise how to solve this problem?
>>
>
> The file inputfile.png either must be in the same directory as project.exe
> or you must specify the full path to the file:
>
> project.exe c:\yourDirectory\inputfile.png outputfile.jpg
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110215/9282ca62/attachment-0001.htm>


More information about the Insight-users mailing list