From 04dd465efc936ab0caa195d856262862bc8da842 Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 28 Jun 2004 14:29:52 +0000 Subject: [PATCH] remove old mutimap related code --- src/gdcmDicomDir.cxx | 14 ++++++-------- src/gdcmDocument.cxx | 16 +++++++++------- src/gdcmFile.cxx | 34 +++++++--------------------------- src/gdcmHeader.cxx | 7 +++---- 4 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 7a18df16..2b07c9b9 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2004/06/28 09:30:58 $ - Version: $Revision: 1.53 $ + Date: $Date: 2004/06/28 14:29:52 $ + Version: $Revision: 1.54 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -84,7 +84,7 @@ gdcmDicomDir::gdcmDicomDir(const char *FileName, bool parseDir, { // que l'on ai passe un root directory ou un DICOMDIR // et quelle que soit la valeur de parseDir, - // on a lance gdcmDocument + // on a deja lance gdcmDocument Initialize(); // gdcmDocument already executed @@ -118,7 +118,7 @@ gdcmDicomDir::gdcmDicomDir(const char *FileName, bool parseDir, if (e==NULL) { dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : NO Directory record" " sequence (0x0004,0x1220)"); - /// \todo FIXME : what to do when the parsed file IS NOT a + /// \todo FIXME : what do we do when the parsed file IS NOT a /// DICOMDIR file ? } CreateDicomDir(); @@ -417,20 +417,18 @@ void gdcmDicomDir::CreateDicomDirChainedList(std::string path) it!=fileList.end(); ++it) { - std::cout << "nom fichier " << it->c_str() << std::endl; //JPR - progress=(float)(count+1)/(float)fileList.size(); CallProgressMethod(); if(abort) break; - header=new gdcmHeader(it->c_str()); + header=new gdcmHeader(it->c_str(),false,true); if(!header) { std::cout << "echec new Header " << it->c_str() << std::endl; // JPR } if(header->IsReadable()) { list.push_back(header); // adds the file header to the chained list - std::cout << "readable : " <c_str() << std::endl; + std::cout << "readable : " <c_str() << std::endl; // JPR } else delete header; diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 258dcff8..53bfa005 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2004/06/28 11:01:18 $ - Version: $Revision: 1.38 $ + Date: $Date: 2004/06/28 14:29:52 $ + Version: $Revision: 1.39 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -99,9 +99,9 @@ gdcmDocument::gdcmDocument(std::string const & inFilename, bool enable_sequences, bool ignore_shadow) : gdcmElementSet(-1) { - enableSequences=enable_sequences; IgnoreShadow =ignore_shadow; - + //enableSequences=enable_sequences; + enableSequences=true; // JPR // TODO : remove params out of the constructor SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Filename = inFilename; Initialise(); @@ -176,7 +176,7 @@ gdcmDocument::gdcmDocument(std::string const & inFilename, gdcmDocument::gdcmDocument(bool exception_on_error) :gdcmElementSet(-1) { (void)exception_on_error; - enableSequences=0; + //enableSequences=0; // ?!? JPR SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Initialise(); @@ -261,12 +261,14 @@ bool gdcmDocument::SetShaDict(DictKey dictName){ * false otherwise. */ bool gdcmDocument::IsReadable(void) { + if(Filetype==gdcmUnknown) { - //std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype - // << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR + std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype + << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR dbg.Verbose(0, "gdcmDocument::IsReadable: wrong filetype"); return false; } + if(tagHT.empty()) { dbg.Verbose(0, "gdcmDocument::IsReadable: no tags in internal" " hash table."); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 6e25ca5e..7da9762c 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2004/06/28 14:12:03 $ - Version: $Revision: 1.112 $ + Date: $Date: 2004/06/28 14:29:52 $ + Version: $Revision: 1.113 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -781,45 +781,25 @@ bool gdcmFile::WriteBase (std::string const & fileName, FileType type) Header->SetEntryByNumber(rows , 0x0028, 0x0011); } // ----------------- End of Special Patch ---------------- - - /// \todo get the grPixel, numPixel values (for some ACR-NEMA images only) - + uint16_t grPixel = Header->GetGrPixel(); uint16_t numPixel = Header->GetNumPixel();; - - // Update Pixel Data Length - // the *last* of the (GrPixel, NumPixel), if many. - TagKey key = gdcmDictEntry::TranslateToKey(grPixel, numPixel); - TagDocEntryHT::iterator p2; gdcmDocEntry* PixelElement; - - IterHT it = Header->GetEntry().equal_range(key); // get a pair of iterators first-last synonym - if ( Header->GetEntry().count(key) == 1 ) // only the first is significant - { - p2 = it.first; // iterator on the first (unique) synonym - } - else - { - p2 = it.second;// iterator on the last synonym - } - - PixelElement = p2->second; // H Table target column (2-nd col) - // PixelElement->SetPrintLevel(2); - // PixelElement->Print(); + PixelElement = GetHeader()->GetDocEntryByNumber(grPixel, numPixel); if ( PixelRead == 1 ) { + // we read pixel 'as is' (no tranformation LUT -> RGB) PixelElement->SetLength( ImageDataSizeRaw ); } else if ( PixelRead == 0 ) { + // we tranformed GrayLevel pixels + LUT into RGB Pixel PixelElement->SetLength( ImageDataSize ); } - - //PixelElement->SetPrintLevel(2); - //PixelElement->Print(); + Header->Write(fp1, type); // -------------------------------------------------------------- diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 7fdcda0b..40ff3bfb 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2004/06/28 11:01:18 $ - Version: $Revision: 1.172 $ + Date: $Date: 2004/06/28 14:29:52 $ + 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 @@ -119,7 +119,7 @@ void gdcmHeader::Write(FILE* fp,FileType filetype) { // Drop Palette Color, if necessary if ( GetEntryByNumber(0x0028,0x0002).c_str()[0] == '3' ) { - + // if SamplesPerPixel = 3, sure we don't need any LUT ! // Drop 0028|1101, 0028|1102, 0028|1103 // Drop 0028|1201, 0028|1202, 0028|1203 @@ -164,7 +164,6 @@ void gdcmHeader::Write(FILE* fp,FileType filetype) { */ bool gdcmHeader::IsReadable() { if(!gdcmDocument::IsReadable()) { - //std::cout << "doc non Readable " << std::endl; //JPR return false; } std::string res = GetEntryByNumber(0x0028, 0x0005); -- 2.48.1