From: jpr Date: Sat, 8 Jan 2005 15:03:56 +0000 (+0000) Subject: According to Benoit's suggestion, and without any objection from anybody X-Git-Tag: Version1.0.bp~416 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a462ce9f1af0894cd930ab04f2e65cd80dfa7084;p=gdcm.git According to Benoit's suggestion, and without any objection from anybody - methods SetxxxByNumber and GetxxxByNumber renamed as Setxxx and Get xxx - methods Dict::Print() and Dict::PrintByKey() merged into Dict::Print() - method gdcmDicomDirObject::GetEntry() renamed as gdcmDicomDirObject::GetEntryHT() to avoid confusion (and compile error) --- diff --git a/ChangeLog b/ChangeLog index bbacebda..c8566bfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -204,14 +204,14 @@ 2004-12-03 Benoit Regrain * Remove memory leaks on the DicomDir - * Remove some useless datas in DicomDirObject + * Remove some useless data in DicomDirObject * Add usefull methods in SQItem, to be complient withe the ElementSet 2004-12-03 Benoit Regrain * src/gdcmFile.[h|cxx] : now use FileType instead of TWriteType. 2004-12-03 Benoit Regrain - * src/gdcmPixelWriteConvert.[h|cxx] : new class to write datas (and in the + * src/gdcmPixelWriteConvert.[h|cxx] : new class to write data (and in the future, with convertion) * src/gdcmFile.[h|cxx] : the PixelWriteConverter instance replace Pixel_Data and ImageDataSize values. Remove the method to get the PixelReadConverter @@ -301,7 +301,7 @@ write * Test/TestCopyDicom.cxx, TestReadWriteReadCompare.cxx, TestAllReadCompareDicom.cxx : pass the write of images to RGB and test - is now on RGB datas (as before my last commit + is now on RGB data (as before my last commit * Example/PrintHeader.cxx, PrintFile.cxx : repad files. 2004-11-24 Benoit Regrain @@ -311,7 +311,7 @@ It was in the gdcmFile, and all write have been regrouped * src/gdcmFile.[h|cxx] : add methods to get the Raw data elements and size. Write correctly all dicom files (in decompressed mode only at this time) - * Test/ : test on files are now made using Raw datas and not color datas if + * Test/ : test on files are now made using Raw data and not color data if any. * Example/PrintFile.cxx : add more printings @@ -338,7 +338,7 @@ 2004-11-23 Benoit Regrain * src/gdcmDocEntryArchive.cxx : complete the print function, that prints all replaced DocEntry's - * src/gdcmFile.[h|cxx] : remove all changes of the header when getting datas. + * src/gdcmFile.[h|cxx] : remove all changes of the header when getting data. Now, each needed DocEntry to modify is duplicated, modified and inserted to the header using DocEntryArchive. Thus, after save, we can restore the header initial state. @@ -378,10 +378,10 @@ Two problems appear when doing it : - with the gdcmFile : when the GetImageData method is called, the pixels are stored in the gdcmPixelConvert, but a gdcmBinEntry link to these - datas (pixels). And each structure destruct the datas when it's - destructed. So we have two destructions for the same datas. To solve it, + data (pixels). And each structure destruct the data when it's + destructed. So we have two destructions for the same data. To solve it, a flag is added in the gdcmBinEntry to indicate if the BinEntry owns the - datas or not. If it doesn't own datas, then they will not destroyed by + data or not. If it doesn't own data, then they will not destroyed by the gdcmBinEntry. - with the gdcmDicomDir : the sequences (gdcmSQItem) contain DocEntry elements. The DicomDir* (DicomDirPatient, etc.) inherit from SQItem. @@ -449,7 +449,7 @@ correctly close is a call to CloseFile. When closing the file pointer, test if its not null to close the file. * src/gdcmPixelConvert.cxx : bug fix for the SIEMENS_GBS_III-16-ACR_NEMA_1.acr - file. For an uncompressed image, the copied datas correspond in the least + file. For an uncompressed image, the copied data correspond in the least case to the image size (calculated) or the image size specified in the header. A verbose is generated if these two size mismatch @@ -1837,7 +1837,7 @@ 2003-12-10 Benoit Regrain * gdcmHeader is now aggregating gdcmFile, and not derived into. Thus, we - can use a gdcmHeaderHelper to load datas + can use a gdcmHeaderHelper to load data * gdcmPython/testSuite.py : make the testSuite compliant with modifications made in the source code diff --git a/Example/BuildUpDicomDir.cxx b/Example/BuildUpDicomDir.cxx index f531f2cb..66df934f 100644 --- a/Example/BuildUpDicomDir.cxx +++ b/Example/BuildUpDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: BuildUpDicomDir.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,25 +50,25 @@ int main(int argc, char* argv[]) ((gdcm::Document *)dcmdir)->Print(); gdcm::DicomDirPatient *p1=dcmdir->NewPatient(); - p1->SetEntryByNumber("patientONE",0x0010, 0x0010); + p1->SetEntry("patientONE",0x0010, 0x0010); gdcm::DicomDirPatient *p2=dcmdir->NewPatient(); - p2->SetEntryByNumber("patientTWO",0x0010, 0x0010); + p2->SetEntry("patientTWO",0x0010, 0x0010); gdcm::DicomDirStudy *s21=p2->NewStudy(); - s21->SetEntryByNumber("StudyDescrTwo.One",0x0008, 0x1030); + s21->SetEntry("StudyDescrTwo.One",0x0008, 0x1030); gdcm::DicomDirSerie *s211=s21->NewSerie(); gdcm::DicomDirImage *s2111=s211->NewImage(); (void)s2111; //not used gdcm::DicomDirStudy *s11=p1->NewStudy(); - s11->SetEntryByNumber("StudyDescrOne.One",0x0008, 0x1030); + s11->SetEntry("StudyDescrOne.One",0x0008, 0x1030); // Name of the physician reading study // Header Entry to be created - s11->SetEntryByNumber("Dr Mabuse",0x0008, 0x1060); + s11->SetEntry("Dr Mabuse",0x0008, 0x1060); gdcm::DicomDirPatient *p3 = dcmdir->NewPatient(); - p3->SetEntryByNumber("patientTHREE",0x0010, 0x0010); + p3->SetEntry("patientTHREE",0x0010, 0x0010); std::cout << "\n------- BuildUpDicomDir: Test Print of Patient ONE -----\n"; p1->Print(); diff --git a/Example/FindTags.cxx b/Example/FindTags.cxx index a091d156..83c6e599 100644 --- a/Example/FindTags.cxx +++ b/Example/FindTags.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: FindTags.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:43:36 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -47,14 +47,14 @@ int main(int argc, char* argv[]) int dataSize = f1->GetImageDataSize(); std::cout << "---> pourFindTaggs : dataSize " << dataSize << std::endl; - f1->SetEntryByNumber(RecCode ,0x0008,0x0010); - f1->SetEntryByNumber(ManufacturerName ,0x0008,0x0070); + f1->SetEntry(RecCode ,0x0008,0x0010); + f1->SetEntry(ManufacturerName ,0x0008,0x0070); // ImagePositionPatient - ImagePositionPatient = f1->GetHeader()->GetEntryByNumber(0x0020,0x0032); + ImagePositionPatient = f1->GetHeader()->GetEntry(0x0020,0x0032); // Image Position (RET) - f1->SetEntryByNumber(ImagePositionPatient, 0x0020,0x0030); + f1->SetEntry(ImagePositionPatient, 0x0020,0x0030); sscanf(ImagePositionPatient.c_str(), "%f%c%f%c%f", &x,&c,&y,&c,&z); @@ -70,23 +70,23 @@ int main(int argc, char* argv[]) // Location std::string zizi = gdcm::Util::Format("%f",l); Location = gdcm::Util::DicomString(zizi.c_str()); - f1->SetEntryByNumber(Location, 0x0020,0x0050); + f1->SetEntry(Location, 0x0020,0x0050); // sinon, la longueur du champ est erronée (?!?) // Probable sac de noeud entre strlen(xxx.c_str()) et xxx.length() // a eclaircir ! -// SetEntryLengthByNumber is private now. +// SetEntryLength is private now. //TO DO : see is the pb goes on... -//f1->GetHeader()->SetEntryLengthByNumber(strlen(Location.c_str())-1, 0x0020,0x0050); +//f1->GetHeader()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050); // Image Location zizi = gdcm::Util::Format("%d",0x7FE0); ImageLocation = gdcm::Util::DicomString(zizi.c_str()); -//f1->SetEntryByNumber(Location, 0x0028,0x0200); -//f1->GetHeader()->SetEntryLengthByNumber(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence ! +//f1->SetEntry(Location, 0x0028,0x0200); +//f1->GetHeader()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence ! // void* imageData= f1->GetImageData(); diff --git a/Example/PrintDicomDir.cxx b/Example/PrintDicomDir.cxx index 1baf901c..b8c948df 100644 --- a/Example/PrintDicomDir.cxx +++ b/Example/PrintDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDicomDir.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 09:08:45 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itPatient ++; } */ @@ -80,10 +80,10 @@ int main(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description + std::cout << "--- "<< (*itStudy)->GetEntry(0x0008, 0x1030) << std::endl; // Study Description ++itStudy; } itPatient ++; @@ -99,19 +99,19 @@ int main(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT // Patient's Name, Patient ID - std::cout << "Pat.Name:[" << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) <<"]"; // Patient's Name + std::cout << "Pat.Name:[" << (*itPatient)->GetEntry(0x0010, 0x0010) <<"]"; // Patient's Name std::cout << " Pat.ID:["; - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0020) << "]" << std::endl; // Patient ID + std::cout << (*itPatient)->GetEntry(0x0010, 0x0020) << "]" << std::endl; // Patient ID itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- Stud.descr:[" << (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << "]";// Study Description - std::cout << " Stud.ID:[" << (*itStudy)->GetEntryByNumber(0x0020, 0x0010); // Study ID + std::cout << "--- Stud.descr:[" << (*itStudy)->GetEntry(0x0008, 0x1030) << "]";// Study Description + std::cout << " Stud.ID:[" << (*itStudy)->GetEntry(0x0020, 0x0010); // Study ID std::cout << "]" << std::endl; itSerie = ((*itStudy)->GetDicomDirSeries()).begin(); while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- Ser.Descr:["<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e)<< "]"; // Series Description - std::cout << " Ser.nb:[" << (*itSerie)->GetEntryByNumber(0x0020, 0x0011); // Series number - std::cout << "] Mod.:[" << (*itSerie)->GetEntryByNumber(0x0008, 0x0060) << "]"; // Modality + std::cout << "--- --- Ser.Descr:["<< (*itSerie)->GetEntry(0x0008, 0x103e)<< "]"; // Series Description + std::cout << " Ser.nb:[" << (*itSerie)->GetEntry(0x0020, 0x0011); // Series number + std::cout << "] Mod.:[" << (*itSerie)->GetEntry(0x0008, 0x0060) << "]"; // Modality std::cout << std::endl; ++itSerie; } @@ -128,16 +128,16 @@ int main(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description + std::cout << "--- "<< (*itStudy)->GetEntry(0x0008, 0x1030) << std::endl; // Study Description itSerie = ((*itStudy)->GetDicomDirSeries()).begin(); while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- "<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e) << std::endl; // Serie Description + std::cout << "--- --- "<< (*itSerie)->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description itImage = ((*itSerie)->GetDicomDirImages()).begin(); while (itImage != (*itSerie)->GetDicomDirImages().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- --- "<< (*itImage)->GetEntryByNumber(0x0004, 0x1500) << std::endl; // File name + std::cout << "--- --- --- "<< (*itImage)->GetEntry(0x0004, 0x1500) << std::endl; // File name ++itImage; } ++itSerie; diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 77c00f4a..f36257e6 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 11:37:01 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.19 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) << " PlanarConfiguration=" << planarConfig << std::endl << " PhotometricInterpretation=" - << e1->GetEntryByNumber(0x0028,0x0004) + << e1->GetEntry(0x0028,0x0004) << std::endl; int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); @@ -77,7 +77,7 @@ int main(int argc, char* argv[]) << std::endl; - if ( e1->GetEntryByNumber(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) + if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) { std::cout << "Transfert Syntax not loaded. " << std::endl << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" diff --git a/Example/PrintHeader.cxx b/Example/PrintHeader.cxx index 68b09261..74305de6 100644 --- a/Example/PrintHeader.cxx +++ b/Example/PrintHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintHeader.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) std::cout << "\n\n" << std::endl; - if ( e1->GetEntryByNumber(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) + if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED ) { std::cout << "Transfert Syntax not loaded. " << std::endl << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index 565bd046..aa4ae3bc 100644 --- a/Example/TestChangeHeader.cxx +++ b/Example/TestChangeHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestChangeHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 14:31:37 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,14 +37,14 @@ int main(int argc, char* argv[]) // 0018 1310 US ACQ Acquisition Matrix gdcm::DictEntry *dictEntry = - f2->GetHeader()->GetPubDict()->GetDictEntryByNumber( 0x0018, 1310 ); + f2->GetHeader()->GetPubDict()->GetDictEntry( 0x0018, 1310 ); std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl; - std::string matrix = f2->GetHeader()->GetEntryByNumber(0x0018, 0x1310); + std::string matrix = f2->GetHeader()->GetEntry(0x0018, 0x1310); if(matrix != "gdcm::Unfound") { std::cerr << "Aquisition Matrix:" << matrix << std::endl; - f1->GetHeader()->ReplaceOrCreateByNumber( matrix, 0x0018, 0x1310); + f1->GetHeader()->ReplaceOrCreate( matrix, 0x0018, 0x1310); } f1->GetImageData(); diff --git a/Example/TestCopyDicom.cxx b/Example/TestCopyDicom.cxx index b13d002e..84b1b5e6 100644 --- a/Example/TestCopyDicom.cxx +++ b/Example/TestCopyDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyDicom.cxx,v $ Language: C++ - Date: $Date: 2004/11/19 08:37:55 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/08 15:03:57 $ + 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 @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) d->Print(); std::cout << std::endl; if ( gdcm::BinEntry* b = dynamic_cast(d) ) { - copy->GetHeader()->ReplaceOrCreateByNumber( + copy->GetHeader()->ReplaceOrCreate( b->GetBinArea(), b->GetLength(), b->GetGroup(), @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) } else if ( gdcm::ValEntry* v = dynamic_cast(d) ) { - copy->GetHeader()->ReplaceOrCreateByNumber( + copy->GetHeader()->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index ca89f4fd..11589526 100644 --- a/Example/TestFromScratch.cxx +++ b/Example/TestFromScratch.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestFromScratch.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:37 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,6 +37,7 @@ int main(int argc, char *argv[]) // Doesn't seems to do anything: gdcm::Debug::SetDebugOn(); + // Doesn't link properly: //gdcm::Debug::GetReference().SetDebug(1); @@ -64,7 +65,7 @@ int main(int argc, char *argv[]) // Do not bother with field from private dict if( v->GetName() != "gdcm::Unknown" ) { - h2->ReplaceOrCreateByNumber( + h2->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index fb546826..38c25b71 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.13 $ 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[]) << " SampleserPixel=" << sPP << " PlanarConfiguration=" << planarConfig << " PhotometricInterpretation=" - << e1->GetEntryByNumber(0x0028,0x0004) + << e1->GetEntry(0x0028,0x0004) << std::endl; int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); diff --git a/Example/Write.cxx b/Example/Write.cxx index 492506bf..3756a2c2 100644 --- a/Example/Write.cxx +++ b/Example/Write.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: Write.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -85,11 +85,11 @@ int main(int argc, char* argv[]) sPP = e1->GetSamplesPerPixel(); planarConfig = e1->GetPlanarConfiguration(); - std::cout << " pixelType=" << pixelType + std::cout << " pixelType=" << pixelType << " SampleserPixel=" << sPP << " PlanarConfiguration=" << planarConfig << " PhotometricInterpretation=" - << e1->GetEntryByNumber(0x0028,0x0004) + << e1->GetEntry(0x0028,0x0004) << std::endl; int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); diff --git a/Example/WriteDicom.cxx b/Example/WriteDicom.cxx index 9f83a2a0..81a79048 100644 --- a/Example/WriteDicom.cxx +++ b/Example/WriteDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicom.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/08 15:03:57 $ + 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 @@ -39,15 +39,15 @@ int main(int argc, char* argv[]) // We assume that DICOM fields of second file actually exists : - std::string nbFrames = f2->GetHeader()->GetEntryByNumber(0x0028, 0x0008); + std::string nbFrames = f2->GetHeader()->GetEntry(0x0028, 0x0008); if(nbFrames != "gdcm::Unfound") { - f1->GetHeader()->ReplaceOrCreateByNumber( nbFrames, 0x0028, 0x0008); + f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008); } - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0010), 0x0028, 0x0010); // nbLig - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0011), 0x0028, 0x0011); // nbCol + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol // Some other tags should be updated: @@ -65,8 +65,8 @@ int main(int argc, char* argv[]) f1->GetHeader()->Print(); - std::string s0 = f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0000); - std::string s10 = f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0010); + std::string s0 = f2->GetHeader()->GetEntry(0x7fe0, 0x0000); + std::string s10 = f2->GetHeader()->GetEntry(0x7fe0, 0x0010); std::cout << "lgr 7fe0, 0000 " << s0 << std::endl; std::cout << "lgr 7fe0, 0010 " << s10 << std::endl; diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index 6954426a..b8afea20 100644 --- a/Example/WriteDicomSimple.cxx +++ b/Example/WriteDicomSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicomSimple.cxx,v $ Language: C++ - Date: $Date: 2004/12/10 16:48:37 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/08 15:03:57 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -62,39 +62,39 @@ int main(int argc, char* argv[]) // Set the image size str.str(""); str << SIZE_X; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0011); // Columns + header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns str.str(""); str << SIZE_Y; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0010); // Rows + header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows // Set the pixel type str.str(""); str << COMPONENT_SIZE * 8; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0100); // Bits Allocated - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0101); // Bits Stored + header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated + header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored str.str(""); str << COMPONENT_SIZE * 8 - 1; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0102); // High Bit + header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit // Set the pixel representation str.str(""); str << "0"; // Unsigned - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0103); // Pixel Representation + header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation // Set the samples per pixel str.str(""); str << COMPONENT; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0002); // Samples per Pixel + header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel // Set the Window / Level str.str(""); str << COLOR_WINDOW; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x1051); // Window Width + header->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width str.str(""); str << COLOR_LEVEL; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x1050); // Window Center + header->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center if( !header->IsReadable() ) { diff --git a/Testing/TestAllEntryVerify.cxx b/Testing/TestAllEntryVerify.cxx index ee2420f1..b3873f48 100644 --- a/Testing/TestAllEntryVerify.cxx +++ b/Testing/TestAllEntryVerify.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllEntryVerify.cxx,v $ Language: C++ - Date: $Date: 2004/12/10 13:49:06 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -229,7 +229,7 @@ bool ReferenceFileParser::Check( MapFileValuesType::iterator &fileIt ) uint16_t group = axtoi( &(groupString[0]) ); uint16_t element = axtoi( &(groupElement[0]) ); - std::string testedValue = tested->GetEntryByNumber(group, element); + std::string testedValue = tested->GetEntry(group, element); if ( testedValue != j->second ) { // Oops make sure this is only the \0 that differ diff --git a/Testing/TestBug.cxx b/Testing/TestBug.cxx index 848fa862..ed7cdc65 100644 --- a/Testing/TestBug.cxx +++ b/Testing/TestBug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestBug.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:56 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -34,7 +34,7 @@ int TestBug(int argc, char* argv[]) } //e1->PrintPubDict(); //e1->GetPubDict()->GetEntriesByKey(); - e1->GetPubDict()->PrintByKey(); + e1->GetPubDict()->Print(); delete e1; return 0; diff --git a/Testing/TestChangeHeader.cxx b/Testing/TestChangeHeader.cxx index 72d55563..7f330020 100644 --- a/Testing/TestChangeHeader.cxx +++ b/Testing/TestChangeHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestChangeHeader.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:56 $ - Version: $Revision: 1.28 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.29 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -41,10 +41,10 @@ int TestChangeHeader(int argc, char* argv[]) // We suppose the DICOM Entries of the second file *do* exist ! - std::string nbFrames = f2->GetHeader()->GetEntryByNumber(0x0028, 0x0008); + std::string nbFrames = f2->GetHeader()->GetEntry(0x0028, 0x0008); if(nbFrames != "gdcm::Unfound") { - f1->GetHeader()->ReplaceOrCreateByNumber( nbFrames, 0x0028, 0x0008); + f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008); } @@ -57,18 +57,18 @@ int TestChangeHeader(int argc, char* argv[]) // It was not designed as a 'Test' program, but as a utility // provided to 'transform' an image 'Siemens MRI New version' into an image 'Siemens MRI old version' - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0010), 0x0028, 0x0010);// nbLig - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0011), 0x0028, 0x0011);// nbCol - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0102), 0x0028, 0x0102);// HighBit - f1->GetHeader()->ReplaceOrCreateByNumber( - f2->GetHeader()->GetEntryByNumber(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010);// nbLig + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011);// nbCol + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0102), 0x0028, 0x0102);// HighBit + f1->GetHeader()->ReplaceOrCreate( + f2->GetHeader()->GetEntry(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation // Probabely some more to update (?) // TODO : add a default value @@ -85,8 +85,8 @@ int TestChangeHeader(int argc, char* argv[]) f1->GetHeader()->Print(); - std::string s0 =f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0000); - std::string s10=f2->GetHeader()->GetEntryByNumber(0x7fe0, 0x0010); + std::string s0 =f2->GetHeader()->GetEntry(0x7fe0, 0x0000); + std::string s10=f2->GetHeader()->GetEntry(0x7fe0, 0x0010); printf("lgr 7fe0, 0000 %s\n",s0.c_str()); printf("lgr 7fe0, 0010 %s\n",s10.c_str()); diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index 3a869912..45588b36 100644 --- a/Testing/TestCopyDicom.cxx +++ b/Testing/TestCopyDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 14:49:15 $ - Version: $Revision: 1.27 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -92,7 +92,7 @@ int CopyDicom(std::string const & filename, { if ( gdcm::BinEntry* b = dynamic_cast(d) ) { - copyH->ReplaceOrCreateByNumber( + copyH->ReplaceOrCreate( b->GetBinArea(), b->GetLength(), b->GetGroup(), @@ -101,7 +101,7 @@ int CopyDicom(std::string const & filename, } else if ( gdcm::ValEntry* v = dynamic_cast(d) ) { - copyH->ReplaceOrCreateByNumber( + copyH->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 4f0eb9aa..aa1ed72c 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyRescaleDicom.cxx,v $ Language: C++ - Date: $Date: 2004/12/08 11:37:15 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -64,7 +64,7 @@ int CopyRescaleDicom(std::string const & filename, { if ( gdcm::BinEntry* b = dynamic_cast(d) ) { - copyH->ReplaceOrCreateByNumber( + copyH->ReplaceOrCreate( b->GetBinArea(), b->GetLength(), b->GetGroup(), @@ -73,7 +73,7 @@ int CopyRescaleDicom(std::string const & filename, } else if ( gdcm::ValEntry* v = dynamic_cast(d) ) { - copyH->ReplaceOrCreateByNumber( + copyH->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), @@ -95,14 +95,14 @@ int CopyRescaleDicom(std::string const & filename, size_t rescaleSize; uint8_t *rescaleImage; - const std::string & bitsStored = originalH->GetEntryByNumber(0x0028,0x0101); + const std::string & bitsStored = originalH->GetEntry(0x0028,0x0101); if( bitsStored == "16" ) { std::cout << "Rescale..."; - copyH->ReplaceOrCreateByNumber( "8", 0x0028, 0x0100); // BitsAllocated - copyH->ReplaceOrCreateByNumber( "8", 0x0028, 0x0101); // BitsStored - copyH->ReplaceOrCreateByNumber( "7", 0x0028, 0x0102); // HighBit - copyH->ReplaceOrCreateByNumber( "0", 0x0028, 0x0103); //Pixel Representation + copyH->ReplaceOrCreate( "8", 0x0028, 0x0100); // BitsAllocated + copyH->ReplaceOrCreate( "8", 0x0028, 0x0101); // BitsStored + copyH->ReplaceOrCreate( "7", 0x0028, 0x0102); // HighBit + copyH->ReplaceOrCreate( "0", 0x0028, 0x0103); //Pixel Representation // We assume the value were from 0 to uint16_t max rescaleSize = dataSize / 2; diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index 1bd8fd22..a4201e8c 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDir.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 09:08:45 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/01/08 15:03:58 $ + Version: $Revision: 1.24 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -67,7 +67,7 @@ int TestDicomDir(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itPatient ++; } */ @@ -79,10 +79,10 @@ int TestDicomDir(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description + std::cout << "--- "<< (*itStudy)->GetEntry(0x0008, 0x1030) << std::endl; // Study Description ++itStudy; } itPatient ++; @@ -96,19 +96,19 @@ int TestDicomDir(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT // Patient's Name, Patient ID - std::cout << "Pat.Name:[" << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) <<"]"; + std::cout << "Pat.Name:[" << (*itPatient)->GetEntry(0x0010, 0x0010) <<"]"; std::cout << " Pat.ID:["; - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0020) << "]" << std::endl; + std::cout << (*itPatient)->GetEntry(0x0010, 0x0020) << "]" << std::endl; itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- Stud.descr:[" << (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << "]";// Study Description - std::cout << " Stud.ID:["<< (*itStudy)->GetEntryByNumber(0x0020, 0x0010); // Study ID + std::cout << "--- Stud.descr:[" << (*itStudy)->GetEntry(0x0008, 0x1030) << "]";// Study Description + std::cout << " Stud.ID:["<< (*itStudy)->GetEntry(0x0020, 0x0010); // Study ID std::cout << "]" << std::endl; itSerie = ((*itStudy)->GetDicomDirSeries()).begin(); while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- Ser.Descr:["<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e)<< "]";// Serie Description - std::cout << " Ser.nb:[" << (*itSerie)->GetEntryByNumber(0x0020, 0x0011); // Serie number - std::cout << "] Mod.:[" << (*itSerie)->GetEntryByNumber(0x0008, 0x0060) << "]"; // Modality + std::cout << "--- --- Ser.Descr:["<< (*itSerie)->GetEntry(0x0008, 0x103e)<< "]";// Serie Description + std::cout << " Ser.nb:[" << (*itSerie)->GetEntry(0x0020, 0x0011); // Serie number + std::cout << "] Mod.:[" << (*itSerie)->GetEntry(0x0008, 0x0060) << "]"; // Modality std::cout << std::endl; ++itSerie; } @@ -125,16 +125,16 @@ int TestDicomDir(int argc, char* argv[]) itPatient = e1->GetDicomDirPatients().begin(); while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline la liste de PATIENT - std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name + std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name itStudy = ((*itPatient)->GetDicomDirStudies()).begin(); while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) { // on degouline les STUDY de ce patient - std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description + std::cout << "--- "<< (*itStudy)->GetEntry(0x0008, 0x1030) << std::endl; // Study Description itSerie = ((*itStudy)->GetDicomDirSeries()).begin(); while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- "<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e) << std::endl; // Serie Description + std::cout << "--- --- "<< (*itSerie)->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description itImage = ((*itSerie)->GetDicomDirImages()).begin(); while (itImage != (*itSerie)->GetDicomDirImages().end() ) { // on degouline les SERIES de cette study - std::cout << "--- --- --- "<< (*itImage)->GetEntryByNumber(0x0004, 0x1500) << std::endl; // File name + std::cout << "--- --- --- "<< (*itImage)->GetEntry(0x0004, 0x1500) << std::endl; // File name ++itImage; } ++itSerie; diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 7b3160f5..33e9f7fa 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWriteSimple.cxx,v $ Language: C++ - Date: $Date: 2004/12/14 13:05:33 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/08 15:03:58 $ + 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 @@ -76,41 +76,41 @@ int WriteSimple(Image &img) // Set the image size str.str(""); str << img.sizeX; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0011); // Columns + header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns str.str(""); str << img.sizeY; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0010); // Rows + header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows if(img.sizeZ>1) { str.str(""); str << img.sizeZ; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0008); // Number of Frames + header->ReplaceOrCreate(str.str(),0x0028,0x0008); // Number of Frames } // Set the pixel type str.str(""); str << img.componentSize; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0100); // Bits Allocated + header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated str.str(""); str << img.componentUse; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0101); // Bits Stored + header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored str.str(""); str << img.componentSize - 1; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0102); // High Bit + header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit // Set the pixel representation str.str(""); str << img.sign; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0103); // Pixel Representation + header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation // Set the samples per pixel str.str(""); str << img.components; - header->ReplaceOrCreateByNumber(str.str(),0x0028,0x0002); // Samples per Pixel + header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel if( !header->IsReadable() ) { diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 2a19043b..1ef0feab 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 22:03:30 $ - Version: $Revision: 1.96 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.97 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -118,7 +118,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): else // Only if user passed a DICOMDIR { // Directory record sequence - DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220); + DocEntry *e = GetDocEntry(0x0004, 0x1220); if ( !e ) { gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)"); @@ -506,7 +506,7 @@ DicomDirPatient *DicomDir::NewPatient() { tmpGr = it->Group; tmpEl = it->Elem; - dictEntry = GetPubDict()->GetDictEntryByNumber(tmpGr, tmpEl); + dictEntry = GetPubDict()->GetDictEntry(tmpGr, tmpEl); entry = new ValEntry( dictEntry ); entry->SetOffset(0); // just to avoid further missprinting entry->SetValue( it->Value ); @@ -599,7 +599,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, { tmpGr = it->Group; tmpEl = it->Elem; - dictEntry = GetPubDict()->GetDictEntryByNumber(tmpGr, tmpEl); + dictEntry = GetPubDict()->GetDictEntry(tmpGr, tmpEl); entry = new ValEntry( dictEntry ); // Be sure it's never a BinEntry ! @@ -609,7 +609,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, { // NULL when we Build Up (ex nihilo) a DICOMDIR // or when we add the META elems - val = header->GetEntryByNumber(tmpGr, tmpEl); + val = header->GetEntry(tmpGr, tmpEl); } else { @@ -642,7 +642,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, } else { - if ( header->GetEntryLengthByNumber(tmpGr,tmpEl) == 0 ) + if ( header->GetEntryLength(tmpGr,tmpEl) == 0 ) val = it->Value; } @@ -715,7 +715,7 @@ void DicomDir::CreateDicomDir() // + loop to 1 - // Directory record sequence - DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220); + DocEntry *e = GetDocEntry(0x0004, 0x1220); if ( !e ) { gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)"); @@ -742,7 +742,7 @@ void DicomDir::CreateDicomDir() for( ListSQItem::iterator i = listItems.begin(); i !=listItems.end(); ++i ) { - d = (*i)->GetDocEntryByNumber(0x0004, 0x1430); // Directory Record Type + d = (*i)->GetDocEntry(0x0004, 0x1430); // Directory Record Type if ( ValEntry* valEntry = dynamic_cast(d) ) { v = valEntry->GetValue(); @@ -908,12 +908,12 @@ void DicomDir::SetElements(std::string const & path, VectDocument const &list) it != list.end(); ++it ) { // get the current file characteristics - patCurName = (*it)->GetEntryByNumber(0x0010,0x0010); - patCurID = (*it)->GetEntryByNumber(0x0010,0x0011); - studCurInstanceUID = (*it)->GetEntryByNumber(0x0020,0x000d); - studCurID = (*it)->GetEntryByNumber(0x0020,0x0010); - serCurInstanceUID = (*it)->GetEntryByNumber(0x0020,0x000e); - serCurID = (*it)->GetEntryByNumber(0x0020,0x0011); + patCurName = (*it)->GetEntry(0x0010,0x0010); + patCurID = (*it)->GetEntry(0x0010,0x0011); + studCurInstanceUID = (*it)->GetEntry(0x0020,0x000d); + studCurID = (*it)->GetEntry(0x0020,0x0010); + serCurInstanceUID = (*it)->GetEntry(0x0020,0x000e); + serCurID = (*it)->GetEntry(0x0020,0x0011); if( patCurName != patPrevName || patCurID != patPrevID || first ) { diff --git a/src/gdcmDicomDirObject.cxx b/src/gdcmDicomDirObject.cxx index ce17714b..edbd6a85 100644 --- a/src/gdcmDicomDirObject.cxx +++ b/src/gdcmDicomDirObject.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirObject.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:27 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/08 15:03:59 $ + 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 @@ -56,7 +56,7 @@ DicomDirObject::~DicomDirObject() * related to this 'object' * @return */ -TagDocEntryHT DicomDirObject::GetEntry() +TagDocEntryHT DicomDirObject::GetEntryHT() { TagDocEntryHT HT; DocEntries = GetDocEntries(); @@ -77,7 +77,7 @@ TagDocEntryHT DicomDirObject::GetEntry() */ void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList) { - // FillObject rempli le SQItem qui sera accroche au bon endroit + // FillObject fills up the SQItem that will be conneected to the right place ListDicomDirMetaElem::const_iterator it; uint16_t tmpGr,tmpEl; @@ -89,7 +89,7 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList) { tmpGr = it->Group; tmpEl = it->Elem; - dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetDictEntryByNumber(tmpGr,tmpEl); + dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetDictEntry(tmpGr,tmpEl); entry = new ValEntry(dictEntry); entry->SetOffset(0); // just to avoid further missprinting entry->SetValue(it->Value); diff --git a/src/gdcmDicomDirObject.h b/src/gdcmDicomDirObject.h index 92a2d7a1..e92aa3b8 100644 --- a/src/gdcmDicomDirObject.h +++ b/src/gdcmDicomDirObject.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirObject.h,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:27 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,7 +39,7 @@ class GDCM_EXPORT DicomDirObject : public SQItem { typedef std::list ListContent; public: - TagDocEntryHT GetEntry(); + TagDocEntryHT GetEntryHT(); void FillObject(ListDicomDirMetaElem const &elemList); protected: diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 4635bd22..34180075 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 22:03:30 $ - Version: $Revision: 1.60 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.61 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -89,16 +89,6 @@ Dict::~Dict() void Dict::Print(std::ostream &os) { os << "Dict file name : " << Filename << std::endl; - PrintByKey(os); -} - -/** - * \brief Print all the dictionary entries contained in this dictionary. - * Entries will be sorted by tag i.e. the couple (group, element). - * @param os The output stream to be written to. - */ -void Dict::PrintByKey(std::ostream &os) -{ std::ostringstream s; for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) @@ -114,6 +104,7 @@ void Dict::PrintByKey(std::ostream &os) os << s.str(); } + //----------------------------------------------------------------------------- // Public /** @@ -195,7 +186,7 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t elem) * @param elem element of the entry to be found * @return the corresponding dictionnary entry when existing, NULL otherwise */ -DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t elem) +DictEntry *Dict::GetDictEntry(uint16_t group, uint16_t elem) { TagKey key = DictEntry::TranslateToKey(group, elem); TagKeyHT::iterator it = KeyHt.find(key); diff --git a/src/gdcmDict.h b/src/gdcmDict.h index 7c01895f..60a33551 100644 --- a/src/gdcmDict.h +++ b/src/gdcmDict.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.h,v $ Language: C++ - Date: $Date: 2005/01/07 09:03:52 $ - Version: $Revision: 1.28 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.29 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,7 +54,6 @@ public: // Print void Print(std::ostream &os = std::cout); - void PrintByKey(std::ostream &os = std::cout); // Entries bool AddNewEntry (DictEntry const &newEntry); @@ -63,10 +62,10 @@ public: bool RemoveEntry (uint16_t group, uint16_t element); // Tag - DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element); + DictEntry *GetDictEntry(uint16_t group, uint16_t element); - EntryNamesList *GetDictEntryNames(); - EntryNamesByCatMap *GetDictEntryNamesByCategory(); + // EntryNamesList *GetDictEntryNames(); + // EntryNamesByCatMap *GetDictEntryNamesByCategory(); /// \brief Returns a ref to the Dicom Dictionary H table (map) /// @return the Dicom Dictionary H table diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 4f0e9ce2..14dea485 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 22:24:00 $ - Version: $Revision: 1.40 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.41 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -60,10 +60,10 @@ DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group,uint16_t elem, * @param elem element number of the new Entry * @param vr VR of the new Entry */ -ValEntry *DocEntrySet::NewValEntryByNumber(uint16_t group,uint16_t elem, - TagName const & vr) +ValEntry *DocEntrySet::NewValEntry(uint16_t group,uint16_t elem, + TagName const & vr) { - DictEntry *dictEntry = GetDictEntryByNumber(group, elem, vr); + DictEntry *dictEntry = GetDictEntry(group, elem, vr); gdcmAssertMacro(dictEntry); ValEntry *newEntry = new ValEntry(dictEntry); @@ -84,10 +84,10 @@ ValEntry *DocEntrySet::NewValEntryByNumber(uint16_t group,uint16_t elem, * @param elem element number of the new Entry * @param vr VR of the new Entry */ -BinEntry *DocEntrySet::NewBinEntryByNumber(uint16_t group,uint16_t elem, - TagName const & vr) +BinEntry *DocEntrySet::NewBinEntry(uint16_t group,uint16_t elem, + TagName const & vr) { - DictEntry *dictEntry = GetDictEntryByNumber(group, elem, vr); + DictEntry *dictEntry = GetDictEntry(group, elem, vr); gdcmAssertMacro(dictEntry); BinEntry *newEntry = new BinEntry(dictEntry); @@ -106,9 +106,9 @@ BinEntry *DocEntrySet::NewBinEntryByNumber(uint16_t group,uint16_t elem, * @param group group number of the new Entry * @param elem element number of the new Entry */ -SeqEntry* DocEntrySet::NewSeqEntryByNumber(uint16_t group,uint16_t elem) +SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group,uint16_t elem) { - DictEntry *dictEntry = GetDictEntryByNumber(group, elem, "SQ"); + DictEntry *dictEntry = GetDictEntry(group, elem, "SQ"); gdcmAssertMacro(dictEntry); SeqEntry *newEntry = new SeqEntry( dictEntry ); @@ -129,7 +129,7 @@ SeqEntry* DocEntrySet::NewSeqEntryByNumber(uint16_t group,uint16_t elem) * @param elem element number of the searched DictEntry * @return Corresponding DictEntry when it exists, NULL otherwise. */ -DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group,uint16_t elem) +DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem) { DictEntry *found = 0; Dict *pubDict = Global::GetDicts()->GetDefaultPubDict(); @@ -139,15 +139,15 @@ DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group,uint16_t elem) } else { - found = pubDict->GetDictEntryByNumber(group, elem); + found = pubDict->GetDictEntry(group, elem); } return found; } -DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group, uint16_t elem, +DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem, TagName const & vr) { - DictEntry *dictEntry = GetDictEntryByNumber(group,elem); + DictEntry *dictEntry = GetDictEntry(group,elem); DictEntry *goodEntry = dictEntry; std::string goodVR = vr; diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 108eec2e..88dac39b 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.h,v $ Language: C++ - Date: $Date: 2005/01/07 12:29:17 $ - Version: $Revision: 1.35 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.36 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -70,9 +70,9 @@ public: /// \brief write any type of entry to the entry set virtual void WriteContent (std::ofstream *fp, FileType filetype) = 0;// pure virtual - virtual DocEntry *GetDocEntryByNumber(uint16_t group, - uint16_t elem) = 0; - virtual std::string GetEntryByNumber(uint16_t group, uint16_t elem) = 0; + virtual DocEntry *GetDocEntry(uint16_t group, + uint16_t elem) = 0; + virtual std::string GetEntry(uint16_t group, uint16_t elem) = 0; DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element, @@ -83,16 +83,16 @@ public: protected: // DocEntry related utilities - ValEntry *NewValEntryByNumber(uint16_t group,uint16_t elem, - TagName const &vr = GDCM_UNKNOWN); - BinEntry *NewBinEntryByNumber(uint16_t group,uint16_t elem, - TagName const &vr = GDCM_UNKNOWN); - SeqEntry *NewSeqEntryByNumber(uint16_t group,uint16_t elem); + ValEntry *NewValEntry(uint16_t group,uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + BinEntry *NewBinEntry(uint16_t group,uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + SeqEntry *NewSeqEntry(uint16_t group,uint16_t elem); // DictEntry related utilities - DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem); - DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem, - TagName const &vr); + DictEntry *GetDictEntry(uint16_t group, uint16_t elem); + DictEntry *GetDictEntry(uint16_t group, uint16_t elem, + TagName const &vr); }; } // end namespace gdcm diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 13a92fe2..c2ea01aa 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/07 22:06:47 $ - Version: $Revision: 1.167 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.168 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -123,7 +123,7 @@ Document::Document( std::string const &filename ) : ElementSet(-1) // Load 'non string' values - std::string PhotometricInterpretation = GetEntryByNumber(0x0028,0x0004); + std::string PhotometricInterpretation = GetEntry(0x0028,0x0004); if( PhotometricInterpretation == "PALETTE COLOR " ) { LoadEntryBinArea(0x0028,0x1200); // gray LUT @@ -169,16 +169,16 @@ Document::Document( std::string const &filename ) : ElementSet(-1) // we switch lineNumber and columnNumber // std::string RecCode; - RecCode = GetEntryByNumber(0x0008, 0x0010); // recognition code + RecCode = GetEntry(0x0008, 0x0010); // recognition code if (RecCode == "ACRNEMA_LIBIDO_1.1" || RecCode == "CANRME_AILIBOD1_1." ) // for brain-damaged softwares // with "little-endian strings" { Filetype = ACR_LIBIDO; - std::string rows = GetEntryByNumber(0x0028, 0x0010); - std::string columns = GetEntryByNumber(0x0028, 0x0011); - SetEntryByNumber(columns, 0x0028, 0x0010); - SetEntryByNumber(rows , 0x0028, 0x0011); + std::string rows = GetEntry(0x0028, 0x0010); + std::string columns = GetEntry(0x0028, 0x0011); + SetEntry(columns, 0x0028, 0x0010); + SetEntry(rows , 0x0028, 0x0011); } // ----------------- End of ACR-LibIDO kludge ------------------ } @@ -303,7 +303,7 @@ bool Document::IsReadable() */ TransferSyntaxType Document::GetTransferSyntax() { - DocEntry *entry = GetDocEntryByNumber(0x0002, 0x0010); + DocEntry *entry = GetDocEntry(0x0002, 0x0010); if ( !entry ) { return UnknownTS; @@ -395,7 +395,7 @@ bool Document::IsDicomV3() // 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 !) - return GetDocEntryByNumber(0x0002, 0x0010) != NULL; + return GetDocEntry(0x0002, 0x0010) != NULL; } /** @@ -536,13 +536,13 @@ void Document::WriteContent(std::ofstream *fp, FileType filetype) * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, - uint16_t group, - uint16_t elem, - TagName const &vr ) +ValEntry *Document::ReplaceOrCreate(std::string const &value, + uint16_t group, + uint16_t elem, + TagName const &vr ) { ValEntry *valEntry = 0; - DocEntry *currentEntry = GetDocEntryByNumber( group, elem); + DocEntry *currentEntry = GetDocEntry( group, elem); if (currentEntry) { @@ -568,7 +568,7 @@ ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, // Create a new valEntry if necessary if (!valEntry) { - valEntry = NewValEntryByNumber(group, elem, vr); + valEntry = NewValEntry(group, elem, vr); if ( !AddEntry(valEntry)) { @@ -595,14 +595,14 @@ ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, - int lgth, - uint16_t group, - uint16_t elem, - TagName const &vr ) +BinEntry *Document::ReplaceOrCreate(uint8_t *binArea, + int lgth, + uint16_t group, + uint16_t elem, + TagName const &vr ) { BinEntry *binEntry = 0; - DocEntry *currentEntry = GetDocEntryByNumber( group, elem); + DocEntry *currentEntry = GetDocEntry( group, elem); // Verify the currentEntry if (currentEntry) @@ -629,7 +629,7 @@ BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, // Create a new binEntry if necessary if (!binEntry) { - binEntry = NewBinEntryByNumber(group, elem, vr); + binEntry = NewBinEntry(group, elem, vr); if ( !AddEntry(binEntry)) { @@ -670,10 +670,10 @@ BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, * \return pointer to the modified/created SeqEntry (NULL when creation * failed). */ -SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) +SeqEntry *Document::ReplaceOrCreate( uint16_t group, uint16_t elem) { SeqEntry *seqEntry = 0; - DocEntry *currentEntry = GetDocEntryByNumber( group, elem); + DocEntry *currentEntry = GetDocEntry( group, elem); // Verify the currentEntry if (currentEntry) @@ -700,7 +700,7 @@ SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) // Create a new seqEntry if necessary if (!seqEntry) { - seqEntry = NewSeqEntryByNumber(group, elem); + seqEntry = NewSeqEntry(group, elem); if ( !AddEntry(seqEntry)) { @@ -722,10 +722,10 @@ SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) * @param elem element number of the Entry * \return boolean */ -bool Document::ReplaceIfExistByNumber(std::string const &value, - uint16_t group, uint16_t elem ) +bool Document::ReplaceIfExist(std::string const &value, + uint16_t group, uint16_t elem ) { - SetEntryByNumber(value, group, elem); + SetEntry(value, group, elem); return true; } @@ -744,7 +744,7 @@ std::string Document::GetTransferSyntaxValue(TransferSyntaxType type) * @param element Element number of the searched Dicom Element * @return true is found */ -bool Document::CheckIfEntryExistByNumber(uint16_t group, uint16_t element ) +bool Document::CheckIfEntryExist(uint16_t group, uint16_t element ) { const std::string &key = DictEntry::TranslateToKey(group, element ); return TagHT.count(key) != 0; @@ -760,7 +760,7 @@ bool Document::CheckIfEntryExistByNumber(uint16_t group, uint16_t element ) * @return Corresponding element value representation when it exists, * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise. */ -std::string Document::GetEntryByNumber(uint16_t group, uint16_t element) +std::string Document::GetEntry(uint16_t group, uint16_t element) { TagKey key = DictEntry::TranslateToKey(group, element); if ( !TagHT.count(key)) @@ -785,9 +785,9 @@ std::string Document::GetEntryByNumber(uint16_t group, uint16_t element) * @return Corresponding element value representation when it exists, * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise. */ -std::string Document::GetEntryVRByNumber(uint16_t group, uint16_t element) +std::string Document::GetEntryVR(uint16_t group, uint16_t element) { - DocEntry *elem = GetDocEntryByNumber(group, element); + DocEntry *elem = GetDocEntry(group, element); if ( !elem ) { return GDCM_UNFOUND; @@ -803,9 +803,9 @@ std::string Document::GetEntryVRByNumber(uint16_t group, uint16_t element) * @param element Element number of the searched tag. * @return Corresponding element length; -2 if not found */ -int Document::GetEntryLengthByNumber(uint16_t group, uint16_t element) +int Document::GetEntryLength(uint16_t group, uint16_t element) { - DocEntry *elem = GetDocEntryByNumber(group, element); + DocEntry *elem = GetDocEntry(group, element); if ( !elem ) { return -2; //magic number @@ -821,10 +821,10 @@ int Document::GetEntryLengthByNumber(uint16_t group, uint16_t element) * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool Document::SetEntryByNumber(std::string const& content, - uint16_t group, uint16_t element) +bool Document::SetEntry(std::string const& content, + uint16_t group, uint16_t element) { - ValEntry *entry = GetValEntryByNumber(group, element); + ValEntry *entry = GetValEntry(group, element); if (!entry ) { gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); @@ -842,10 +842,10 @@ bool Document::SetEntryByNumber(std::string const& content, * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool Document::SetEntryByNumber(uint8_t*content, int lgth, - uint16_t group, uint16_t element) +bool Document::SetEntry(uint8_t*content, int lgth, + uint16_t group, uint16_t element) { - BinEntry *entry = GetBinEntryByNumber(group, element); + BinEntry *entry = GetBinEntry(group, element); if (!entry ) { gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); @@ -904,9 +904,9 @@ bool Document::SetEntry(uint8_t *content, int lgth, BinEntry *entry) * @param elem element number of the Entry * @return Pointer to the 'non string' area */ -void *Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) +void *Document::GetEntryBinArea(uint16_t group, uint16_t elem) { - DocEntry *entry = GetDocEntryByNumber(group, elem); + DocEntry *entry = GetDocEntry(group, elem); if (!entry) { gdcmVerboseMacro( "No entry"); @@ -929,7 +929,7 @@ void *Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) void Document::LoadEntryBinArea(uint16_t group, uint16_t elem) { // Search the corresponding DocEntry - DocEntry *docElement = GetDocEntryByNumber(group, elem); + DocEntry *docElement = GetDocEntry(group, elem); if ( !docElement ) return; @@ -986,10 +986,10 @@ void Document::LoadEntryBinArea(BinEntry *element) * @param element Element number of the searched Dicom Element * @return */ -/*bool Document::SetEntryBinAreaByNumber(uint8_t *area, - uint16_t group, uint16_t element) +/*bool Document::SetEntryBinArea(uint8_t *area, + uint16_t group, uint16_t element) { - DocEntry *currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntry(group, element); if ( !currentEntry ) { return false; @@ -1014,7 +1014,7 @@ void Document::LoadEntryBinArea(BinEntry *element) * @param element Element number of the searched Dicom Element * @return */ -DocEntry *Document::GetDocEntryByNumber(uint16_t group, uint16_t element) +DocEntry *Document::GetDocEntry(uint16_t group, uint16_t element) { TagKey key = DictEntry::TranslateToKey(group, element); if ( !TagHT.count(key)) @@ -1025,14 +1025,14 @@ DocEntry *Document::GetDocEntryByNumber(uint16_t group, uint16_t element) } /** - * \brief Same as \ref Document::GetDocEntryByNumber except it only + * \brief Same as \ref Document::GetDocEntry except it only * returns a result when the corresponding entry is of type * ValEntry. * @return When present, the corresponding ValEntry. */ -ValEntry *Document::GetValEntryByNumber(uint16_t group, uint16_t element) +ValEntry *Document::GetValEntry(uint16_t group, uint16_t element) { - DocEntry *currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntry(group, element); if ( !currentEntry ) { return 0; @@ -1047,14 +1047,14 @@ ValEntry *Document::GetValEntryByNumber(uint16_t group, uint16_t element) } /** - * \brief Same as \ref Document::GetDocEntryByNumber except it only + * \brief Same as \ref Document::GetDocEntry except it only * returns a result when the corresponding entry is of type * BinEntry. * @return When present, the corresponding BinEntry. */ -BinEntry *Document::GetBinEntryByNumber(uint16_t group, uint16_t element) +BinEntry *Document::GetBinEntry(uint16_t group, uint16_t element) { - DocEntry *currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntry(group, element); if ( !currentEntry ) { return 0; @@ -1675,7 +1675,7 @@ void Document::FindDocEntryLength( DocEntry *entry ) // and the dictionary entry depending on them. uint16_t correctGroup = SwapShort( entry->GetGroup() ); uint16_t correctElem = SwapShort( entry->GetElement() ); - DictEntry *newTag = GetDictEntryByNumber( correctGroup, + DictEntry *newTag = GetDictEntry( correctGroup, correctElem ); if ( !newTag ) { @@ -2476,18 +2476,18 @@ DocEntry *Document::ReadNextDocEntry() if( vr == GDCM_UNKNOWN) { - DictEntry *dictEntry = GetDictEntryByNumber(group,elem); + DictEntry *dictEntry = GetDictEntry(group,elem); if( dictEntry ) realVR = dictEntry->GetVR(); } DocEntry *newEntry; if( Global::GetVR()->IsVROfSequence(realVR) ) - newEntry = NewSeqEntryByNumber(group, elem); + newEntry = NewSeqEntry(group, elem); else if( Global::GetVR()->IsVROfStringRepresentable(realVR) ) - newEntry = NewValEntryByNumber(group, elem,vr); + newEntry = NewValEntry(group, elem,vr); else - newEntry = NewBinEntryByNumber(group, elem,vr); + newEntry = NewBinEntry(group, elem,vr); if( vr == GDCM_UNKNOWN ) { @@ -2896,8 +2896,8 @@ TagDocEntryHT *Document::BuildFlatHashTable() bool Document::operator<(Document &document) { // Patient Name - std::string s1 = GetEntryByNumber(0x0010,0x0010); - std::string s2 = document.GetEntryByNumber(0x0010,0x0010); + std::string s1 = GetEntry(0x0010,0x0010); + std::string s2 = document.GetEntry(0x0010,0x0010); if(s1 < s2) { return true; @@ -2909,8 +2909,8 @@ bool Document::operator<(Document &document) else { // Patient ID - s1 = GetEntryByNumber(0x0010,0x0020); - s2 = document.GetEntryByNumber(0x0010,0x0020); + s1 = GetEntry(0x0010,0x0020); + s2 = document.GetEntry(0x0010,0x0020); if ( s1 < s2 ) { return true; @@ -2922,8 +2922,8 @@ bool Document::operator<(Document &document) else { // Study Instance UID - s1 = GetEntryByNumber(0x0020,0x000d); - s2 = document.GetEntryByNumber(0x0020,0x000d); + s1 = GetEntry(0x0020,0x000d); + s2 = document.GetEntry(0x0020,0x000d); if ( s1 < s2 ) { return true; @@ -2935,8 +2935,8 @@ bool Document::operator<(Document &document) else { // Serie Instance UID - s1 = GetEntryByNumber(0x0020,0x000e); - s2 = document.GetEntryByNumber(0x0020,0x000e); + s1 = GetEntry(0x0020,0x000e); + s2 = document.GetEntry(0x0020,0x000e); if ( s1 < s2 ) { return true; diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 1c844795..dbef76f4 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/07 16:45:51 $ - Version: $Revision: 1.77 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.78 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -111,33 +111,33 @@ public: // Content entries - virtual bool SetEntryByNumber(std::string const &content, - uint16_t group, uint16_t element); - virtual bool SetEntryByNumber(uint8_t *content, int lgth, - uint16_t group, uint16_t element); + virtual bool SetEntry(std::string const &content, + uint16_t group, uint16_t element); + virtual bool SetEntry(uint8_t *content, int lgth, + uint16_t group, uint16_t element); virtual bool SetEntry(std::string const &content,ValEntry *entry); virtual bool SetEntry(uint8_t *content, int lgth,BinEntry *entry); - virtual void *GetEntryBinAreaByNumber(uint16_t group, uint16_t elem); + virtual void *GetEntryBinArea(uint16_t group, uint16_t elem); - virtual std::string GetEntryByNumber (uint16_t group, uint16_t elem); - virtual std::string GetEntryVRByNumber(uint16_t group, uint16_t elem); - virtual int GetEntryLengthByNumber(uint16_t group, uint16_t elem); + virtual std::string GetEntry (uint16_t group, uint16_t elem); + virtual std::string GetEntryVR(uint16_t group, uint16_t elem); + virtual int GetEntryLength(uint16_t group, uint16_t elem); - DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element); - ValEntry *GetValEntryByNumber(uint16_t group, uint16_t element); - BinEntry *GetBinEntryByNumber(uint16_t group, uint16_t element); + DocEntry *GetDocEntry(uint16_t group, uint16_t element); + ValEntry *GetValEntry(uint16_t group, uint16_t element); + BinEntry *GetBinEntry(uint16_t group, uint16_t element); - ValEntry *ReplaceOrCreateByNumber(std::string const &value, - uint16_t group, uint16_t elem, - TagName const &vr = GDCM_UNKNOWN); - BinEntry *ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, - uint16_t group, uint16_t elem, - TagName const &vr = GDCM_UNKNOWN); - SeqEntry *ReplaceOrCreateByNumber(uint16_t group, uint16_t elem); + ValEntry *ReplaceOrCreate(std::string const &value, + uint16_t group, uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + BinEntry *ReplaceOrCreate(uint8_t* binArea, int lgth, + uint16_t group, uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + SeqEntry *ReplaceOrCreate(uint16_t group, uint16_t elem); - bool ReplaceIfExistByNumber ( std::string const &value, - uint16_t group, uint16_t elem ); + bool ReplaceIfExist ( std::string const &value, + uint16_t group, uint16_t elem ); virtual void LoadEntryBinArea(uint16_t group, uint16_t elem); virtual void LoadEntryBinArea(BinEntry *entry); @@ -161,7 +161,7 @@ protected: void ComputeRLEInfo(); void ComputeJPEGFragmentInfo(); // Entry - bool CheckIfEntryExistByNumber(uint16_t group, uint16_t elem ); + bool CheckIfEntryExist(uint16_t group, uint16_t elem ); int ComputeGroup0002Length( FileType filetype ); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 9be54a01..96fe85f4 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/07 22:03:30 $ - Version: $Revision: 1.186 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.187 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -530,10 +530,10 @@ bool File::Write(std::string const &fileName) * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool File::SetEntryByNumber(std::string const &content, - uint16_t group, uint16_t element) +bool File::SetEntry(std::string const &content, + uint16_t group, uint16_t element) { - return HeaderInternal->SetEntryByNumber(content,group,element); + return HeaderInternal->SetEntry(content,group,element); } @@ -546,10 +546,10 @@ bool File::SetEntryByNumber(std::string const &content, * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool File::SetEntryByNumber(uint8_t *content, int lgth, - uint16_t group, uint16_t element) +bool File::SetEntry(uint8_t *content, int lgth, + uint16_t group, uint16_t element) { - return HeaderInternal->SetEntryByNumber(content,lgth,group,element); + return HeaderInternal->SetEntry(content,lgth,group,element); } /** @@ -561,10 +561,10 @@ bool File::SetEntryByNumber(uint8_t *content, int lgth, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreateByNumber(std::string const &content, - uint16_t group, uint16_t element) +bool File::ReplaceOrCreate(std::string const &content, + uint16_t group, uint16_t element) { - return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL; + return HeaderInternal->ReplaceOrCreate(content,group,element) != NULL; } /* @@ -577,10 +577,10 @@ bool File::ReplaceOrCreateByNumber(std::string const &content, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreateByNumber(uint8_t *binArea, int lgth, - uint16_t group, uint16_t element) +bool File::ReplaceOrCreate(uint8_t *binArea, int lgth, + uint16_t group, uint16_t element) { - return HeaderInternal->ReplaceOrCreateByNumber(binArea,lgth,group,element) != NULL; + return HeaderInternal->ReplaceOrCreate(binArea,lgth,group,element) != NULL; } /** @@ -801,9 +801,9 @@ void File::RestoreWriteFileType() void File::SetWriteToLibido() { ValEntry *oldRow = dynamic_cast - (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0010)); + (HeaderInternal->GetDocEntry(0x0028, 0x0010)); ValEntry *oldCol = dynamic_cast - (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0011)); + (HeaderInternal->GetDocEntry(0x0028, 0x0011)); if( oldRow && oldCol ) { @@ -830,7 +830,7 @@ void File::SetWriteToLibido() void File::SetWriteToNoLibido() { ValEntry *recCode = dynamic_cast - (HeaderInternal->GetDocEntryByNumber(0x0008,0x0010)); + (HeaderInternal->GetDocEntry(0x0008,0x0010)); if( recCode ) { if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" ) @@ -851,7 +851,7 @@ void File::RestoreWriteOfLibido() ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) { - DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element); + DocEntry *oldE = HeaderInternal->GetDocEntry(group, element); ValEntry *newE; if(oldE) @@ -861,7 +861,7 @@ ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) } else { - newE = GetHeader()->NewValEntryByNumber(group,element); + newE = GetHeader()->NewValEntry(group,element); } return(newE); @@ -869,7 +869,7 @@ ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element) { - DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element); + DocEntry *oldE = HeaderInternal->GetDocEntry(group, element); BinEntry *newE; if(oldE) @@ -879,7 +879,7 @@ BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element) } else { - newE = GetHeader()->NewBinEntryByNumber(group,element); + newE = GetHeader()->NewBinEntry(group,element); } return(newE); diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 0f75b016..da097692 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:27 $ - Version: $Revision: 1.91 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.92 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -86,14 +86,14 @@ public: bool WriteAcr (std::string const &fileName); bool Write (std::string const &fileName); - bool SetEntryByNumber(std::string const &content, - uint16_t group, uint16_t element); - bool SetEntryByNumber(uint8_t *content, int lgth, - uint16_t group, uint16_t element); - bool ReplaceOrCreateByNumber(std::string const &content, - uint16_t group, uint16_t element); - bool ReplaceOrCreateByNumber(uint8_t *binArea, int lgth, - uint16_t group, uint16_t element); + bool SetEntry(std::string const &content, + uint16_t group, uint16_t element); + bool SetEntry(uint8_t *content, int lgth, + uint16_t group, uint16_t element); + bool ReplaceOrCreate(std::string const &content, + uint16_t group, uint16_t element); + bool ReplaceOrCreate(uint8_t *binArea, int lgth, + uint16_t group, uint16_t element); uint8_t* GetLutRGBA(); diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 8773fdd5..e5e2511f 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/07 22:19:48 $ - Version: $Revision: 1.226 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.227 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,7 +48,7 @@ Header::Header( std::string const &filename ): // Note: this IS the right place for the code // Image Location - const std::string &imgLocation = GetEntryByNumber(0x0028, 0x0200); + const std::string &imgLocation = GetEntry(0x0028, 0x0200); if ( imgLocation == GDCM_UNFOUND ) { // default value @@ -81,7 +81,7 @@ Header::Header( std::string const &filename ): // Let's create a VirtualDictEntry to allow a further VR modification // and force VR to match with BitsAllocated. - DocEntry *entry = GetDocEntryByNumber(GrPixel, NumPixel); + DocEntry *entry = GetDocEntry(GrPixel, NumPixel); if ( entry != 0 ) { @@ -136,20 +136,20 @@ bool Header::Write(std::string fileName, FileType filetype) } // Bits Allocated - if ( GetEntryByNumber(0x0028,0x0100) == "12") + if ( GetEntry(0x0028,0x0100) == "12") { - SetEntryByNumber("16", 0x0028,0x0100); + SetEntry("16", 0x0028,0x0100); } /// \todo correct 'Pixel group' Length if necessary - int i_lgPix = GetEntryLengthByNumber(GrPixel, NumPixel); + int i_lgPix = GetEntryLength(GrPixel, NumPixel); if (i_lgPix != -2) { // no (GrPixel, NumPixel) element std::string s_lgPix = Util::Format("%d", i_lgPix+12); s_lgPix = Util::DicomString( s_lgPix.c_str() ); - ReplaceOrCreateByNumber(s_lgPix,GrPixel, 0x0000); + ReplaceOrCreate(s_lgPix,GrPixel, 0x0000); } // FIXME : should be nice if we could move it to File @@ -157,38 +157,38 @@ bool Header::Write(std::string fileName, FileType filetype) // Drop Palette Color, if necessary - if ( GetEntryByNumber(0x0028,0x0002).c_str()[0] == '3' ) + if ( GetEntry(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 - DocEntry *e = GetDocEntryByNumber(0x0028,0x01101); + DocEntry *e = GetDocEntry(0x0028,0x01101); if (e) { RemoveEntryNoDestroy(e); } - e = GetDocEntryByNumber(0x0028,0x1102); + e = GetDocEntry(0x0028,0x1102); if (e) { RemoveEntryNoDestroy(e); } - e = GetDocEntryByNumber(0x0028,0x1103); + e = GetDocEntry(0x0028,0x1103); if (e) { RemoveEntryNoDestroy(e); } - e = GetDocEntryByNumber(0x0028,0x01201); + e = GetDocEntry(0x0028,0x01201); if (e) { RemoveEntryNoDestroy(e); } - e = GetDocEntryByNumber(0x0028,0x1202); + e = GetDocEntry(0x0028,0x1202); if (e) { RemoveEntryNoDestroy(e); } - e = GetDocEntryByNumber(0x0028,0x1203); + e = GetDocEntry(0x0028,0x1203); if (e) { RemoveEntryNoDestroy(e); @@ -224,24 +224,24 @@ bool Header::IsReadable() return false; } - const std::string &res = GetEntryByNumber(0x0028, 0x0005); + const std::string &res = GetEntry(0x0028, 0x0005); if ( res != GDCM_UNFOUND && atoi(res.c_str()) > 4 ) { return false; // Image Dimensions } - if ( !GetDocEntryByNumber(0x0028, 0x0100) ) + if ( !GetDocEntry(0x0028, 0x0100) ) { return false; // "Bits Allocated" } - if ( !GetDocEntryByNumber(0x0028, 0x0101) ) + if ( !GetDocEntry(0x0028, 0x0101) ) { return false; // "Bits Stored" } - if ( !GetDocEntryByNumber(0x0028, 0x0102) ) + if ( !GetDocEntry(0x0028, 0x0102) ) { return false; // "High Bit" } - if ( !GetDocEntryByNumber(0x0028, 0x0103) ) + if ( !GetDocEntry(0x0028, 0x0103) ) { return false; // "Pixel Representation" i.e. 'Sign' } @@ -256,7 +256,7 @@ bool Header::IsReadable() */ int Header::GetXSize() { - const std::string &strSize = GetEntryByNumber(0x0028,0x0011); + const std::string &strSize = GetEntry(0x0028,0x0011); if ( strSize == GDCM_UNFOUND ) { return 0; @@ -273,7 +273,7 @@ int Header::GetXSize() */ int Header::GetYSize() { - const std::string &strSize = GetEntryByNumber(0x0028,0x0010); + const std::string &strSize = GetEntry(0x0028,0x0010); if ( strSize != GDCM_UNFOUND ) { return atoi( strSize.c_str() ); @@ -300,14 +300,14 @@ int Header::GetZSize() { // Both DicomV3 and ACR/Nema consider the "Number of Frames" // as the third dimension. - const std::string &strSize = GetEntryByNumber(0x0028,0x0008); + const std::string &strSize = GetEntry(0x0028,0x0008); if ( strSize != GDCM_UNFOUND ) { return atoi( strSize.c_str() ); } // We then consider the "Planes" entry as the third dimension - const std::string &strSize2 = GetEntryByNumber(0x0028,0x0012); + const std::string &strSize2 = GetEntry(0x0028,0x0012); if ( strSize2 != GDCM_UNFOUND ) { return atoi( strSize2.c_str() ); @@ -324,7 +324,7 @@ int Header::GetZSize() float Header::GetXSpacing() { float xspacing, yspacing; - const std::string &strSpacing = GetEntryByNumber(0x0028,0x0030); + const std::string &strSpacing = GetEntry(0x0028,0x0030); if ( strSpacing == GDCM_UNFOUND ) { @@ -372,7 +372,7 @@ float Header::GetXSpacing() float Header::GetYSpacing() { float yspacing = 1.; - std::string strSpacing = GetEntryByNumber(0x0028,0x0030); + std::string strSpacing = GetEntry(0x0028,0x0030); if ( strSpacing == GDCM_UNFOUND ) { @@ -407,12 +407,12 @@ float Header::GetZSpacing() // Si le Spacing Between Slices est absent, // on suppose que les coupes sont jointives - const std::string &strSpacingBSlices = GetEntryByNumber(0x0018,0x0088); + const std::string &strSpacingBSlices = GetEntry(0x0018,0x0088); if ( strSpacingBSlices == GDCM_UNFOUND ) { gdcmVerboseMacro("Unfound StrSpacingBSlices"); - const std::string &strSliceThickness = GetEntryByNumber(0x0018,0x0050); + const std::string &strSliceThickness = GetEntry(0x0018,0x0050); if ( strSliceThickness == GDCM_UNFOUND ) { return 1.; @@ -438,7 +438,7 @@ float Header::GetRescaleIntercept() { float resInter = 0.; /// 0028 1052 DS IMG Rescale Intercept - const std::string &strRescInter = GetEntryByNumber(0x0028,0x1052); + const std::string &strRescInter = GetEntry(0x0028,0x1052); if ( strRescInter != GDCM_UNFOUND ) { if( sscanf( strRescInter.c_str(), "%f", &resInter) != 1 ) @@ -459,7 +459,7 @@ float Header::GetRescaleSlope() { float resSlope = 1.; //0028 1053 DS IMG Rescale Slope - std::string strRescSlope = GetEntryByNumber(0x0028,0x1053); + std::string strRescSlope = GetEntry(0x0028,0x1053); if ( strRescSlope != GDCM_UNFOUND ) { if( sscanf( strRescSlope.c_str(), "%f", &resSlope) != 1) @@ -488,12 +488,12 @@ int Header::GetNumberOfScalarComponents() // 0028 0100 US IMG Bits Allocated // (in order no to be messed up by old RGB images) - if ( GetEntryByNumber(0x0028,0x0100) == "24" ) + if ( GetEntry(0x0028,0x0100) == "24" ) { return 3; } - std::string strPhotometricInterpretation = GetEntryByNumber(0x0028,0x0004); + std::string strPhotometricInterpretation = GetEntry(0x0028,0x0004); if ( ( strPhotometricInterpretation == "PALETTE COLOR ") ) { @@ -533,7 +533,7 @@ int Header::GetNumberOfScalarComponentsRaw() { // 0028 0100 US IMG Bits Allocated // (in order no to be messed up by old RGB images) - if ( Header::GetEntryByNumber(0x0028,0x0100) == "24" ) + if ( Header::GetEntry(0x0028,0x0100) == "24" ) { return 3; } @@ -567,12 +567,12 @@ int Header::GetNumberOfScalarComponentsRaw() float Header::GetXOrigin() { float xImPos, yImPos, zImPos; - std::string strImPos = GetEntryByNumber(0x0020,0x0032); + std::string strImPos = GetEntry(0x0020,0x0032); if ( strImPos == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)"); - strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images + strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images if ( strImPos == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); @@ -598,12 +598,12 @@ float Header::GetXOrigin() float Header::GetYOrigin() { float xImPos, yImPos, zImPos; - std::string strImPos = GetEntryByNumber(0x0020,0x0032); + std::string strImPos = GetEntry(0x0020,0x0032); if ( strImPos == GDCM_UNFOUND) { gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)"); - strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images + strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images if ( strImPos == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); @@ -631,7 +631,7 @@ float Header::GetYOrigin() float Header::GetZOrigin() { float xImPos, yImPos, zImPos; - std::string strImPos = GetEntryByNumber(0x0020,0x0032); + std::string strImPos = GetEntry(0x0020,0x0032); if ( strImPos != GDCM_UNFOUND ) { @@ -646,7 +646,7 @@ float Header::GetZOrigin() } } - strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images + strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images if ( strImPos != GDCM_UNFOUND ) { if( sscanf( strImPos.c_str(), @@ -661,7 +661,7 @@ float Header::GetZOrigin() } } - std::string strSliceLocation = GetEntryByNumber(0x0020,0x1041); // for *very* old ACR-NEMA images + std::string strSliceLocation = GetEntry(0x0020,0x1041); // for *very* old ACR-NEMA images if ( strSliceLocation != GDCM_UNFOUND ) { if( sscanf( strSliceLocation.c_str(), "%f", &zImPos) != 1) @@ -676,7 +676,7 @@ float Header::GetZOrigin() } gdcmVerboseMacro( "Unfound Slice Location (0020,1041)"); - std::string strLocation = GetEntryByNumber(0x0020,0x0050); + std::string strLocation = GetEntry(0x0020,0x0050); if ( strLocation != GDCM_UNFOUND ) { if( sscanf( strLocation.c_str(), "%f", &zImPos) != 1) @@ -707,7 +707,7 @@ int Header::GetImageNumber() // faster function. sscanf() can do all possible conversions whereas // atoi() can only do single decimal integer conversions. //0020 0013 IS REL Image Number - std::string strImNumber = GetEntryByNumber(0x0020,0x0013); + std::string strImNumber = GetEntry(0x0020,0x0013); if ( strImNumber != GDCM_UNFOUND ) { return atoi( strImNumber.c_str() ); @@ -722,7 +722,7 @@ int Header::GetImageNumber() ModalityType Header::GetModality() { // 0008 0060 CS ID Modality - std::string strModality = GetEntryByNumber(0x0008,0x0060); + std::string strModality = GetEntry(0x0008,0x0060); if ( strModality != GDCM_UNFOUND ) { if ( strModality.find("AU") < strModality.length()) return AU; @@ -785,7 +785,7 @@ ModalityType Header::GetModality() */ int Header::GetBitsStored() { - std::string strSize = GetEntryByNumber( 0x0028, 0x0101 ); + std::string strSize = GetEntry( 0x0028, 0x0101 ); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro("This is supposed to be mandatory"); @@ -803,7 +803,7 @@ int Header::GetBitsStored() */ int Header::GetHighBitPosition() { - std::string strSize = GetEntryByNumber( 0x0028, 0x0102 ); + std::string strSize = GetEntry( 0x0028, 0x0102 ); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "This is supposed to be mandatory"); @@ -820,7 +820,7 @@ int Header::GetHighBitPosition() */ bool Header::IsSignedPixelData() { - std::string strSize = GetEntryByNumber( 0x0028, 0x0103 ); + std::string strSize = GetEntry( 0x0028, 0x0103 ); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "This is supposed to be mandatory"); @@ -842,7 +842,7 @@ bool Header::IsSignedPixelData() */ int Header::GetBitsAllocated() { - std::string strSize = GetEntryByNumber(0x0028,0x0100); + std::string strSize = GetEntry(0x0028,0x0100); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "This is supposed to be mandatory"); @@ -860,7 +860,7 @@ int Header::GetBitsAllocated() */ int Header::GetSamplesPerPixel() { - const std::string& strSize = GetEntryByNumber(0x0028,0x0002); + const std::string& strSize = GetEntry(0x0028,0x0002); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "This is supposed to be mandatory"); @@ -877,7 +877,7 @@ int Header::GetSamplesPerPixel() */ bool Header::IsMonochrome() { - const std::string& PhotometricInterp = GetEntryByNumber( 0x0028, 0x0004 ); + const std::string& PhotometricInterp = GetEntry( 0x0028, 0x0004 ); if ( Util::DicomStringEqual(PhotometricInterp, "MONOCHROME1") || Util::DicomStringEqual(PhotometricInterp, "MONOCHROME2") ) { @@ -897,7 +897,7 @@ bool Header::IsMonochrome() */ bool Header::IsPaletteColor() { - std::string PhotometricInterp = GetEntryByNumber( 0x0028, 0x0004 ); + std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 ); if ( PhotometricInterp == "PALETTE COLOR " ) { return true; @@ -916,7 +916,7 @@ bool Header::IsPaletteColor() */ bool Header::IsYBRFull() { - std::string PhotometricInterp = GetEntryByNumber( 0x0028, 0x0004 ); + std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 ); if ( PhotometricInterp == "YBR_FULL" ) { return true; @@ -935,7 +935,7 @@ bool Header::IsYBRFull() */ int Header::GetPlanarConfiguration() { - std::string strSize = GetEntryByNumber(0x0028,0x0006); + std::string strSize = GetEntry(0x0028,0x0006); if ( strSize == GDCM_UNFOUND ) { gdcmVerboseMacro( "Absent Planar Configuration"); @@ -953,7 +953,7 @@ int Header::GetPixelSize() { // 0028 0100 US IMG Bits Allocated // (in order no to be messed up by old RGB images) - // if (Header::GetEntryByNumber(0x0028,0x0100) == "24") + // if (Header::GetEntry(0x0028,0x0100) == "24") // return 3; std::string pixelType = GetPixelType(); @@ -993,7 +993,7 @@ int Header::GetPixelSize() */ std::string Header::GetPixelType() { - std::string bitsAlloc = GetEntryByNumber(0x0028, 0x0100); // Bits Allocated + std::string bitsAlloc = GetEntry(0x0028, 0x0100); // Bits Allocated if ( bitsAlloc == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Bits Allocated"); @@ -1015,7 +1015,7 @@ std::string Header::GetPixelType() bitsAlloc = "8"; // by old RGB images) } - std::string sign = GetEntryByNumber(0x0028, 0x0103);//"Pixel Representation" + std::string sign = GetEntry(0x0028, 0x0103);//"Pixel Representation" if (sign == GDCM_UNFOUND ) { @@ -1041,7 +1041,7 @@ std::string Header::GetPixelType() */ size_t Header::GetPixelOffset() { - DocEntry* pxlElement = GetDocEntryByNumber(GrPixel,NumPixel); + DocEntry* pxlElement = GetDocEntry(GrPixel,NumPixel); if ( pxlElement ) { return pxlElement->GetOffset(); @@ -1067,7 +1067,7 @@ size_t Header::GetPixelOffset() */ size_t Header::GetPixelAreaLength() { - DocEntry* pxlElement = GetDocEntryByNumber(GrPixel,NumPixel); + DocEntry* pxlElement = GetDocEntry(GrPixel,NumPixel); if ( pxlElement ) { return pxlElement->GetLength(); @@ -1095,32 +1095,32 @@ bool Header::HasLUT() { // Check the presence of the LUT Descriptors, and LUT Tables // LutDescriptorRed - if ( !GetDocEntryByNumber(0x0028,0x1101) ) + if ( !GetDocEntry(0x0028,0x1101) ) { return false; } // LutDescriptorGreen - if ( !GetDocEntryByNumber(0x0028,0x1102) ) + if ( !GetDocEntry(0x0028,0x1102) ) { return false; } // LutDescriptorBlue - if ( !GetDocEntryByNumber(0x0028,0x1103) ) + if ( !GetDocEntry(0x0028,0x1103) ) { return false; } // Red Palette Color Lookup Table Data - if ( !GetDocEntryByNumber(0x0028,0x1201) ) + if ( !GetDocEntry(0x0028,0x1201) ) { return false; } // Green Palette Color Lookup Table Data - if ( !GetDocEntryByNumber(0x0028,0x1202) ) + if ( !GetDocEntry(0x0028,0x1202) ) { return false; } // Blue Palette Color Lookup Table Data - if ( !GetDocEntryByNumber(0x0028,0x1203) ) + if ( !GetDocEntry(0x0028,0x1203) ) { return false; } @@ -1145,7 +1145,7 @@ int Header::GetLUTNbits() //Just hope Lookup Table Desc-Red = Lookup Table Desc-Red // = Lookup Table Desc-Blue // Consistency already checked in GetLUTLength - std::string lutDescription = GetEntryByNumber(0x0028,0x1101); + std::string lutDescription = GetEntry(0x0028,0x1101); if ( lutDescription == GDCM_UNFOUND ) { return 0; @@ -1170,7 +1170,7 @@ int Header::GetLUTNbits() std::string Header::GetTransfertSyntaxName() { // use the TS (TS : Transfert Syntax) - std::string transfertSyntax = GetEntryByNumber(0x0002,0x0010); + std::string transfertSyntax = GetEntry(0x0002,0x0010); if ( transfertSyntax == GDCM_NOTLOADED ) { @@ -1206,22 +1206,22 @@ std::string Header::GetTransfertSyntaxName() bool Header::AnonymizeHeader() { // If exist, replace by spaces - SetEntryByNumber (" ",0x0010, 0x2154); // Telephone - SetEntryByNumber (" ",0x0010, 0x1040); // Adress - SetEntryByNumber (" ",0x0010, 0x0020); // Patient ID + SetEntry (" ",0x0010, 0x2154); // Telephone + SetEntry (" ",0x0010, 0x1040); // Adress + SetEntry (" ",0x0010, 0x0020); // Patient ID - DocEntry* patientNameHE = GetDocEntryByNumber (0x0010, 0x0010); + DocEntry* patientNameHE = GetDocEntry (0x0010, 0x0010); if ( patientNameHE ) // we replace it by Study Instance UID (why not) { - std::string studyInstanceUID = GetEntryByNumber (0x0020, 0x000d); + std::string studyInstanceUID = GetEntry (0x0020, 0x000d); if ( studyInstanceUID != GDCM_UNFOUND ) { - ReplaceOrCreateByNumber(studyInstanceUID, 0x0010, 0x0010); + ReplaceOrCreate(studyInstanceUID, 0x0010, 0x0010); } else { - ReplaceOrCreateByNumber("anonymised", 0x0010, 0x0010); + ReplaceOrCreate("anonymised", 0x0010, 0x0010); } } @@ -1292,7 +1292,7 @@ void Header::GetImageOrientationPatient( float iop[6] ) iop[0] = iop[1] = iop[2] = iop[3] = iop[4] = iop[5] = 0.; // 0020 0037 DS REL Image Orientation (Patient) - if ( (strImOriPat = GetEntryByNumber(0x0020,0x0037)) != GDCM_UNFOUND ) + if ( (strImOriPat = GetEntry(0x0020,0x0037)) != GDCM_UNFOUND ) { if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f", &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 ) @@ -1302,7 +1302,7 @@ void Header::GetImageOrientationPatient( float iop[6] ) } //For ACR-NEMA // 0020 0035 DS REL Image Orientation (RET) - else if ( (strImOriPat = GetEntryByNumber(0x0020,0x0035)) != GDCM_UNFOUND ) + else if ( (strImOriPat = GetEntry(0x0020,0x0035)) != GDCM_UNFOUND ) { if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f", &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 ) @@ -1375,14 +1375,14 @@ void Header::InitializeDefaultHeader() // Special case this is the image (not a string) GrPixel = 0x7fe0; NumPixel = 0x0010; - ReplaceOrCreateByNumber(0, 0, GrPixel, NumPixel); + ReplaceOrCreate(0, 0, GrPixel, NumPixel); // All remaining strings: unsigned int i = 0; DICOM_DEFAULT_VALUE current = defaultvalue[i]; while( current.value ) { - ReplaceOrCreateByNumber(current.value, current.group, current.elem); + ReplaceOrCreate(current.value, current.group, current.elem); current = defaultvalue[++i]; } } diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index febf2d12..31ebbc47 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/01/07 22:19:48 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/08 15:03:59 $ + 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 @@ -1062,9 +1062,9 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) 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 @@ -1082,7 +1082,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) ////// 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" ); @@ -1090,7 +1090,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) ////// 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" ); @@ -1098,7 +1098,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) ////// 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" ); diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index f64d2b14..c6cd59c1 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 22:03:30 $ - Version: $Revision: 1.48 $ + Date: $Date: 2005/01/08 15:04:00 $ + Version: $Revision: 1.49 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -163,12 +163,12 @@ bool SQItem::AddEntry(DocEntry *entry) * (NOT a shadow one) * @param val string value to set * @param group Group number of the searched tag. - * @param element Element number of the searched tag. + * @param elem Element number of the searched tag. * @return true if element was found or created successfully */ -bool SQItem::SetEntryByNumber(std::string const &val, uint16_t group, - uint16_t element) +bool SQItem::SetEntry(std::string const &val, uint16_t group, + uint16_t elem) { for(ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); @@ -180,23 +180,24 @@ bool SQItem::SetEntryByNumber(std::string const &val, uint16_t group, } if ( ( group < (*i)->GetGroup() ) - ||( group == (*i)->GetGroup() && element < (*i)->GetElement()) ) + ||( group == (*i)->GetGroup() && elem < (*i)->GetElement()) ) { - // instead of ReplaceOrCreateByNumber + // instead of ReplaceOrCreate // that is a method of Document :-( ValEntry* entry = 0; - TagKey key = DictEntry::TranslateToKey(group, element); + TagKey key = DictEntry::TranslateToKey(group, elem); // we assume a Public Dictionnary *is* loaded Dict *pubDict = Global::GetDicts()->GetDefaultPubDict(); // if the invoked (group,elem) doesn't exist inside the Dictionary // we create a VirtualDictEntry - DictEntry *dictEntry = pubDict->GetDictEntryByNumber(group, element); + DictEntry *dictEntry = pubDict->GetDictEntry(group, elem); if (dictEntry == NULL) { dictEntry = - Global::GetDicts()->NewVirtualDictEntry(group, element, - "UN", GDCM_UNKNOWN, GDCM_UNKNOWN); + Global::GetDicts()->NewVirtualDictEntry(group, elem, + "UN", GDCM_UNKNOWN, + GDCM_UNKNOWN); } // we assume the constructor didn't fail entry = new ValEntry(dictEntry); @@ -208,7 +209,7 @@ bool SQItem::SetEntryByNumber(std::string const &val, uint16_t group, return true; } - if (group == (*i)->GetGroup() && element == (*i)->GetElement() ) + if (group == (*i)->GetGroup() && elem == (*i)->GetElement() ) { if ( ValEntry* entry = dynamic_cast(*i) ) { @@ -296,15 +297,17 @@ DocEntry *SQItem::GetNextEntry() //----------------------------------------------------------------------------- // Protected /** - * \brief Gets a Dicom Element inside a SQ Item Entry, by number + * \brief Gets a Dicom Element inside a SQ Item Entry + * @param group Group number of the Entry + * @param elem Element number of the Entry * @return */ -DocEntry* SQItem::GetDocEntryByNumber(uint16_t group, uint16_t element) +DocEntry* SQItem::GetDocEntry(uint16_t group, uint16_t elem) { for(ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); ++i) { - if ( (*i)->GetGroup() == group && (*i)->GetElement() == element ) + if ( (*i)->GetGroup() == group && (*i)->GetElement() == elem ) { return *i; } @@ -313,16 +316,18 @@ DocEntry* SQItem::GetDocEntryByNumber(uint16_t group, uint16_t element) } /** - * \brief Get the value of a Dicom Element inside a SQ Item Entry, by number + * \brief Get the value of a Dicom Element inside a SQ Item Entry + * @param group Group number of the Entry + * @param elem Element number of the Entry * @return */ -std::string SQItem::GetEntryByNumber(uint16_t group, uint16_t element) +std::string SQItem::GetEntry(uint16_t group, uint16_t elem) { for(ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); ++i) { - if ( (*i)->GetGroup() == group && (*i)->GetElement() == element) + if ( (*i)->GetGroup() == group && (*i)->GetElement() == elem) { return ((ValEntry *)(*i))->GetValue(); //FIXME } diff --git a/src/gdcmSQItem.h b/src/gdcmSQItem.h index 9874b61d..df11a345 100644 --- a/src/gdcmSQItem.h +++ b/src/gdcmSQItem.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.h,v $ Language: C++ - Date: $Date: 2005/01/07 08:46:18 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/08 15:04:00 $ + Version: $Revision: 1.30 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -49,12 +49,12 @@ public: bool RemoveEntry(DocEntry *EntryToRemove); bool RemoveEntryNoDestroy(DocEntry *EntryToRemove); - DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element); + DocEntry *GetDocEntry(uint16_t group, uint16_t element); - bool SetEntryByNumber(std::string const &val, uint16_t group, - uint16_t element); + bool SetEntry(std::string const &val, uint16_t group, + uint16_t element); - std::string GetEntryByNumber(uint16_t group, uint16_t element); + std::string GetEntry(uint16_t group, uint16_t element); /// \brief returns the ordinal position of a given SQItem int GetSQItemNumber() { return SQItemNumber; }; diff --git a/vtk/vtkGdcmWriter.cxx b/vtk/vtkGdcmWriter.cxx index 7f452654..720b1fc6 100644 --- a/vtk/vtkGdcmWriter.cxx +++ b/vtk/vtkGdcmWriter.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmWriter.cxx,v $ Language: C++ - Date: $Date: 2004/12/10 13:49:08 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/08 15:04:00 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,7 +26,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.8 $"); +vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.9 $"); vtkStandardNewMacro(vtkGdcmWriter); //----------------------------------------------------------------------------- @@ -132,29 +132,29 @@ void SetImageInformation(gdcm::File *file,vtkImageData *image) str.str(""); str << dim[0]; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0011); // Columns + file->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns str.str(""); str << dim[1]; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0010); // Rows + file->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows if(dim[2]>1) { str.str(""); str << dim[2]; - //file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0012); // Planes - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0008); // Number of Frames + //file->ReplaceOrCreate(str.str(),0x0028,0x0012); // Planes + file->ReplaceOrCreate(str.str(),0x0028,0x0008); // Number of Frames } // Pixel type str.str(""); str << image->GetScalarSize()*8; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0100); // Bits Allocated - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0101); // Bits Stored + file->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated + file->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored str.str(""); str << image->GetScalarSize()*8-1; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0102); // High Bit + file->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit // Pixel Repr // FIXME : what do we do when the ScalarType is @@ -171,39 +171,39 @@ void SetImageInformation(gdcm::File *file,vtkImageData *image) { str << "1"; // Signed } - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0103); // Pixel Representation + file->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation // Samples per pixel str.str(""); str << image->GetNumberOfScalarComponents(); - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0002); // Samples per Pixel + file->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel // Spacing double *sp = image->GetSpacing(); str.str(""); str << sp[0] << "\\" << sp[1]; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x0030); // Pixel Spacing + file->ReplaceOrCreate(str.str(),0x0028,0x0030); // Pixel Spacing str.str(""); str << sp[2]; - file->ReplaceOrCreateByNumber(str.str(),0x0018,0x0088); // Spacing Between Slices + file->ReplaceOrCreate(str.str(),0x0018,0x0088); // Spacing Between Slices // Origin double *org = image->GetOrigin(); str.str(""); str << org[0] << "\\" << org[1] << "\\" << org[2]; - file->ReplaceOrCreateByNumber(str.str(),0x0020,0x0032); // Image Position Patient + file->ReplaceOrCreate(str.str(),0x0020,0x0032); // Image Position Patient // Window / Level double *rng=image->GetScalarRange(); str.str(""); str << rng[1]-rng[0]; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x1051); // Window Width + file->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width str.str(""); str << (rng[1]+rng[0])/2.0; - file->ReplaceOrCreateByNumber(str.str(),0x0028,0x1050); // Window Center + file->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center // Pixels unsigned char *data;