Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 22:06:47 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/01/12 15:22:23 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDebug.h"
#include "gdcmHeader.h"
+#include "gdcmGlobal.h"
+#include "gdcmTS.h"
#include "gdcmPixelReadConvert.h"
#include "gdcmDocEntry.h"
#include "gdcmRLEFramesInfo.h"
/**
* \brief Try to deal with RLE 16 Bits.
- * We assume the RLE has allready been parsed and loaded in
+ * We assume the RLE has already been parsed and loaded in
* Raw (through \ref ReadAndDecompressJPEGFile ).
* We here need to make 16 Bits Pixels from Low Byte and
* High Byte 'Planes'...(for what it may mean)
uint16_t *im16 = (uint16_t*)Raw;
switch( SwapCode )
{
- case 0:
- case 12:
case 1234:
break;
- case 21:
case 3412:
case 2143:
case 4321:
uint32_t* im32 = (uint32_t*)Raw;
switch ( SwapCode )
{
- case 0:
case 1234:
break;
case 4321:
{
return false;
}
- //assert( IsJPEGLossless );
+ //gdcmAssertMacro( IsJPEGLossless );
}
else
{
PixelSize = header->GetPixelSize();
PixelSign = header->IsSignedPixelData();
SwapCode = header->GetSwapCode();
- TransferSyntaxType ts = header->GetTransferSyntax();
+ std::string ts = header->GetTransferSyntax();
IsRaw =
( ! header->IsDicomV3() )
- || ts == ImplicitVRLittleEndian
- || ts == ImplicitVRLittleEndianDLXGE
- || ts == ExplicitVRLittleEndian
- || ts == ExplicitVRBigEndian
- || ts == DeflatedExplicitVRLittleEndian;
- IsJPEG2000 = header->IsJPEG2000();
- IsJPEGLossless = header->IsJPEGLossless();
- IsRLELossless = ( ts == RLELossless );
+ || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndian
+ || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndianDLXGE
+ || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRLittleEndian
+ || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRBigEndian
+ || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::DeflatedExplicitVRLittleEndian;
+ IsJPEG2000 = Global::GetTS()->IsJPEG2000(ts);
+ IsJPEGLossless = Global::GetTS()->IsJPEGLossless(ts);
+ IsRLELossless = Global::GetTS()->IsRLELossless(ts);
PixelOffset = header->GetPixelOffset();
PixelDataLength = header->GetPixelAreaLength();
RLEInfo = header->GetRLEInfo();
if ( HasLUT )
{
// Just in case some access to a Header element requires disk access.
- LutRedDescriptor = header->GetEntryByNumber( 0x0028, 0x1101 );
- LutGreenDescriptor = header->GetEntryByNumber( 0x0028, 0x1102 );
- LutBlueDescriptor = header->GetEntryByNumber( 0x0028, 0x1103 );
+ LutRedDescriptor = header->GetEntry( 0x0028, 0x1101 );
+ LutGreenDescriptor = header->GetEntry( 0x0028, 0x1102 );
+ LutBlueDescriptor = header->GetEntry( 0x0028, 0x1103 );
// Depending on the value of Document::MAX_SIZE_LOAD_ELEMENT_VALUE
// [ refer to invocation of Document::SetMaxSizeLoadEntry() in
////// Red round
header->LoadEntryBinArea(0x0028, 0x1201);
- LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 );
+ LutRedData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1201 );
if ( ! LutRedData )
{
gdcmVerboseMacro( "Unable to read red LUT data" );
////// Green round:
header->LoadEntryBinArea(0x0028, 0x1202);
- LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 );
+ LutGreenData = (uint8_t*)header->GetEntryBinArea(0x0028, 0x1202 );
if ( ! LutGreenData)
{
gdcmVerboseMacro( "Unable to read green LUT data" );
////// Blue round:
header->LoadEntryBinArea(0x0028, 0x1203);
- LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 );
+ LutBlueData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1203 );
if ( ! LutBlueData )
{
gdcmVerboseMacro( "Unable to read blue LUT data" );