[Insight-users] ImageReadWrite and Tif

Luis Ibanez luis.ibanez at kitware.com
Fri, 30 Apr 2004 21:00:54 -0400


Hi Michael,


Yes, the example


   Insight/Examples/IO/
              ImageReadWrite.cxx


is using "unsigned char" as pixel type.
It will  convert color images into grayscale
(not bitonal...) at read time and then save
them again as a agrayscale image.


What you need for managing color images is
a pixel type such as:

    itk::RGBPixel< unsigned char >

or

    itk::RGBAPixel< unsigned char >


The example that you want to use is:



     Insight/Examples/IO/
                 RGBImageReadWrite.cxx



Regards,



    Luis



-------------------------
Michael Hawrylycz wrote:

>  
> Hi Luis,
> 
>   Got my ImageReadWrite example working but when I run a color tif
> input.tif with simply the 
> command ImageReadWrite input.tif output.tif I get a corrupted file that
> crashes my IE browser. 
> If a run ImageReadWrite input.tif output.jpg I get a highly blurred
> convolved unrecognizable image.
> If I run ImageReadWrite input.tif output.png I get an inverted bitonal
> png that is otherwise faithful.
> 
> Is this because ImageReadWrite recognizes only bitonal images?
> 
> Regards,
> 
> Mike
>  
> 
> Mike Hawrylycz, Ph.D.
> Director, Informatics
> Allen Institute of Brain Science
> mikeh at alleninstitute.org
> (206) 548-7011
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
> Sent: Friday, April 30, 2004 2:03 PM
> To: Michael Hawrylycz
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] Build Problems - Windows
> 
> 
> Hi Michael,
> 
> When you said that you HelloWord application cannot find ITKCommon.dll,
> do you mean that you are getting "unresolved erros" at link time ?
> 
> or you mean that you get the application to build, but when you try to
> run it you get a message saying tha ITKCommon.dll has not been found  ?
> 
> If you are in the second case, the reason is simply that DLLs must be
> in your Windows PATH, or they must be in the same directory where your
> application resides.
> 
> If you are using Windows XP, simply go to "Control Panel", select
> "System", take the "Advanced" tab, click on the button "Environment
> Variables" on the bottom, select "PATH" and add the full directory
> where you have your ITK .dlls.
> 
> 
> Please let us know if you continue experiencing any problems,
> 
> 
>    Thanks
> 
> 
> 
>      Luis
> 
> 
> 
> --------------------------
> Michael Hawrylycz wrote:
> 
> 
>>Luis,
>> 
>> I'm starting to wonder if I've got something really corrupted.  I
> 
> have 
> 
>>both debug and release configurations built,  and even my little
> 
> HelloWorld
> 
>>app can't find ITKCommon.dl.   My configuration looks like this:  ITK 
>>binaries are in C:\ITK\ITKBin\bin\release .  The ITKConfig.cmake
>>file is two directories above that in C:\ITK\ITKBin.  My HelloWorld is
> 
> 
>>in C:\ITK\ITKBin\ITKTest.  I already tried it in more logical
>>place but failed there.   When I run Cmake it does show as a requested
> 
> 
>>parameter ITK_DIR which it defaults to C:\ITK\ITKBin.  I tried
>>moving ITKConfig.cmake down one level and redirecting ITK_DIR but I
> 
> get 
> 
>>the same missing ITKCommon dll.  I know this
>>is an unapproved action but I'm just trying to figure it out....
>> 
>>Thanks,
>> 
>>Mike
>> 
>>
>>Mike Hawrylycz, Ph.D.
>>Director, Informatics
>>Allen Institute of Brain Science
>>mikeh at alleninstitute.org
>>(206) 548-7011
>>
>> 
> 
> 
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>