2004-12-03 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* 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 <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmFile.[h|cxx] : now use FileType instead of TWriteType.
2004-12-03 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
- * 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
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 <Benoit.Regrain@creatis.insa-lyon.fr>
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
2004-11-23 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* 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.
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.
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
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
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
((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();
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
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);
// 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();
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
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 ++;
}
*/
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 ++;
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;
}
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;
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
<< " PlanarConfiguration=" << planarConfig
<< std::endl
<< " PhotometricInterpretation="
- << e1->GetEntryByNumber(0x0028,0x0004)
+ << e1->GetEntry(0x0028,0x0004)
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
<< 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"
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
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"
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
// 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();
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
d->Print(); std::cout << std::endl;
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreateByNumber(
+ copy->GetHeader()->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreateByNumber(
+ copy->GetHeader()->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
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
// Doesn't seems to do anything:
gdcm::Debug::SetDebugOn();
+
// Doesn't link properly:
//gdcm::Debug::GetReference().SetDebug(1);
// Do not bother with field from private dict
if( v->GetName() != "gdcm::Unknown" )
{
- h2->ReplaceOrCreateByNumber(
+ h2->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
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
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
- << e1->GetEntryByNumber(0x0028,0x0004)
+ << e1->GetEntry(0x0028,0x0004)
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
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
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();
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
// 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:
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;
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
// 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() )
{
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
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
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
}
//e1->PrintPubDict();
//e1->GetPubDict()->GetEntriesByKey();
- e1->GetPubDict()->PrintByKey();
+ e1->GetPubDict()->Print();
delete e1;
return 0;
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
// 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);
}
// 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
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());
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
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
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
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
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;
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
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 ++;
}
*/
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 ++;
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;
}
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;
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
// 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() )
{
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
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)");
{
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 );
{
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 !
{
// 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
{
}
else
{
- if ( header->GetEntryLengthByNumber(tmpGr,tmpEl) == 0 )
+ if ( header->GetEntryLength(tmpGr,tmpEl) == 0 )
val = it->Value;
}
// + 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)");
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<ValEntry *>(d) )
{
v = valEntry->GetValue();
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 )
{
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
* related to this 'object'
* @return
*/
-TagDocEntryHT DicomDirObject::GetEntry()
+TagDocEntryHT DicomDirObject::GetEntryHT()
{
TagDocEntryHT HT;
DocEntries = GetDocEntries();
*/
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;
{
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);
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
{
typedef std::list<DicomDirObject *> ListContent;
public:
- TagDocEntryHT GetEntry();
+ TagDocEntryHT GetEntryHT();
void FillObject(ListDicomDirMetaElem const &elemList);
protected:
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
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)
os << s.str();
}
+
//-----------------------------------------------------------------------------
// Public
/**
* @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);
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
// Print
void Print(std::ostream &os = std::cout);
- void PrintByKey(std::ostream &os = std::cout);
// Entries
bool AddNewEntry (DictEntry const &newEntry);
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
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
* @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);
* @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);
* @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 );
* @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();
}
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;
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
/// \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,
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
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
// 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
// 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 ------------------
}
*/
TransferSyntaxType Document::GetTransferSyntax()
{
- DocEntry *entry = GetDocEntryByNumber(0x0002, 0x0010);
+ DocEntry *entry = GetDocEntry(0x0002, 0x0010);
if ( !entry )
{
return UnknownTS;
// 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;
}
/**
* \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)
{
// Create a new valEntry if necessary
if (!valEntry)
{
- valEntry = NewValEntryByNumber(group, elem, vr);
+ valEntry = NewValEntry(group, elem, vr);
if ( !AddEntry(valEntry))
{
* \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)
// Create a new binEntry if necessary
if (!binEntry)
{
- binEntry = NewBinEntryByNumber(group, elem, vr);
+ binEntry = NewBinEntry(group, elem, vr);
if ( !AddEntry(binEntry))
{
* \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)
// Create a new seqEntry if necessary
if (!seqEntry)
{
- seqEntry = NewSeqEntryByNumber(group, elem);
+ seqEntry = NewSeqEntry(group, elem);
if ( !AddEntry(seqEntry))
{
* @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;
}
* @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;
* @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))
* @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;
* @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
* @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).");
* @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).");
* @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");
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;
* @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;
* @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))
}
/**
- * \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;
}
/**
- * \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;
// 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 )
{
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 )
{
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;
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;
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;
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;
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
// 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);
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 );
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
* @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);
}
* @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);
}
/**
* \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;
}
/*
* \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;
}
/**
void File::SetWriteToLibido()
{
ValEntry *oldRow = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0010));
+ (HeaderInternal->GetDocEntry(0x0028, 0x0010));
ValEntry *oldCol = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0011));
+ (HeaderInternal->GetDocEntry(0x0028, 0x0011));
if( oldRow && oldCol )
{
void File::SetWriteToNoLibido()
{
ValEntry *recCode = dynamic_cast<ValEntry *>
- (HeaderInternal->GetDocEntryByNumber(0x0008,0x0010));
+ (HeaderInternal->GetDocEntry(0x0008,0x0010));
if( recCode )
{
if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )
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)
}
else
{
- newE = GetHeader()->NewValEntryByNumber(group,element);
+ newE = GetHeader()->NewValEntry(group,element);
}
return(newE);
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)
}
else
{
- newE = GetHeader()->NewBinEntryByNumber(group,element);
+ newE = GetHeader()->NewBinEntry(group,element);
}
return(newE);
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
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();
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
// 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
// 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 )
{
}
// 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
// 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);
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'
}
*/
int Header::GetXSize()
{
- const std::string &strSize = GetEntryByNumber(0x0028,0x0011);
+ const std::string &strSize = GetEntry(0x0028,0x0011);
if ( strSize == GDCM_UNFOUND )
{
return 0;
*/
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() );
{
// 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() );
float Header::GetXSpacing()
{
float xspacing, yspacing;
- const std::string &strSpacing = GetEntryByNumber(0x0028,0x0030);
+ const std::string &strSpacing = GetEntry(0x0028,0x0030);
if ( strSpacing == GDCM_UNFOUND )
{
float Header::GetYSpacing()
{
float yspacing = 1.;
- std::string strSpacing = GetEntryByNumber(0x0028,0x0030);
+ std::string strSpacing = GetEntry(0x0028,0x0030);
if ( strSpacing == GDCM_UNFOUND )
{
// 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.;
{
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 )
{
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)
// 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 ") )
{
{
// 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;
}
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)");
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)");
float Header::GetZOrigin()
{
float xImPos, yImPos, zImPos;
- std::string strImPos = GetEntryByNumber(0x0020,0x0032);
+ std::string strImPos = GetEntry(0x0020,0x0032);
if ( strImPos != GDCM_UNFOUND )
{
}
}
- 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(),
}
}
- 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)
}
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)
// 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() );
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;
*/
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");
*/
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");
*/
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");
*/
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");
*/
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");
*/
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") )
{
*/
bool Header::IsPaletteColor()
{
- std::string PhotometricInterp = GetEntryByNumber( 0x0028, 0x0004 );
+ std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 );
if ( PhotometricInterp == "PALETTE COLOR " )
{
return true;
*/
bool Header::IsYBRFull()
{
- std::string PhotometricInterp = GetEntryByNumber( 0x0028, 0x0004 );
+ std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 );
if ( PhotometricInterp == "YBR_FULL" )
{
return true;
*/
int Header::GetPlanarConfiguration()
{
- std::string strSize = GetEntryByNumber(0x0028,0x0006);
+ std::string strSize = GetEntry(0x0028,0x0006);
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Absent Planar Configuration");
{
// 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();
*/
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");
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 )
{
*/
size_t Header::GetPixelOffset()
{
- DocEntry* pxlElement = GetDocEntryByNumber(GrPixel,NumPixel);
+ DocEntry* pxlElement = GetDocEntry(GrPixel,NumPixel);
if ( pxlElement )
{
return pxlElement->GetOffset();
*/
size_t Header::GetPixelAreaLength()
{
- DocEntry* pxlElement = GetDocEntryByNumber(GrPixel,NumPixel);
+ DocEntry* pxlElement = GetDocEntry(GrPixel,NumPixel);
if ( pxlElement )
{
return pxlElement->GetLength();
{
// 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;
}
//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;
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 )
{
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);
}
}
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 )
}
//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 )
// 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];
}
}
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
if ( HasLUT )
{
// Just in case some access to a Header element requires disk access.
- LutRedDescriptor = header->GetEntryByNumber( 0x0028, 0x1101 );
- LutGreenDescriptor = header->GetEntryByNumber( 0x0028, 0x1102 );
- LutBlueDescriptor = header->GetEntryByNumber( 0x0028, 0x1103 );
+ LutRedDescriptor = header->GetEntry( 0x0028, 0x1101 );
+ LutGreenDescriptor = header->GetEntry( 0x0028, 0x1102 );
+ LutBlueDescriptor = header->GetEntry( 0x0028, 0x1103 );
// Depending on the value of Document::MAX_SIZE_LOAD_ELEMENT_VALUE
// [ refer to invocation of Document::SetMaxSizeLoadEntry() in
////// Red round
header->LoadEntryBinArea(0x0028, 0x1201);
- LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 );
+ LutRedData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1201 );
if ( ! LutRedData )
{
gdcmVerboseMacro( "Unable to read red LUT data" );
////// Green round:
header->LoadEntryBinArea(0x0028, 0x1202);
- LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 );
+ LutGreenData = (uint8_t*)header->GetEntryBinArea(0x0028, 0x1202 );
if ( ! LutGreenData)
{
gdcmVerboseMacro( "Unable to read green LUT data" );
////// Blue round:
header->LoadEntryBinArea(0x0028, 0x1203);
- LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 );
+ LutBlueData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1203 );
if ( ! LutBlueData )
{
gdcmVerboseMacro( "Unable to read blue LUT data" );
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
* (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();
}
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);
return true;
}
- if (group == (*i)->GetGroup() && element == (*i)->GetElement() )
+ if (group == (*i)->GetGroup() && elem == (*i)->GetElement() )
{
if ( ValEntry* entry = dynamic_cast<ValEntry*>(*i) )
{
//-----------------------------------------------------------------------------
// 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;
}
}
/**
- * \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
}
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
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; };
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
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.8 $");
+vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.9 $");
vtkStandardNewMacro(vtkGdcmWriter);
//-----------------------------------------------------------------------------
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
{
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;