X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=src%2FgdcmPixelReadConvert.cxx;h=e700fba1754c341b143f85b352fad165e5241650;hb=3f237ae109aef22eb58b91efe64af240e0c0d63b;hp=ef92293b33be090903346944856c377b5827f147;hpb=f260df3a26d9a620ebd348d79b2f9eb116ed985a;p=gdcm.git diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index ef92293b..e700fba1 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.cxx,v $ Language: C++ - Date: $Date: 2005/10/20 07:38:08 $ - Version: $Revision: 1.81 $ + Date: $Date: 2005/10/23 17:51:43 $ + Version: $Revision: 1.86 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -124,7 +124,7 @@ void PixelReadConvert::GrabInformationsFromFile( File *file ) || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::DeflatedExplicitVRLittleEndian; IsPrivateGETransferSyntax = - ( Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRBigEndianPrivateGE ); + ( Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRBigEndianPrivateGE ); IsMPEG = Global::GetTS()->IsMPEG(ts); IsJPEG2000 = Global::GetTS()->IsJPEG2000(ts); @@ -177,7 +177,7 @@ void PixelReadConvert::GrabInformationsFromFile( File *file ) LutRedData = (uint8_t*)file->GetEntryBinArea( 0x0028, 0x1201 ); if ( ! LutRedData ) { - gdcmWarningMacro( "Unable to read Red Palette Color Lookup Table data" ); + gdcmWarningMacro("Unable to read Red Palette Color Lookup Table data"); } // //// Green round: @@ -185,7 +185,7 @@ void PixelReadConvert::GrabInformationsFromFile( File *file ) LutGreenData = (uint8_t*)file->GetEntryBinArea(0x0028, 0x1202 ); if ( ! LutGreenData) { - gdcmWarningMacro( "Unable to read Green Palette Color Lookup Table data" ); + gdcmWarningMacro("Unable to read Green Palette Color Lookup Table data"); } // //// Blue round: @@ -193,7 +193,7 @@ void PixelReadConvert::GrabInformationsFromFile( File *file ) LutBlueData = (uint8_t*)file->GetEntryBinArea( 0x0028, 0x1203 ); if ( ! LutBlueData ) { - gdcmWarningMacro( "Unable to read Blue Palette Color Lookup Table data" ); + gdcmWarningMacro("Unable to read Blue Palette Color Lookup Table data"); } } FileInternal = file; @@ -241,7 +241,7 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) if ( PixelDataLength != RawSize ) { gdcmWarningMacro( "Mismatch between PixelReadConvert : " - << PixelDataLength << " and RawSize : " << RawSize ); + << PixelDataLength << " and RawSize : " << RawSize ); } if ( PixelDataLength > RawSize ) { @@ -260,7 +260,8 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) } else if ( IsRLELossless ) { - if ( ! RLEInfo->DecompressRLEFile( fp, Raw, XSize, YSize, ZSize, BitsAllocated ) ) + if ( ! RLEInfo->DecompressRLEFile + ( fp, Raw, XSize, YSize, ZSize, BitsAllocated ) ) { gdcmWarningMacro( "RLE decompressor failed." ); return false; @@ -525,17 +526,19 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp ) } /** - * \brief Build Red/Green/Blue/Alpha LUT from File - * when (0028,0004),Photometric Interpretation = [PALETTE COLOR ] - * and (0028,1101),(0028,1102),(0028,1102) - * - xxx Palette Color Lookup Table Descriptor - are found - * and (0028,1201),(0028,1202),(0028,1202) - * - xxx Palette Color Lookup Table Data - are found + * \brief Build Red/Green/Blue/Alpha LUT from File when : + * - (0028,0004) : Photometric Interpretation == [PALETTE COLOR ] + * and + * - (0028,1101),(0028,1102),(0028,1102) + * xxx Palette Color Lookup Table Descriptor are found + * and + * - (0028,1201),(0028,1202),(0028,1202) + * xxx Palette Color Lookup Table Data - are found * \warning does NOT deal with : - * 0028 1100 Gray Lookup Table Descriptor (Retired) - * 0028 1221 Segmented Red Palette Color Lookup Table Data - * 0028 1222 Segmented Green Palette Color Lookup Table Data - * 0028 1223 Segmented Blue Palette Color Lookup Table Data + * - 0028 1100 Gray Lookup Table Descriptor (Retired) + * - 0028 1221 Segmented Red Palette Color Lookup Table Data + * - 0028 1222 Segmented Green Palette Color Lookup Table Data + * - 0028 1223 Segmented Blue Palette Color Lookup Table Data * no known Dicom reader deals with them :-( * @return a RGBA Lookup Table */ @@ -771,7 +774,7 @@ void PixelReadConvert::ConvertSwapZone() // then the header is in little endian format and the pixel data is in // big endian format. When reading the header, GDCM has already established // a byte swapping code suitable for this machine to read the - // header. In TS::ImplicitVRLittleEndianDLXGE, this code will need + // header. In TS::ImplicitVRBigEndianPrivateGE, this code will need // to be switched in order to read the pixel data. This must be // done REGARDLESS of the processor endianess! // @@ -793,7 +796,9 @@ void PixelReadConvert::ConvertSwapZone() // Therefore, in either case, if the file is in // 'ImplicitVR BigEndian PrivateGE Transfer Syntax', then GDCM needs to switch // the byte swapping code when entering the pixel data. - + +/* //Let me check something. + //I wait for the Dashboard ! if ( IsPrivateGETransferSyntax ) { // PrivateGETransferSyntax only exists for 'true' Dicom images @@ -808,6 +813,7 @@ void PixelReadConvert::ConvertSwapZone() break; } } +*/ if ( BitsAllocated == 16 ) { uint16_t *im16 = (uint16_t*)Raw;