[Insight-developers] Problem in Tiff RGB 48bit load

Bill Lorensen bill.lorensen at gmail.com
Tue May 8 14:57:52 EDT 2007


Manuel,

Thanks for the diagnosis and fix. Would you have a sample image that we can
use to test your fix and retain as a regression test? A small image is
preferable.

Bill


On 5/8/07, manuel mazzetto <mazzetto at tesi.mi.it> wrote:
>
>  hi,
>
> we have found a problem in 48 bit tiff image loading
> we have used this workaround in TIFFImageIO::EvaluateImageAt( void* out,
> void* in )
>
> ...
> *    case TIFFImageIO::RGB_:
>       if(m_ComponentType == USHORT)
>         {
>         unsigned short *image_us = (unsigned short*)out;
>         unsigned short *source_us = (unsigned short*)in;
>
>         red   = *(source_us);
>         green = *(source_us+1);
>         blue  = *(source_us+2);
>         *(image_us)   = red;
>         *(image_us+1) = green;
>         *(image_us+2) = blue;
>         if ( m_InternalImage->SamplesPerPixel == 4 )
>             {
>             alpha = *(source_us+3);
>             *(image_us+3) = 65535-alpha;
>             }
>         }
>       else
>         {
>         red   = *(source);
>         green = *(source+1);
>         blue  = *(source+2);
>         *(image)   = red;
>         *(image+1) = green;
>         *(image+2) = blue;
>         if ( m_InternalImage->SamplesPerPixel == 4 )
>             {
>             alpha = *(source+3);
>             *(image+3) = 255-alpha;
>             }
>         }
>       increment = m_InternalImage->SamplesPerPixel;
>       break;
> *...*
> *
> best regards,
> Mazzetto Manuel, Rizzi Davide
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070508/24df9e9f/attachment.html


More information about the Insight-developers mailing list