From: jpr Date: Tue, 11 Jan 2005 11:37:12 +0000 (+0000) Subject: 2005-01-11 Jean-Pierre Roux X-Git-Tag: Version1.0.bp~397 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0998e973a71f551af2f24ae49c9b748359a61be8;p=gdcm.git 2005-01-11 Jean-Pierre Roux * Replace confusing name SwitchSwapToBigEndian name by SwitchByteSwapCode * Add the Document::HandleOutOfGroup0002(uint16_t group) method to swap the Swap Code, at parsing time, when we come out of group 0002 and Transfer Syntax is Big Endian We should be able to read now 'true DICOM' Big Endian coded images * Add optional run time SetDebugOn (last param) for PrintHeader, PrintFile * Replace the french 'Transfert Syntax' by the english 'Transfer Syntax' --- diff --git a/ChangeLog b/ChangeLog index c92d2b5a..5b240ed0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,23 @@ +2005-01-11 Jean-Pierre Roux + * Replace confusing name SwitchSwapToBigEndian name by SwitchByteSwapCode + * Add the Document::HandleOutOfGroup0002(uint16_t group) method + to swap the Swap Code, at parsing time, when we come out of group 0002 + and Transfer Syntax is Big Endian + We should be able to read now 'true DICOM" Big Endian coded images + * Add optional run time SetDebugOn (last param) for PrintHeader, PrintFile + * Replace the french 'Transfert Syntax' by the english 'Transfer Syntax' + 2005-01-10 Mathieu Malaterre * Hopefully fix the bug on MacOSX and static global initialization. This is the only -minor- patch I found that both please MacOSX and VS6. Other patch would be to declare a const std::string & GDCM_UNFOUND() instead, - but this would require a lot of change. Another approach wqould be that Global + but this would require a lot of change. Another approach would be that Global create those string and GDCM_UNFOUND becomes a pointer to a string (which gdcm::Global would destroy at exit). 2005-01-08 Mathieu Malaterre - * Fix bug on MacOSX with static initialization in a multui threaded - environement. static const string in a header file used to be ill + * Fix bug on MacOSX with static initialization in a multy threaded + environment. static const string in a header file used to be ill initialized provoquing the freeze of any tests. patch should solve this issue. @@ -617,7 +626,7 @@ images, without the need of the Cornwell lib, but we do read them properly now * To reduce code (well to avoid code duplication), I defined a common place for jpeg read/write: gdcmJpeg.cxx. Now gdcmJpeg[8,12 16] include this file and - redefine symbols. This is not prefect but this the best solution I found for a + redefine symbols. This is not perfect but this the best solution I found for a compilation time jpeg option. 2004-10-13 Mathieu Malaterre diff --git a/Dicts/dicomTS.dic b/Dicts/dicomTS.dic index 3f94b067..eeba7029 100644 --- a/Dicts/dicomTS.dic +++ b/Dicts/dicomTS.dic @@ -26,6 +26,7 @@ 1.2.840.10008.1.2.4.91 JPEG 2000 Image Compression 1.2.840.10008.1.2.4.100 MPEG2 Main Profile @ Main Level 1.2.840.10008.1.2.5 RLE Lossless +1.2.840.113619.5.2 Implicit VR - Big Endian (G.E Private) 1.2.840.10008.1.3.10 Media Storage Directory Storage 1.2.840.10008.1.4.1.1 Talairach Brain Atlas Frame of Reference diff --git a/Example/PrintDicomDir.cxx b/Example/PrintDicomDir.cxx index b8c948df..58000a16 100644 --- a/Example/PrintDicomDir.cxx +++ b/Example/PrintDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/11 11:37:12 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,6 +23,7 @@ #include "gdcmDicomDirSerie.h" #include "gdcmDicomDirImage.h" #include "gdcmTS.h" +#include "gdcmDebug.h" #include #include @@ -45,6 +46,9 @@ int main(int argc, char* argv[]) file += "/DICOMDIR"; } + if (argc > 3) + gdcm::Debug::SetDebugOn(); + e1 = new gdcm::DicomDir( file ); if (argc > 2) { diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index f36257e6..45bc35f3 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,6 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" +#include "gdcmDebug.h" #include "gdcmFile.h" #include @@ -39,12 +40,18 @@ int main(int argc, char* argv[]) fileName += GDCM_DATA_ROOT; fileName += "/test.acr"; } + + if (argc > 3) + gdcm::Debug::SetDebugOn(); e1= new gdcm::Header( fileName.c_str() ); f1 = new gdcm::File(e1); - f1->SetPrintLevel(2); - f1->Print(); + if (argc > 2) + { + int level = atoi(argv[2]); + e1->SetPrintLevel(level); + } std::cout << "\n\n" << std::endl; @@ -79,13 +86,13 @@ int main(int argc, char* argv[]) if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) { - std::cout << "Transfert Syntax not loaded. " << std::endl + std::cout << "Transfer Syntax not loaded. " << std::endl << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" << std::endl; return 0; } - std::string transferSyntaxName = e1->GetTransfertSyntaxName(); + std::string transferSyntaxName = e1->GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; if(e1->IsReadable()) diff --git a/Example/PrintHeader.cxx b/Example/PrintHeader.cxx index 74305de6..8392540a 100644 --- a/Example/PrintHeader.cxx +++ b/Example/PrintHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,6 +16,8 @@ =========================================================================*/ #include "gdcmHeader.h" +#include "gdcmDebug.h" + #include int main(int argc, char* argv[]) @@ -24,7 +26,7 @@ int main(int argc, char* argv[]) if (argc == 1) { - std::cout << argv[0] << " fileName" << std::endl; + std::cout << argv[0] << " fileName printLevel" << std::endl; } if (argc > 1) @@ -37,6 +39,9 @@ int main(int argc, char* argv[]) fileName += "/test.acr"; } + if (argc > 3) + gdcm::Debug::SetDebugOn(); + gdcm::Header *e1 = new gdcm::Header( fileName.c_str() ); if (argc > 2) @@ -51,13 +56,13 @@ int main(int argc, char* argv[]) if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) { - std::cout << "Transfert Syntax not loaded. " << std::endl + std::cout << "Transfer Syntax not loaded. " << std::endl << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" << std::endl; return 0; } - std::string transferSyntaxName = e1->GetTransfertSyntaxName(); + std::string transferSyntaxName = e1->GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; if(e1->IsReadable()) diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index 38c25b71..9243880c 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <GetTransfertSyntaxName(); + transferSyntaxName = e1->GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; /* if ( transferSyntaxName != "Implicit VR - Little Endian" diff --git a/Example/Write.cxx b/Example/Write.cxx index 3756a2c2..0d1d32bc 100644 --- a/Example/Write.cxx +++ b/Example/Write.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Write.cxx,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:57 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -94,7 +94,7 @@ int main(int argc, char* argv[]) int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <GetTransfertSyntaxName(); + transferSyntaxName = e1->GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; /* if ( transferSyntaxName != "Implicit VR - Little Endian" diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 8937fa3e..2bb417ca 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 00:21:48 $ - Version: $Revision: 1.172 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.173 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -106,8 +106,10 @@ Document::Document( std::string const &filename ) : ElementSet(-1) return; } + Group0002Parsed = false; + gdcmVerboseMacro( "Starting parsing of file: " << Filename.c_str()); - Fp->seekg( 0, std::ios::beg); + // Fp->seekg( 0, std::ios::beg); Fp->seekg(0, std::ios::end); long lgt = Fp->tellg(); @@ -195,6 +197,7 @@ Document::Document() : ElementSet(-1) Initialise(); SwapCode = 0; Filetype = ExplicitVR; + Group0002Parsed = false; } /** @@ -391,7 +394,7 @@ bool Document::IsEncapsulate() */ bool Document::IsDicomV3() { - // Checking if Transfert Syntax exists is enough + // Checking if Transfer Syntax exists is enough // Anyway, it's to late check if the 'Preamble' was found ... // And ... would it be a rich idea to check ? // (some 'no Preamble' DICOM images exist !) @@ -415,6 +418,8 @@ FileType Document::GetFileType() */ std::ifstream *Document::OpenFile() { + + HasDCMPreamble = false; if (Filename.length() == 0) { return 0; @@ -422,7 +427,7 @@ std::ifstream *Document::OpenFile() if(Fp) { - gdcmVerboseMacro( "Is already opened when opening: " << Filename.c_str()); + gdcmVerboseMacro( "File already open: " << Filename.c_str()); } Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary); @@ -466,6 +471,7 @@ std::ifstream *Document::OpenFile() } if( memcmp(dicm, "DICM", 4) == 0 ) { + HasDCMPreamble = true; return Fp; } @@ -1671,7 +1677,7 @@ void Document::FindDocEntryLength( DocEntry *entry ) return; } length16 = 4; - SwitchSwapToBigEndian(); + SwitchByteSwapCode(); // Restore the unproperly loaded values i.e. the group, the element // and the dictionary entry depending on them. @@ -2222,7 +2228,7 @@ bool Document::CheckSwap() // FIXME : FIXME: // Sometimes (see : gdcmData/icone.dcm) group 0x0002 *is* Explicit VR, - // but elem 0002,0010 (Transfert Syntax) tells us the file is + // but elem 0002,0010 (Transfer Syntax) tells us the file is // *Implicit* VR. -and it is !- if( memcmp(entCur, "UL", (size_t)2) == 0 || @@ -2355,12 +2361,11 @@ bool Document::CheckSwap() /** - * \brief Restore the unproperly loaded values i.e. the group, the element - * and the dictionary entry depending on them. + * \brief Change the Byte Swap code. */ -void Document::SwitchSwapToBigEndian() +void Document::SwitchByteSwapCode() { - gdcmVerboseMacro( "Switching to BigEndian mode."); + gdcmVerboseMacro( "Switching Byte Swap code."); if ( SwapCode == 0 ) { SwapCode = 4321; @@ -2435,7 +2440,7 @@ void Document::HandleBrokenEndian(uint16_t group, uint16_t elem) { // start endian swap mark for group found reversedEndian++; - SwitchSwapToBigEndian(); + SwitchByteSwapCode(); // fix the tag group = 0xfffe; elem = 0xe000; @@ -2444,14 +2449,47 @@ void Document::HandleBrokenEndian(uint16_t group, uint16_t elem) { // end of reversed endian group reversedEndian--; - SwitchSwapToBigEndian(); + SwitchByteSwapCode(); + } +} + +/** + * \brief Group 0002 is always coded Little Endian + * whatever Transfer Syntax is + * @return no return + */ +void Document::HandleOutOfGroup0002(uint16_t group) +{ + // Endian reversion. Some files contain groups of tags with reversed endianess. + if ( !Group0002Parsed && group != 0x0002) + { + Group0002Parsed = true; + // we just came out of group 0002 + // if Transfer syntax is Big Endian we have to change CheckSwap + + TagKey key = DictEntry::TranslateToKey(0x0002, 0x0010); + if ( !TagHT.count(key)) + { + gdcmVerboseMacro("True DICOM File, with NO Tansfer Syntax ?!?"); + return; + } + + // FIXME Strangely, this works with + //'Implicit VR Transfer Syntax (GE Private) + + if ( ((ValEntry *)TagHT.find(key)->second)->GetValue() + == "Explicit VR - Big Endian" ) + { + gdcmVerboseMacro("Tansfer Syntax = Explicit VR - Big Endian"); + SwitchByteSwapCode(); + } } } /** * \brief Read the next tag but WITHOUT loading it's value * (read the 'Group Number', the 'Element Number', - * gets the Dict Entry + * gets the Dict Entry * gets the VR, gets the length, gets the offset value) * @return On succes the newly created DocEntry, NULL on failure. */ @@ -2473,7 +2511,13 @@ DocEntry *Document::ReadNextDocEntry() return 0; } + // Sometimes file contains groups of tags with reversed endianess. HandleBrokenEndian(group, elem); + +// In 'true DICOM' files Group 0002 is allways little endian + if ( HasDCMPreamble ) + HandleOutOfGroup0002(group); + std::string vr = FindDocEntryVR(); std::string realVR = vr; @@ -2583,7 +2627,10 @@ bool Document::ReadTag(uint16_t testGroup, uint16_t testElement) << " but instead we encountered tag (" << std::hex << itemTagGroup << "," << itemTagElement << ")" << std::dec - << " at address: " << (unsigned int)currentPosition ); + << " at address: " << (unsigned int)currentPosition + << std::hex + << " 0x(" << (unsigned int)currentPosition << ")" + ) ; Fp->seekg(positionOnEntry, std::ios::beg); return false; diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index dbef76f4..d237d0d2 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2005/01/08 15:03:59 $ - Version: $Revision: 1.78 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.79 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -174,6 +174,12 @@ protected: /// what is written on disc. int SwapCode; + ///\brief whether we already parsed group 0002 + bool Group0002Parsed; + + ///\brief whether file has a DCM Preamble + bool HasDCMPreamble; + /// File Pointer, opened during Header parsing. std::ifstream *Fp; @@ -230,7 +236,7 @@ private: void Initialise(); bool CheckSwap(); - void SwitchSwapToBigEndian(); + void SwitchByteSwapCode(); void SetMaxSizeLoadEntry(long); void SetMaxSizePrintEntry(long); @@ -242,6 +248,7 @@ private: DocEntrySet* set ); void HandleBrokenEndian(uint16_t group, uint16_t elem); + void HandleOutOfGroup0002(uint16_t group); // Variables /// Public dictionary used to parse this header diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index d83dd3f5..c6638963 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 00:21:48 $ - Version: $Revision: 1.188 $ + Date: $Date: 2005/01/11 11:37:13 $ + Version: $Revision: 1.189 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -528,12 +528,12 @@ bool File::Write(std::string const &fileName) * the given value. * @param content new value (string) to substitute with * @param group group number of the Dicom Element to modify - * @param element element number of the Dicom Element to modify + * @param elem element number of the Dicom Element to modify */ bool File::SetEntry(std::string const &content, - uint16_t group, uint16_t element) + uint16_t group, uint16_t elem) { - return HeaderInternal->SetEntry(content,group,element); + return HeaderInternal->SetEntry(content,group,elem); } @@ -544,12 +544,12 @@ bool File::SetEntry(std::string const &content, * @param content new value (void* -> uint8_t*) to substitute with * @param lgth new value length * @param group group number of the Dicom Element to modify - * @param element element number of the Dicom Element to modify + * @param elem element number of the Dicom Element to modify */ bool File::SetEntry(uint8_t *content, int lgth, - uint16_t group, uint16_t element) + uint16_t group, uint16_t elem) { - return HeaderInternal->SetEntry(content,lgth,group,element); + return HeaderInternal->SetEntry(content,lgth,group,elem); } /** @@ -557,14 +557,14 @@ bool File::SetEntry(uint8_t *content, int lgth, * when it exists. Create it with the given value when unexistant. * @param content (string) Value to be set * @param group Group number of the Entry - * @param element Element number of the Entry + * @param elem Element number of the Entry * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ bool File::ReplaceOrCreate(std::string const &content, - uint16_t group, uint16_t element) + uint16_t group, uint16_t elem) { - return HeaderInternal->ReplaceOrCreate(content,group,element) != NULL; + return HeaderInternal->ReplaceOrCreate(content,group,elem) != NULL; } /* @@ -573,14 +573,14 @@ bool File::ReplaceOrCreate(std::string const &content, * A copy of the binArea is made to be kept in the Document. * @param binArea (binary) value to be set * @param group Group number of the Entry - * @param element Element number of the Entry + * @param elem Element number of the Entry * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ bool File::ReplaceOrCreate(uint8_t *binArea, int lgth, - uint16_t group, uint16_t element) + uint16_t group, uint16_t elem) { - return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,element) != NULL; + return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL; } /** @@ -852,9 +852,9 @@ void File::RestoreWriteOfLibido() Archive->Restore(0x0008,0x0010); } -ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) +ValEntry *File::CopyValEntry(uint16_t group,uint16_t elem) { - DocEntry *oldE = HeaderInternal->GetDocEntry(group, element); + DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); ValEntry *newE; if(oldE) @@ -864,15 +864,15 @@ ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) } else { - newE = GetHeader()->NewValEntry(group,element); + newE = GetHeader()->NewValEntry(group,elem); } return newE; } -BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element) +BinEntry *File::CopyBinEntry(uint16_t group,uint16_t elem) { - DocEntry *oldE = HeaderInternal->GetDocEntry(group, element); + DocEntry *oldE = HeaderInternal->GetDocEntry(group, elem); BinEntry *newE; if(oldE) @@ -882,7 +882,7 @@ BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element) } else { - newE = GetHeader()->NewBinEntry(group,element); + newE = GetHeader()->NewBinEntry(group,elem); } return newE; diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 6231e2a2..4120c2a6 100644 --- a/src/gdcmGlobal.cxx +++ b/src/gdcmGlobal.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.cxx,v $ Language: C++ - Date: $Date: 2005/01/10 20:52:39 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/11 11:37:14 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -108,7 +108,7 @@ VR *Global::GetVR() } /** * \ingroup Global - * \brief returns a pointer to the 'Transfert Syntax Table' + * \brief returns a pointer to the 'Transfer Syntax Table' */ TS *Global::GetTS() { diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 9eadf2c7..c560a82a 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/10 17:09:49 $ - Version: $Revision: 1.228 $ + Date: $Date: 2005/01/11 11:37:14 $ + Version: $Revision: 1.229 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1164,34 +1164,34 @@ int Header::GetLUTNbits() } /** - * \brief Accesses the info from 0002,0010 : Transfert Syntax and TS + * \brief Accesses the info from 0002,0010 : Transfer Syntax and TS * else 1. - * @return The full Transfert Syntax Name (as opposed to Transfert Syntax UID) + * @return The full Transfer Syntax Name (as opposed to Transfer Syntax UID) */ -std::string Header::GetTransfertSyntaxName() +std::string Header::GetTransferSyntaxName() { - // use the TS (TS : Transfert Syntax) - std::string transfertSyntax = GetEntry(0x0002,0x0010); + // use the TS (TS : Transfer Syntax) + std::string transferSyntax = GetEntry(0x0002,0x0010); - if ( transfertSyntax == GDCM_NOTLOADED ) + if ( transferSyntax == GDCM_NOTLOADED ) { - gdcmVerboseMacro( "Transfert Syntax not loaded. " << std::endl + gdcmVerboseMacro( "Transfer Syntax not loaded. " << std::endl << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" ); return "Uncompressed ACR-NEMA"; } - if ( transfertSyntax == GDCM_UNFOUND ) + if ( transferSyntax == GDCM_UNFOUND ) { - gdcmVerboseMacro( "Unfound Transfert Syntax (0002,0010)"); + gdcmVerboseMacro( "Unfound Transfer Syntax (0002,0010)"); return "Uncompressed ACR-NEMA"; } - while ( ! isdigit((unsigned char)transfertSyntax[transfertSyntax.length()-1]) ) + while ( ! isdigit((unsigned char)transferSyntax[transferSyntax.length()-1]) ) { - transfertSyntax.erase(transfertSyntax.length()-1, 1); + transferSyntax.erase(transferSyntax.length()-1, 1); } // we do it only when we need it TS* ts = Global::GetTS(); - std::string tsName = ts->GetValue( transfertSyntax ); + std::string tsName = ts->GetValue( transferSyntax ); //delete ts; /// \todo Seg Fault when deleted ?! return tsName; diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index 8c56bdd0..d7669250 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.h,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:28 $ - Version: $Revision: 1.97 $ + Date: $Date: 2005/01/11 11:37:14 $ + Version: $Revision: 1.98 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -160,7 +160,7 @@ public: int GetLUTNbits(); /// Return the Transfer Syntax as a string - std::string GetTransfertSyntaxName(); + std::string GetTransferSyntaxName(); /// Accessor to \ref Header::GrPixel uint16_t GetGrPixel() { return GrPixel; } diff --git a/src/gdcmTS.h b/src/gdcmTS.h index a4e82fe4..7d222a57 100644 --- a/src/gdcmTS.h +++ b/src/gdcmTS.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmTS.h,v $ Language: C++ - Date: $Date: 2005/01/11 00:37:42 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/11 11:37:14 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,11 +30,11 @@ namespace gdcm //----------------------------------------------------------------------------- typedef std::string TSKey; typedef std::string TSAtr; -typedef std::map TSHT; // Transfert Syntax Hash Table +typedef std::map TSHT; // Transfer Syntax Hash Table //----------------------------------------------------------------------------- /* - * Container for dicom Transfert Syntax Hash Table + * Container for dicom Transfer Syntax Hash Table * \note This is a singleton */ class GDCM_EXPORT TS