2004-11-25 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/ : fix compilation warnings for the Write method (2 different
proto). So Rename 'Write(ifstream* fp' into 'WriteContent(ifstream* fp'
+ fix compilation warnings for the gdcm::Document::TransferSyntaxStrings
+ variable... create a static method in gdcm::Document to access to
+ this variable content.
2004-11-25 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmDocument.[h|cxx] : set the Transfert Syntax values to the header
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/25 15:46:11 $
- Version: $Revision: 1.140 $
+ Date: $Date: 2004/11/25 16:35:16 $
+ Version: $Revision: 1.141 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
+//-----------------------------------------------------------------------------
+static const char *TransferSyntaxStrings[] = {
+ // Implicit VR Little Endian
+ "1.2.840.10008.1.2",
+ // Implicit VR Little Endian DLX G.E?
+ "1.2.840.113619.5.2",
+ // Explicit VR Little Endian
+ "1.2.840.10008.1.2.1",
+ // Deflated Explicit VR Little Endian
+ "1.2.840.10008.1.2.1.99",
+ // Explicit VR Big Endian
+ "1.2.840.10008.1.2.2",
+ // JPEG Baseline (Process 1)
+ "1.2.840.10008.1.2.4.50",
+ // JPEG Extended (Process 2 & 4)
+ "1.2.840.10008.1.2.4.51",
+ // JPEG Extended (Process 3 & 5)
+ "1.2.840.10008.1.2.4.52",
+ // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
+ "1.2.840.10008.1.2.4.53",
+ // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
+ "1.2.840.10008.1.2.4.55",
+ // JPEG Lossless, Non-Hierarchical (Process 14)
+ "1.2.840.10008.1.2.4.57",
+ // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
+ "1.2.840.10008.1.2.4.70",
+ // JPEG 2000 Lossless
+ "1.2.840.10008.1.2.4.90",
+ // JPEG 2000
+ "1.2.840.10008.1.2.4.91",
+ // RLE Lossless
+ "1.2.840.10008.1.2.5",
+ // Unknown
+ "Unknown Transfer Syntax"
+};
+
//-----------------------------------------------------------------------------
// Refer to Document::CheckSwap()
const unsigned int Document::HEADER_LENGTH_TO_READ = 256;
return true;
}
+std::string Document::GetTransferSyntaxValue(TransferSyntaxType type)
+{
+ return TransferSyntaxStrings[type];
+}
+
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/11/25 15:46:11 $
- Version: $Revision: 1.64 $
+ Date: $Date: 2004/11/25 16:35:17 $
+ Version: $Revision: 1.65 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
UnknownTS
};
-static const char *TransferSyntaxStrings[] = {
- // Implicit VR Little Endian
- "1.2.840.10008.1.2",
- // Implicit VR Little Endian DLX G.E?
- "1.2.840.113619.5.2",
- // Explicit VR Little Endian
- "1.2.840.10008.1.2.1",
- // Deflated Explicit VR Little Endian
- "1.2.840.10008.1.2.1.99",
- // Explicit VR Big Endian
- "1.2.840.10008.1.2.2",
- // JPEG Baseline (Process 1)
- "1.2.840.10008.1.2.4.50",
- // JPEG Extended (Process 2 & 4)
- "1.2.840.10008.1.2.4.51",
- // JPEG Extended (Process 3 & 5)
- "1.2.840.10008.1.2.4.52",
- // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
- "1.2.840.10008.1.2.4.53",
- // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
- "1.2.840.10008.1.2.4.55",
- // JPEG Lossless, Non-Hierarchical (Process 14)
- "1.2.840.10008.1.2.4.57",
- // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
- "1.2.840.10008.1.2.4.70",
- // JPEG 2000 Lossless
- "1.2.840.10008.1.2.4.90",
- // JPEG 2000
- "1.2.840.10008.1.2.4.91",
- // RLE Lossless
- "1.2.840.10008.1.2.5",
- // Unknown
- "Unknown Transfer Syntax"
-};
-
//-----------------------------------------------------------------------------
/**
* \brief Derived by both Header and DicomDir
uint16_t UnswapShort(uint16_t); // needed by File
uint32_t UnswapLong(uint32_t); // needed by File
+ static std::string GetTransferSyntaxValue(TransferSyntaxType type);
+
protected:
// Constructor and destructor are protected to forbid end user
// to instanciate from this class Document (only Header and
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/11/25 13:12:02 $
- Version: $Revision: 1.164 $
+ Date: $Date: 2004/11/25 16:35:17 $
+ Version: $Revision: 1.165 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
case ACR_LIBIDO:
SetWriteFileTypeToACRLibido();
break;
+ default:
+ SetWriteFileTypeToExplicitVR();
}
switch(WriteMode)
numberBitsAllocated = 16;
}
- int decSize = HeaderInternal->GetXSize()
+ size_t decSize = HeaderInternal->GetXSize()
* HeaderInternal->GetYSize()
* HeaderInternal->GetZSize()
* ( numberBitsAllocated / 8 )
* HeaderInternal->GetSamplesPerPixel();
- int rgbSize = decSize;
+ size_t rgbSize = decSize;
if( HeaderInternal->HasLUT() )
rgbSize = decSize * 3;
void File::SetWriteFileTypeToExplicitVR()
{
- std::string ts =
- Util::DicomString( TransferSyntaxStrings[ExplicitVRLittleEndian] );
+ std::string ts = Util::DicomString(
+ Document::GetTransferSyntaxValue(ExplicitVRLittleEndian).c_str() );
ValEntry* tss = CopyValEntry(0x0002,0x0010);
tss->SetValue(ts);
void File::SetWriteFileTypeToImplicitVR()
{
- std::string ts =
- Util::DicomString( TransferSyntaxStrings[ImplicitVRLittleEndian] );
+ std::string ts = Util::DicomString(
+ Document::GetTransferSyntaxValue(ImplicitVRLittleEndian).c_str() );
ValEntry* tss = CopyValEntry(0x0002,0x0010);
tss->SetValue(ts);