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

Bill Lorensen bill.lorensen at gmail.com
Fri Oct 26 16:52:14 EDT 2007


Manuel,

Sorry for the delay. I finally added your fix to read 48 bit rgb tiff
images. I reported the bug as:
http://public.kitware.com/Bug/view.php?id=5970

I also added your sample 48 bit image (I downsampled it) and a test.

Thanks for your help,

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/20071026/d494c2d3/attachment.html


More information about the Insight-developers mailing list