<B></B></A>
</H2>
<UL>
- <LI> Final check of the jpeg sub-library: all kinds of jpeg
- compressed Dicom files (but jpeg2000) can be read
+ <LI> Final check of the jpeg sub-library: all 'classical' jpeg
+ compressed Dicom files can be read<br>
+ All the previously gdcm-breaker images are now readable<br>
+ gdcm doesn't read yet JPEG-LS and JPEG2000 encoded files.
<LI> Use of <TT> namespace</TT> : all the methods formerly called
<TT>className::gdcmXxx()</TT> are now called <TT>className::Xxx()</TT>
<LI> Removal of accessors <TT>GetXxxByname</TT>, <TT>SetXxxByname</TT>
and <TT>GetXxxByNumber</TT>, <TT>SetXxxByNumber</TT>
- replaced by <TT>GetXxx</TT>, <TT>SetXxx</TT>
+ replaced by <TT>GetXxx</TT>, <TT>SetXxx</TT>
+ <LI> a gdcm::Document is now specialized in gdcm::DicomDir and gdcm::File
<LI> A huge number of memory leaks removed
- <LI> All the previously gdcm-breaker images are now readable
<LI> Improvement of write process
</UL>
</H2>
<UL>
This version will be used by Insight Tool Kit
- (<a href="http://www.itk.org">ITK</a> 2.0) at the beginning of 2005.<br>
+ (<a href="http://www.itk.org">ITK</a> 1.10) at the beginning of 2005.<br>
It's not yet packaged ...<br><br>
<LI> The new <TT>gdcmDocument</TT> class is a parent class of
<TT>gdcmHeader</TT> class and <TT>gdcmDicomDir</TT> class.
Program: gdcm
Module: $RCSfile: BuildUpDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/08 15:03:57 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ Version: $Revision: 1.12 $
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->SetEntry("patientONE",0x0010, 0x0010);
+ p1->SetEntryValue("patientONE",0x0010, 0x0010);
gdcm::DicomDirPatient *p2=dcmdir->NewPatient();
- p2->SetEntry("patientTWO",0x0010, 0x0010);
+ p2->SetEntryValue("patientTWO",0x0010, 0x0010);
gdcm::DicomDirStudy *s21=p2->NewStudy();
- s21->SetEntry("StudyDescrTwo.One",0x0008, 0x1030);
+ s21->SetEntryValue("StudyDescrTwo.One",0x0008, 0x1030);
gdcm::DicomDirSerie *s211=s21->NewSerie();
gdcm::DicomDirImage *s2111=s211->NewImage();
(void)s2111; //not used
gdcm::DicomDirStudy *s11=p1->NewStudy();
- s11->SetEntry("StudyDescrOne.One",0x0008, 0x1030);
+ s11->SetEntryValue("StudyDescrOne.One",0x0008, 0x1030);
// Name of the physician reading study
// Header Entry to be created
- s11->SetEntry("Dr Mabuse",0x0008, 0x1060);
+ s11->SetEntryValue("Dr Mabuse",0x0008, 0x1060);
gdcm::DicomDirPatient *p3 = dcmdir->NewPatient();
- p3->SetEntry("patientTHREE",0x0010, 0x0010);
+ p3->SetEntryValue("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: 2005/01/21 11:40:52 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
int dataSize = f1->GetImageDataSize();
std::cout << "---> pourFindTaggs : dataSize " << dataSize << std::endl;
- f1->SetEntry(RecCode ,0x0008,0x0010);
- f1->SetEntry(ManufacturerName ,0x0008,0x0070);
+ f1->SetEntryValue(RecCode ,0x0008,0x0010);
+ f1->SetEntryValue(ManufacturerName ,0x0008,0x0070);
// ImagePositionPatient
- ImagePositionPatient = f1->GetFile()->GetEntry(0x0020,0x0032);
+ ImagePositionPatient = f1->GetFile()->GetEntryValue(0x0020,0x0032);
// Image Position (RET)
- f1->SetEntry(ImagePositionPatient, 0x0020,0x0030);
+ f1->SetEntryValue(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->SetEntry(Location, 0x0020,0x0050);
+ f1->SetEntryValue(Location, 0x0020,0x0050);
// sinon, la longueur du champ est erronée (?!?)
// Probable sac de noeud entre strlen(xxx.c_str()) et xxx.length()
zizi = gdcm::Util::Format("%d",0x7FE0);
ImageLocation = gdcm::Util::DicomString(zizi.c_str());
-//f1->SetEntry(Location, 0x0028,0x0200);
+//f1->SetEntryValue(Location, 0x0028,0x0200);
//f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
// void* imageData= f1->GetImageData();
Program: gdcm
Module: $RCSfile: PrintDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:21 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
pa = e1->GetFirstPatient();
while (pa)
{
- std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
+ std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name
pa = e1->GetNextPatient();
}
break;
pa = e1->GetFirstPatient();
while ( pa ) // on degouline les PATIENT de ce DICOMDIR
{
- std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
+ std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name
st = pa->GetFirstStudy();
while ( st ) { // on degouline les STUDY de ce patient
- std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl; // Study Description
+ std::cout << "--- "<< st->GetEntryValue(0x0008, 0x1030) << std::endl; // Study Description
st = pa->GetNextStudy();
}
pa = e1->GetNextPatient();
while ( pa ) // on degouline les PATIENT de ce DICOMDIR
{
// Patient's Name, Patient ID
- std::cout << "Pat.Name:[" << pa->GetEntry(0x0010, 0x0010) <<"]"; // Patient's Name
+ std::cout << "Pat.Name:[" << pa->GetEntryValue(0x0010, 0x0010) <<"]"; // Patient's Name
std::cout << " Pat.ID:[";
- std::cout << pa->GetEntry(0x0010, 0x0020) << "]" << std::endl; // Patient ID
+ std::cout << pa->GetEntryValue(0x0010, 0x0020) << "]" << std::endl; // Patient ID
st = pa->GetFirstStudy();
while ( st ) { // on degouline les STUDY de ce patient
- std::cout << "--- Stud.descr:[" << st->GetEntry(0x0008, 0x1030) << "]";// Study Description
- std::cout << " Stud.ID:[" << st->GetEntry(0x0020, 0x0010); // Study ID
+ std::cout << "--- Stud.descr:[" << st->GetEntryValue(0x0008, 0x1030) << "]";// Study Description
+ std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID
std::cout << "]" << std::endl;
se = st->GetFirstSerie();
while ( se ) { // on degouline les SERIES de cette study
- std::cout << "--- --- Ser.Descr:["<< se->GetEntry(0x0008, 0x103e)<< "]"; // Series Description
- std::cout << " Ser.nb:[" << se->GetEntry(0x0020, 0x0011); // Series number
- std::cout << "] Mod.:[" << se->GetEntry(0x0008, 0x0060) << "]"; // Modality
+ std::cout << "--- --- Ser.Descr:["<< se->GetEntryValue(0x0008, 0x103e)<< "]"; // Series Description
+ std::cout << " Ser.nb:[" << se->GetEntryValue(0x0020, 0x0011); // Series number
+ std::cout << "] Mod.:[" << se->GetEntryValue(0x0008, 0x0060) << "]"; // Modality
std::cout << std::endl;
se = st->GetNextSerie();
}
pa = e1->GetFirstPatient();
while ( pa ) { // les PATIENT de ce DICOMDIR
- std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
+ std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name
st = pa->GetFirstStudy();
while ( st ) { // on degouline les STUDY de ce patient
- std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl; // Study Description
- std::cout << " Stud.ID:[" << st->GetEntry(0x0020, 0x0010); // Study ID
+ std::cout << "--- "<< st->GetEntryValue(0x0008, 0x1030) << std::endl; // Study Description
+ std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID
se = st->GetFirstSerie();
while ( se ) { // on degouline les SERIES de cette study
- std::cout << "--- --- "<< se->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description
- std::cout << " Ser.nb:[" << se->GetEntry(0x0020, 0x0011); // Series number
- std::cout << "] Mod.:[" << se->GetEntry(0x0008, 0x0060) << "]"; // Modality
+ std::cout << "--- --- "<< se->GetEntryValue(0x0008, 0x103e) << std::endl; // Serie Description
+ std::cout << " Ser.nb:[" << se->GetEntryValue(0x0020, 0x0011); // Series number
+ std::cout << "] Mod.:[" << se->GetEntryValue(0x0008, 0x0060) << "]"; // Modality
im = se->GetFirstImage();
while ( im ) { // on degouline les Images de cette serie
- std::cout << "--- --- --- "<< im->GetEntry(0x0004, 0x1500) << std::endl; // File name
+ std::cout << "--- --- --- "<< im->GetEntryValue(0x0004, 0x1500) << std::endl; // File name
im = se->GetNextImage();
}
se = st->GetNextSerie();
itPatient = e1->GetDicomDirPatients().begin();
while ( itPatient != e1->GetDicomDirPatients().end() ) { // on degouline les PATIENT de ce DICOMDIR
- std::cout << (*itPatient)->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
+ std::cout << (*itPatient)->GetEntryValue(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)->GetEntry(0x0008, 0x1030) << std::endl; // Study Description
+ std::cout << "--- "<< (*itStudy)->GetEntryValue(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)->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description
+ std::cout << "--- --- "<< (*itSerie)->GetEntryValue(0x0008, 0x103e) << std::endl; // Serie Description
itImage = ((*itSerie)->GetDicomDirImages()).begin();
while (itImage != (*itSerie)->GetDicomDirImages().end() ) { // on degouline les IMAGES de cette serie
- std::cout << "--- --- --- "<< (*itImage)->GetEntry(0x0004, 0x1500) << std::endl; // File name
+ std::cout << "--- --- --- "<< (*itImage)->GetEntryValue(0x0004, 0x1500) << std::endl; // File name
++itImage;
}
++itSerie;
Program: gdcm
Module: $RCSfile: PrintFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:31 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ Version: $Revision: 1.26 $
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->GetEntry(0x0028,0x0004)
+ << e1->GetEntryValue(0x0028,0x0004)
<< "] "<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
<< std::endl;
- if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
+ if ( e1->GetEntryValue(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
{
std::cout << "Transfer Syntax not loaded. " << std::endl
<< "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
Program: gdcm
Module: $RCSfile: PrintHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
std::cout << "\n\n" << std::endl;
- if ( e1->GetEntry(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
+ if ( e1->GetEntryValue(0x0002,0x0010) == gdcm::GDCM_NOTLOADED )
{
std::cout << "Transfer 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/24 14:14:08 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
f2->GetFile()->GetPubDict()->GetEntry( 0x0018, 1310 );
std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl;
- std::string matrix = f2->GetFile()->GetEntry(0x0018, 0x1310);
+ std::string matrix = f2->GetFile()->GetEntryValue(0x0018, 0x1310);
if(matrix != "gdcm::Unfound")
{
std::cerr << "Aquisition Matrix:" << matrix << std::endl;
Program: gdcm
Module: $RCSfile: TestPapyrus.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:32 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
// Modality, Transfer Syntax, Study Date, Study Time
// Patient Name, Media Storage SOP Instance UID, etc
- MediaStSOPinstUID = h->GetEntry(0x0002,0x0002);
- TransferSyntax = h->GetEntry(0x0002,0x0010);
- StudyDate = sqi->GetEntry(0x0008,0x0020);
- StudyTime = sqi->GetEntry(0x0008,0x0030);
- Modality = sqi->GetEntry(0x0008,0x0060);
- PatientName = sqi->GetEntry(0x0010,0x0010);
+ MediaStSOPinstUID = h->GetEntryValue(0x0002,0x0002);
+ TransferSyntax = h->GetEntryValue(0x0002,0x0010);
+ StudyDate = sqi->GetEntryValue(0x0008,0x0020);
+ StudyTime = sqi->GetEntryValue(0x0008,0x0030);
+ Modality = sqi->GetEntryValue(0x0008,0x0060);
+ PatientName = sqi->GetEntryValue(0x0010,0x0010);
std::cout << "TransferSyntax " << TransferSyntax << std::endl;
// we brutally suppose all the images within a Papyrus file
// have the same caracteristics.
- // if you're aware they have not, just move the GetEntry
+ // if you're aware they have not, just move the GetEntryValue
// inside the loop
// Get caracteristics of the first image
- SamplesPerPixel = sqi->GetEntry(0x0028,0x0002);
- Rows = sqi->GetEntry(0x0028,0x0010);
- Columns = sqi->GetEntry(0x0028,0x0011);
- BitsAllocated = sqi->GetEntry(0x0028,0x0100);
- BitsStored = sqi->GetEntry(0x0028,0x0101);
- HighBit = sqi->GetEntry(0x0028,0x0102);
- PixelRepresentation = sqi->GetEntry(0x0028,0x0102);
+ SamplesPerPixel = sqi->GetEntryValue(0x0028,0x0002);
+ Rows = sqi->GetEntryValue(0x0028,0x0010);
+ Columns = sqi->GetEntryValue(0x0028,0x0011);
+ BitsAllocated = sqi->GetEntryValue(0x0028,0x0100);
+ BitsStored = sqi->GetEntryValue(0x0028,0x0101);
+ HighBit = sqi->GetEntryValue(0x0028,0x0102);
+ PixelRepresentation = sqi->GetEntryValue(0x0028,0x0102);
// just convert those needed to compute PixelArea length
int iRows = (uint32_t) atoi( Rows.c_str() );
while (sqi)
{
std::cout << "One more image read. Keep waiting" << std::endl;
- Rows = sqi->GetEntry(0x0028,0x0010);
+ Rows = sqi->GetEntryValue(0x0028,0x0010);
// minimum integrity check
if (Rows != previousRows)
{
Program: gdcm
Module: $RCSfile: TestWrite.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
- << e1->GetEntry(0x0028,0x0004)
+ << e1->GetEntryValue(0x0028,0x0004)
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
Program: gdcm
Module: $RCSfile: Write.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
<< " SampleserPixel=" << sPP
<< " PlanarConfiguration=" << planarConfig
<< " PhotometricInterpretation="
- << e1->GetEntry(0x0028,0x0004)
+ << e1->GetEntryValue(0x0028,0x0004)
<< std::endl;
int numberOfScalarComponents=e1->GetNumberOfScalarComponents();
Program: gdcm
Module: $RCSfile: WriteDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/24 16:10:49 $
+ 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
// We assume that DICOM fields of second file actually exists :
- std::string nbFrames = f2->GetFile()->GetEntry(0x0028, 0x0008);
+ std::string nbFrames = f2->GetFile()->GetEntryValue(0x0028, 0x0008);
if(nbFrames != "gdcm::Unfound") {
f1->GetFile()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
}
f1->GetFile()->ReplaceOrCreate(
- f2->GetFile()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
+ f2->GetFile()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
f1->GetFile()->ReplaceOrCreate(
- f2->GetFile()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
+ f2->GetFile()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
// Some other tags should be updated:
f1->GetFile()->Print();
- std::string s0 = f2->GetFile()->GetEntry(0x7fe0, 0x0000);
- std::string s10 = f2->GetFile()->GetEntry(0x7fe0, 0x0010);
+ std::string s0 = f2->GetFile()->GetEntryValue(0x7fe0, 0x0000);
+ std::string s10 = f2->GetFile()->GetEntryValue(0x7fe0, 0x0010);
std::cout << "lgr 7fe0, 0000 " << s0 << std::endl;
std::cout << "lgr 7fe0, 0010 " << s10 << std::endl;
Program: gdcm
Module: $RCSfile: TestAllEntryVerify.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2005/01/24 16:10:50 $
+ Version: $Revision: 1.21 $
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->GetEntry(group, element);
+ std::string testedValue = tested->GetEntryValue(group, element);
if ( testedValue != j->second )
{
// Oops make sure this is only the \0 that differ
Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/08 15:03:58 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/24 16:10:50 $
+ 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
// We suppose the DICOM Entries of the second file *do* exist !
- std::string nbFrames = f2->GetHeader()->GetEntry(0x0028, 0x0008);
+ std::string nbFrames = f2->GetHeader()->GetEntryValue(0x0028, 0x0008);
if(nbFrames != "gdcm::Unfound")
{
f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
// provided to 'transform' an image 'Siemens MRI New version' into an image 'Siemens MRI old version'
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0010), 0x0028, 0x0010);// nbLig
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010);// nbLig
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0011), 0x0028, 0x0011);// nbCol
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011);// nbCol
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0102), 0x0028, 0x0102);// HighBit
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0102), 0x0028, 0x0102);// HighBit
f1->GetHeader()->ReplaceOrCreate(
- f2->GetHeader()->GetEntry(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation
+ f2->GetHeader()->GetEntryValue(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation
// Probabely some more to update (?)
// TODO : add a default value
f1->GetHeader()->Print();
- std::string s0 =f2->GetHeader()->GetEntry(0x7fe0, 0x0000);
- std::string s10=f2->GetHeader()->GetEntry(0x7fe0, 0x0010);
+ std::string s0 =f2->GetHeader()->GetEntryValue(0x7fe0, 0x0000);
+ std::string s10=f2->GetHeader()->GetEntryValue(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/21 11:40:54 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2005/01/24 16:10:50 $
+ Version: $Revision: 1.34 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcm::File *copyH = new gdcm::File( );
//First of all copy the header field by field
-
- // Warning :Accessor gdcmElementSet::GetEntry() should not exist
- // It was commented out by Mathieu, that was a *good* idea
//////////////// Step 2:
std::cout << "2...";
Program: gdcm
Module: $RCSfile: TestCopyRescaleDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:54 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/24 16:10:50 $
+ 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
//First of all copy the header field by field
- // Warning :Accessor gdcmElementSet::GetEntry() should not exist
- // It was commented out by Mathieu, that was a *good* idea
- // (the user does NOT have to know the way we implemented the File !)
- // Waiting for a 'clean' solution, I keep the method ...JPRx
-
-
//////////////// Step 2:
std::cout << "2...";
// Copy of the header content
size_t rescaleSize;
uint8_t *rescaleImage;
- const std::string & bitsStored = originalH->GetEntry(0x0028,0x0101);
+ const std::string & bitsStored = originalH->GetEntryValue(0x0028,0x0101);
if( bitsStored == "16" )
{
std::cout << "Rescale...";
Program: gdcm
Module: $RCSfile: TestDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:22 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/01/24 16:10:50 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
pa = e1->GetFirstPatient();
while ( pa )
{ // we process all the PATIENT of this DICOMDIR
- std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
+ std::cout << pa->GetEntryValue(0x0010, 0x0010) << std::endl; // Patient's Name
st = pa->GetFirstStudy();
while ( st )
{ // we process all the STUDY of this patient
- std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl; // Study Description
- std::cout << " Stud.ID:[" << st->GetEntry(0x0020, 0x0010); // Study ID
+ std::cout << "--- "<< st->GetEntryValue(0x0008, 0x1030) << std::endl; // Study Description
+ std::cout << " Stud.ID:[" << st->GetEntryValue(0x0020, 0x0010); // Study ID
se = st->GetFirstSerie();
while ( se )
{ // we process all the SERIES of this study
- std::cout << "--- --- "<< se->GetEntry(0x0008, 0x103e) << std::endl; // Serie Description
- std::cout << " Ser.nb:[" << se->GetEntry(0x0020, 0x0011); // Series number
- std::cout << "] Mod.:[" << se->GetEntry(0x0008, 0x0060) << "]"; // Modality
+ std::cout << "--- --- "<< se->GetEntryValue(0x0008, 0x103e) << std::endl; // Serie Description
+ std::cout << " Ser.nb:[" << se->GetEntryValue(0x0020, 0x0011); // Series number
+ std::cout << "] Mod.:[" << se->GetEntryValue(0x0008, 0x0060) << "]"; // Modality
im = se->GetFirstImage();
while ( im ) { // we process all the IMAGE of this serie
- std::cout << "--- --- --- "<< im->GetEntry(0x0004, 0x1500) << std::endl; // File name
+ std::cout << "--- --- --- "<< im->GetEntryValue(0x0004, 0x1500) << std::endl; // File name
im = se->GetNextImage();
}
se = st->GetNextSerie();
["Manufacturer's Model Name", "Gyroscan Intera"],
["Sequence Variant", "OTHER"],
["Pixel Data", "gdcm::NotLoaded. Address:6584 Length:131072 x(20000)"]
- ] ],
+ ] ],
]
def _BaseTest(self, FileSet):
assert reader.IsReadable(),\
"File '%s' is not readable by gdcmFile" % fileName
- valDict = reader.GetEntry()
+ valDict = reader.GetEntryValue()
for subEntry in entry[1]:
element = subEntry[0]
value = subEntry[1]
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:32 $
- Version: $Revision: 1.55 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.56 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Writer
* @param fp already open file pointer
- * @param filetype type of the file to be written
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:10 $
- Version: $Revision: 1.115 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.116 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
// NULL when we Build Up (ex nihilo) a DICOMDIR
// or when we add the META elems
- val = header->GetEntry(tmpGr, tmpEl);
+ val = header->GetEntryValue(tmpGr, tmpEl);
}
else
{
it != list.end(); ++it )
{
// get the current file characteristics
- 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);
+ patCurName = (*it)->GetEntryValue(0x0010,0x0010);
+ patCurID = (*it)->GetEntryValue(0x0010,0x0011);
+ studCurInstanceUID = (*it)->GetEntryValue(0x0020,0x000d);
+ studCurID = (*it)->GetEntryValue(0x0020,0x0010);
+ serCurInstanceUID = (*it)->GetEntryValue(0x0020,0x000e);
+ serCurID = (*it)->GetEntryValue(0x0020,0x0011);
if( patCurName != patPrevName || patCurID != patPrevID || first )
{
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:33 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Writes the Meta Elements
* @param fp ofstream to write to
- * @param t File Type
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
* @return
*/
-void DicomDirMeta::WriteContent(std::ofstream *fp, FileType t)
+void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype)
{
for (ListDocEntry::iterator i = DocEntries.begin();
i != DocEntries.end();
++i)
{
- (*i)->WriteContent(fp, t);
+ (*i)->WriteContent(fp, filetype);
}
}
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:33 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Writes the common part of any ValEntry, BinEntry, SeqEntry
* @param fp already open ofstream pointer
- * @param filetype type of the file to be written
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// \brief Gets the 'string value' of a ValEntry
/// identified by its (group,elem) - Sorry for the name !...-
- virtual std::string GetEntry(uint16_t group, uint16_t elem) = 0;
+ virtual std::string GetEntryValue(uint16_t group, uint16_t elem) = 0;
DictEntry *NewVirtualDictEntry(uint16_t group,
uint16_t elem,
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.205 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.206 $
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 = GetEntry(0x0028,0x0004);
+ std::string PhotometricInterpretation = GetEntryValue(0x0028,0x0004);
if( PhotometricInterpretation == "PALETTE COLOR " )
{
LoadEntryBinArea(0x0028,0x1200); // gray LUT
// we switch lineNumber and columnNumber
//
std::string RecCode;
- RecCode = GetEntry(0x0008, 0x0010); // recognition code (RET)
+ RecCode = GetEntryValue(0x0008, 0x0010); // recognition code (RET)
if (RecCode == "ACRNEMA_LIBIDO_1.1" ||
RecCode == "CANRME_AILIBOD1_1." ) // for brain-damaged softwares
// with "little-endian strings"
{
Filetype = ACR_LIBIDO;
- std::string rows = GetEntry(0x0028, 0x0010);
- std::string columns = GetEntry(0x0028, 0x0011);
- SetEntry(columns, 0x0028, 0x0010);
- SetEntry(rows , 0x0028, 0x0011);
+ std::string rows = GetEntryValue(0x0028, 0x0010);
+ std::string columns = GetEntryValue(0x0028, 0x0011);
+ SetEntryValue(columns, 0x0028, 0x0010);
+ SetEntryValue(rows , 0x0028, 0x0011);
}
// ----------------- End of ACR-LibIDO kludge ------------------
}
}
// Set the binEntry value
- SetEntry(value, valEntry);
+ SetEntryValue(value, valEntry); // The std::string value
return valEntry;
}
{
tmpArea = 0;
}
- if (!SetEntry(tmpArea,lgth,binEntry))
+ if (!SetEntryBinArea(tmpArea,lgth,binEntry))
{
if (tmpArea)
{
bool Document::ReplaceIfExist(std::string const &value,
uint16_t group, uint16_t elem )
{
- SetEntry(value, group, elem);
+ SetEntryValue(value, group, elem);
return true;
}
* @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool Document::SetEntry(std::string const& content,
+bool Document::SetEntryValue(std::string const& content,
uint16_t group, uint16_t elem)
{
ValEntry *entry = GetValEntry(group, elem);
gdcmVerboseMacro( "No corresponding ValEntry (try promotion first).");
return false;
}
- return SetEntry(content,entry);
+ return SetEntryValue(content,entry);
}
-
/**
* \brief Accesses an existing DocEntry (i.e. a Dicom Element)
* through it's (group, element) and modifies it's content with
* @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool Document::SetEntry(uint8_t*content, int lgth,
+bool Document::SetEntryBinArea(uint8_t*content, int lgth,
uint16_t group, uint16_t elem)
{
BinEntry *entry = GetBinEntry(group, elem);
return false;
}
- return SetEntry(content,lgth,entry);
+ return SetEntryBinArea(content,lgth,entry);
}
/**
* @param content new value (string) to substitute with
* @param entry Entry to be modified
*/
-bool Document::SetEntry(std::string const &content, ValEntry *entry)
+bool Document::SetEntryValue(std::string const &content, ValEntry *entry)
{
if(entry)
{
* @param entry Entry to be modified
* @param lgth new value length
*/
-bool Document::SetEntry(uint8_t *content, int lgth, BinEntry *entry)
+bool Document::SetEntryBinArea(uint8_t *content, int lgth, BinEntry *entry)
{
if(entry)
{
std::string Document::GetTransferSyntaxName()
{
// use the TS (TS : Transfer Syntax)
- std::string transferSyntax = GetEntry(0x0002,0x0010);
+ std::string transferSyntax = GetEntryValue(0x0002,0x0010);
if ( (transferSyntax.find(GDCM_NOTLOADED) < transferSyntax.length()) )
{
bool Document::operator<(Document &document)
{
// Patient Name
- std::string s1 = GetEntry(0x0010,0x0010);
- std::string s2 = document.GetEntry(0x0010,0x0010);
+ std::string s1 = GetEntryValue(0x0010,0x0010);
+ std::string s2 = document.GetEntryValue(0x0010,0x0010);
if(s1 < s2)
{
return true;
else
{
// Patient ID
- s1 = GetEntry(0x0010,0x0020);
- s2 = document.GetEntry(0x0010,0x0020);
+ s1 = GetEntryValue(0x0010,0x0020);
+ s2 = document.GetEntryValue(0x0010,0x0020);
if ( s1 < s2 )
{
return true;
else
{
// Study Instance UID
- s1 = GetEntry(0x0020,0x000d);
- s2 = document.GetEntry(0x0020,0x000d);
+ s1 = GetEntryValue(0x0020,0x000d);
+ s2 = document.GetEntryValue(0x0020,0x000d);
if ( s1 < s2 )
{
return true;
else
{
// Serie Instance UID
- s1 = GetEntry(0x0020,0x000e);
- s2 = document.GetEntry(0x0020,0x000e);
+ s1 = GetEntryValue(0x0020,0x000e);
+ s2 = document.GetEntryValue(0x0020,0x000e);
if ( s1 < s2 )
{
return true;
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.98 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.99 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// 4 methods with same name and different parameters ...
// Only C++ is aware!
- virtual bool SetEntry(std::string const &content,
+ virtual bool SetEntryValue(std::string const &content,
uint16_t group, uint16_t elem);
- virtual bool SetEntry(uint8_t *content, int lgth,
+ virtual bool SetEntryBinArea(uint8_t *content, int lgth,
uint16_t group, uint16_t elem);
- virtual bool SetEntry(std::string const &content, ValEntry *entry);
- virtual bool SetEntry(uint8_t *content, int lgth, BinEntry *entry);
+ virtual bool SetEntryValue(std::string const &content, ValEntry *entry);
+ virtual bool SetEntryBinArea(uint8_t *content, int lgth, BinEntry *entry);
virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:33 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ 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
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
- * \brief Constructor from a given ElementSet
+ * \brief Constructor for a given ElementSet
*/
//BOZ depthLevel is not usefull anymore
ElementSet::ElementSet(int depthLevel)
//-----------------------------------------------------------------------------
// Print
/**
- * \brief Prints the Header Entries (Dicom Elements)
- * from the H Table
+ * \brief Prints the Header Entries (Dicom Elements) from the H Table
* @param os ostream to write to
* @param indent Indentation string to be prepended during printing
*/
}
/**
- * \brief Searches within Header Entries (Dicom Elements) parsed with
- * the public and private dictionaries
- * for the element value representation of a given tag.
+ * \brief Get the (std::string representable) value of the Dicom entry
* @param group Group number of the searched tag.
* @param elem Element number of the searched tag.
- * @return Corresponding element value representation when it exists,
+ * @return Corresponding element value when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
-std::string ElementSet::GetEntry(uint16_t group, uint16_t elem)
+std::string ElementSet::GetEntryValue(uint16_t group, uint16_t elem)
{
TagKey key = DictEntry::TranslateToKey(group, elem);
if ( !TagHT.count(key))
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ 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
bool IsEmpty() { return TagHT.empty(); };
bool CheckIfEntryExist(uint16_t group, uint16_t elem);
- std::string GetEntry(uint16_t group, uint16_t elem);
+
+ std::string GetEntryValue(uint16_t group, uint16_t elem);
+ int GetEntryLength(uint16_t group, uint16_t elem);
+ std::string GetEntryVR(uint16_t group, uint16_t elem);
+
+ bool SetEntryValue(std::string const& content,
+ uint16_t group, uint16_t elem);
protected:
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.197 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ Version: $Revision: 1.198 $
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 = GetEntry(0x0028, 0x0200);
+ const std::string &imgLocation = GetEntryValue(0x0028, 0x0200);
if ( imgLocation == GDCM_UNFOUND )
{
// default value
* then writes in a file all the (Dicom Elements) included the Pixels
* @param fileName file name to write to
* @param filetype Type of the File to be written
- * (ACR-NEMA, ExplicitVR, ImplicitVR)
+ * (ACR, ExplicitVR, ImplicitVR)
*/
bool File::Write(std::string fileName, FileType filetype)
{
}
// Bits Allocated
- if ( GetEntry(0x0028,0x0100) == "12")
+ if ( GetEntryValue(0x0028,0x0100) == "12")
{
- SetEntry("16", 0x0028,0x0100);
+ SetEntryValue("16", 0x0028,0x0100);
}
/// \todo correct 'Pixel group' Length if necessary
// Drop Palette Color, if necessary
- if ( GetEntry(0x0028,0x0002).c_str()[0] == '3' )
+ if ( GetEntryValue(0x0028,0x0002).c_str()[0] == '3' )
{
// if SamplesPerPixel = 3, sure we don't need any LUT !
// Drop 0028|1101, 0028|1102, 0028|1103
return false;
}
- const std::string &res = GetEntry(0x0028, 0x0005);
+ const std::string &res = GetEntryValue(0x0028, 0x0005);
if ( res != GDCM_UNFOUND && atoi(res.c_str()) > 4 )
{
return false; // Image Dimensions
*/
int File::GetXSize()
{
- const std::string &strSize = GetEntry(0x0028,0x0011);
+ const std::string &strSize = GetEntryValue(0x0028,0x0011);
if ( strSize == GDCM_UNFOUND )
{
return 0;
*/
int File::GetYSize()
{
- const std::string &strSize = GetEntry(0x0028,0x0010);
+ const std::string &strSize = GetEntryValue(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 = GetEntry(0x0028,0x0008);
+ const std::string &strSize = GetEntryValue(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 = GetEntry(0x0028,0x0012);
+ const std::string &strSize2 = GetEntryValue(0x0028,0x0012);
if ( strSize2 != GDCM_UNFOUND )
{
return atoi( strSize2.c_str() );
float File::GetXSpacing()
{
float xspacing, yspacing;
- const std::string &strSpacing = GetEntry(0x0028,0x0030);
+ const std::string &strSpacing = GetEntryValue(0x0028,0x0030);
if ( strSpacing == GDCM_UNFOUND )
{
float File::GetYSpacing()
{
float yspacing = 1.;
- std::string strSpacing = GetEntry(0x0028,0x0030);
+ std::string strSpacing = GetEntryValue(0x0028,0x0030);
if ( strSpacing == GDCM_UNFOUND )
{
// Si le Spacing Between Slices est Missing,
// on suppose que les coupes sont jointives
- const std::string &strSpacingBSlices = GetEntry(0x0018,0x0088);
+ const std::string &strSpacingBSlices = GetEntryValue(0x0018,0x0088);
if ( strSpacingBSlices == GDCM_UNFOUND )
{
gdcmVerboseMacro("Unfound Spacing Between Slices (0018,0088)");
- const std::string &strSliceThickness = GetEntry(0x0018,0x0050);
+ const std::string &strSliceThickness = GetEntryValue(0x0018,0x0050);
if ( strSliceThickness == GDCM_UNFOUND )
{
gdcmVerboseMacro("Unfound Slice Thickness (0018,0050)");
{
float resInter = 0.;
/// 0028 1052 DS IMG Rescale Intercept
- const std::string &strRescInter = GetEntry(0x0028,0x1052);
+ const std::string &strRescInter = GetEntryValue(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 = GetEntry(0x0028,0x1053);
+ std::string strRescSlope = GetEntryValue(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 ( GetEntry(0x0028,0x0100) == "24" )
+ if ( GetEntryValue(0x0028,0x0100) == "24" )
{
return 3;
}
- std::string strPhotometricInterpretation = GetEntry(0x0028,0x0004);
+ std::string strPhotometricInterpretation = GetEntryValue(0x0028,0x0004);
if ( ( strPhotometricInterpretation == "PALETTE COLOR ") )
{
{
// 0028 0100 US IMG Bits Allocated
// (in order no to be messed up by old RGB images)
- if ( File::GetEntry(0x0028,0x0100) == "24" )
+ if ( File::GetEntryValue(0x0028,0x0100) == "24" )
{
return 3;
}
float File::GetXOrigin()
{
float xImPos, yImPos, zImPos;
- std::string strImPos = GetEntry(0x0020,0x0032);
+ std::string strImPos = GetEntryValue(0x0020,0x0032);
if ( strImPos == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)");
- strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images
+ strImPos = GetEntryValue(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
float File::GetYOrigin()
{
float xImPos, yImPos, zImPos;
- std::string strImPos = GetEntry(0x0020,0x0032);
+ std::string strImPos = GetEntryValue(0x0020,0x0032);
if ( strImPos == GDCM_UNFOUND)
{
gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)");
- strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images
+ strImPos = GetEntryValue(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
float File::GetZOrigin()
{
float xImPos, yImPos, zImPos;
- std::string strImPos = GetEntry(0x0020,0x0032);
+ std::string strImPos = GetEntryValue(0x0020,0x0032);
if ( strImPos != GDCM_UNFOUND )
{
}
}
- strImPos = GetEntry(0x0020,0x0030); // For ACR-NEMA images
+ strImPos = GetEntryValue(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos != GDCM_UNFOUND )
{
if( sscanf( strImPos.c_str(),
}
}
- std::string strSliceLocation = GetEntry(0x0020,0x1041); // for *very* old ACR-NEMA images
+ std::string strSliceLocation = GetEntryValue(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 = GetEntry(0x0020,0x0050);
+ std::string strLocation = GetEntryValue(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 = GetEntry(0x0020,0x0013);
+ std::string strImNumber = GetEntryValue(0x0020,0x0013);
if ( strImNumber != GDCM_UNFOUND )
{
return atoi( strImNumber.c_str() );
ModalityType File::GetModality()
{
// 0008 0060 CS ID Modality
- std::string strModality = GetEntry(0x0008,0x0060);
+ std::string strModality = GetEntryValue(0x0008,0x0060);
if ( strModality != GDCM_UNFOUND )
{
if ( strModality.find("AU") < strModality.length()) return AU;
*/
int File::GetBitsStored()
{
- std::string strSize = GetEntry( 0x0028, 0x0101 );
+ std::string strSize = GetEntryValue( 0x0028, 0x0101 );
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro("(0028,0101) is supposed to be mandatory");
*/
int File::GetHighBitPosition()
{
- std::string strSize = GetEntry( 0x0028, 0x0102 );
+ std::string strSize = GetEntryValue( 0x0028, 0x0102 );
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "(0028,0102) is supposed to be mandatory");
*/
bool File::IsSignedPixelData()
{
- std::string strSize = GetEntry( 0x0028, 0x0103 );
+ std::string strSize = GetEntryValue( 0x0028, 0x0103 );
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "(0028,0103) is supposed to be mandatory");
*/
int File::GetBitsAllocated()
{
- std::string strSize = GetEntry(0x0028,0x0100);
+ std::string strSize = GetEntryValue(0x0028,0x0100);
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "(0028,0100) is supposed to be mandatory");
*/
int File::GetSamplesPerPixel()
{
- const std::string& strSize = GetEntry(0x0028,0x0002);
+ const std::string& strSize = GetEntryValue(0x0028,0x0002);
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "(0028,0002) is supposed to be mandatory");
*/
bool File::IsMonochrome()
{
- const std::string& PhotometricInterp = GetEntry( 0x0028, 0x0004 );
+ const std::string& PhotometricInterp = GetEntryValue( 0x0028, 0x0004 );
if ( Util::DicomStringEqual(PhotometricInterp, "MONOCHROME1")
|| Util::DicomStringEqual(PhotometricInterp, "MONOCHROME2") )
{
*/
bool File::IsPaletteColor()
{
- std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 );
+ std::string PhotometricInterp = GetEntryValue( 0x0028, 0x0004 );
if ( PhotometricInterp == "PALETTE COLOR " )
{
return true;
*/
bool File::IsYBRFull()
{
- std::string PhotometricInterp = GetEntry( 0x0028, 0x0004 );
+ std::string PhotometricInterp = GetEntryValue( 0x0028, 0x0004 );
if ( PhotometricInterp == "YBR_FULL" )
{
return true;
*/
int File::GetPlanarConfiguration()
{
- std::string strSize = GetEntry(0x0028,0x0006);
+ std::string strSize = GetEntryValue(0x0028,0x0006);
if ( strSize == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Not found : Planar Configuration (0028,0006)");
{
// 0028 0100 US IMG Bits Allocated
// (in order no to be messed up by old RGB images)
- // if (File::GetEntry(0x0028,0x0100) == "24")
+ // if (File::GetEntryValue(0x0028,0x0100) == "24")
// return 3;
std::string pixelType = GetPixelType();
*/
std::string File::GetPixelType()
{
- std::string bitsAlloc = GetEntry(0x0028, 0x0100); // Bits Allocated
+ std::string bitsAlloc = GetEntryValue(0x0028, 0x0100); // Bits Allocated
if ( bitsAlloc == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Missing Bits Allocated (0028,0100)");
bitsAlloc = "8"; // by old RGB images)
}
- std::string sign = GetEntry(0x0028, 0x0103);//"Pixel Representation"
+ std::string sign = GetEntryValue(0x0028, 0x0103);//"Pixel Representation"
if (sign == GDCM_UNFOUND )
{
//Just hope Lookup Table Desc-Red = Lookup Table Desc-Red
// = Lookup Table Desc-Blue
// Consistency already checked in GetLUTLength
- std::string lutDescription = GetEntry(0x0028,0x1101);
+ std::string lutDescription = GetEntryValue(0x0028,0x1101);
if ( lutDescription == GDCM_UNFOUND )
{
return 0;
bool File::AnonymizeFile()
{
// If exist, replace by spaces
- SetEntry (" ",0x0010, 0x2154); // Telephone
- SetEntry (" ",0x0010, 0x1040); // Adress
- SetEntry (" ",0x0010, 0x0020); // Patient ID
+ SetEntryValue (" ",0x0010, 0x2154); // Telephone
+ SetEntryValue (" ",0x0010, 0x1040); // Adress
+ SetEntryValue (" ",0x0010, 0x0020); // Patient ID
DocEntry* patientNameHE = GetDocEntry (0x0010, 0x0010);
if ( patientNameHE ) // we replace it by Study Instance UID (why not)
{
- std::string studyInstanceUID = GetEntry (0x0020, 0x000d);
+ std::string studyInstanceUID = GetEntryValue (0x0020, 0x000d);
if ( studyInstanceUID != GDCM_UNFOUND )
{
ReplaceOrCreate(studyInstanceUID, 0x0010, 0x0010);
iop[0] = iop[1] = iop[2] = iop[3] = iop[4] = iop[5] = 0.;
// 0020 0037 DS REL Image Orientation (Patient)
- if ( (strImOriPat = GetEntry(0x0020,0x0037)) != GDCM_UNFOUND )
+ if ( (strImOriPat = GetEntryValue(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 = GetEntry(0x0020,0x0035)) != GDCM_UNFOUND )
+ else if ( (strImOriPat = GetEntryValue(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 )
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ 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
* 'image' Pixels are presented as C-like 2D arrays : line per line.
* 'volume'Pixels are presented as C-like 3D arrays : plane per plane
* \warning Since the pixels are not copied, it is the caller's responsability
- * not to deallocate it's data before gdcm uses them (e.g. with
+ * not to deallocate its data before gdcm uses them (e.g. with
* the Write() method.
* @param inData user supplied pixel area
* @param expectedSize total image size, in Bytes
}
/**
- * \brief Set the image datas defined by the user
- * \warning When writting the file, this datas are get as default datas to write
+ * \brief Set the image data defined by the user
+ * \warning When writting the file, this data are get as default data to write
*/
void FileHelper::SetUserData(uint8_t *data, size_t expectedSize)
{
}
/**
- * \brief Get the image datas defined by the user
- * \warning When writting the file, this datas are get as default data to write
+ * \brief Get the image data defined by the user
+ * \warning When writting the file, this data are get as default data to write
*/
uint8_t *FileHelper::GetUserData()
{
/**
* \brief Get the image data size defined by the user
- * \warning When writting the file, this datas are get as default data to write
+ * \warning When writting the file, this data are get as default data to write
*/
size_t FileHelper::GetUserDataSize()
{
}
/**
- * \brief Get the image datas from the file.
+ * \brief Get the image data from the file.
* If a LUT is found, the data are expanded to be RGB
*/
uint8_t *FileHelper::GetRGBData()
}
/**
- * \brief Get the image datas from the file.
- * If a LUT is found, the datas are not expanded !
+ * \brief Get the image data from the file.
+ * If a LUT is found, the data are not expanded !
*/
uint8_t *FileHelper::GetRawData()
{
* @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool FileHelper::SetEntry(std::string const &content,
+bool FileHelper::SetEntryValue(std::string const &content,
uint16_t group, uint16_t elem)
{
- return FileInternal->SetEntry(content,group,elem);
+ return FileInternal->SetEntryValue(content,group,elem);
}
* the given value.
* @param content new value (void* -> uint8_t*) to substitute with
* @param lgth new value length
- * @param group group number of the Dicom Element to modify
+ * @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool FileHelper::SetEntry(uint8_t *content, int lgth,
+bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth,
uint16_t group, uint16_t elem)
{
- return FileInternal->SetEntry(content,lgth,group,elem);
+ return FileInternal->SetEntryBinArea(content,lgth,group,elem);
}
/**
* The tests made are :
* - verify the size of the image to write with the possible write
* when the user set an image data
- * @return true if the check successfulls
+ * @return true if check is successfull
*/
bool FileHelper::CheckWriteIntegrity()
{
Program: gdcm
Module: $RCSfile: gdcmFileHelper.h,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/24 16:10:52 $
+ 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
void SetImageData(uint8_t *data, size_t expectedSize);
- // User datas
+ // User data
void SetUserData(uint8_t *data, size_t expectedSize);
uint8_t* GetUserData();
size_t GetUserDataSize();
- // RBG datas (from file
+ // RBG data (from file
uint8_t* GetRGBData();
size_t GetRGBDataSize();
- // RAW datas (from file
+ // RAW data (from file
uint8_t* GetRawData();
size_t GetRawDataSize();
bool WriteAcr (std::string const &fileName);
bool Write (std::string const &fileName);
- bool SetEntry(std::string const &content,
+ bool SetEntryValue(std::string const &content,
uint16_t group, uint16_t elem);
- bool SetEntry(uint8_t *content, int lgth,
+ bool SetEntryBinArea(uint8_t *content, int lgth,
uint16_t group, uint16_t elem);
bool ReplaceOrCreate(std::string const &content,
uint16_t group, uint16_t elem);
Program: gdcm
Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:42 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ 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
*/
void RLEFramesInfo::Print( std::ostream &os, std::string indent )
{
+ os << std::endl;
os << indent
<< "----------------- RLE frames --------------------------------"
<< std::endl;
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.56 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ Version: $Revision: 1.57 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Writer
+ * @param fp file pointer to an already open file.
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void SQItem::WriteContent(std::ofstream *fp, FileType filetype)
{
// Public
/**
* \brief adds any Entry (Dicom Element) to the Sequence Item
+ * @param entry Entry to add
*/
bool SQItem::AddEntry(DocEntry *entry)
{
* \warning we suppose, right now, the element belongs to a Public Group
* (NOT a shadow one)
* @param val string value to set
- * @param group Group number of the searched tag.
+ * @param group Group number of the searched tag.
* @param elem Element number of the searched tag.
* @return true if element was found or created successfully
*/
-bool SQItem::SetEntry(std::string const &val, uint16_t group,
+bool SQItem::SetEntryValue(std::string const &val, uint16_t group,
uint16_t elem)
{
for(ListDocEntry::iterator i = DocEntries.begin();
/**
* \brief Clear the std::list from given entry AND delete the entry.
* @param entryToRemove Entry to remove AND delete.
- * \warning Some problems when using under Windows... prefer the use of
- * Initialize / GetNext methods
* @return true if the entry was found and removed; false otherwise
*/
bool SQItem::RemoveEntry( DocEntry* entryToRemove)
}
/**
- * \brief Get the first entry while visiting the SQItem
+ * \brief Get the first Dicom entry while visiting the SQItem
* \return The first DocEntry if found, otherwhise 0
*/
DocEntry * SQItem::GetFirstEntry()
}
/**
- * \brief Get the next entry while visiting the chained list
+ * \brief Get the next Dicom entry while visiting the chained list
* \return The next DocEntry if found, otherwhise NULL
*/
DocEntry *SQItem::GetNextEntry()
// Protected
/**
* \brief Gets a Dicom Element inside a SQ Item Entry
- * @param group Group number of the Entry
+ * @param group Group number of the Entry
* @param elem Element number of the Entry
* @return Entry whose (group,elem) was passed. 0 if not found
*/
/**
* \brief Gets a Dicom Element inside a SQ Item Entry
- * @param group Group number of the Entry
+ * @param group Group number of the Entry
* @param elem Element number of the Entry
* @return Entry whose (group,elem) was passed. 0 if not found
*/
* GDCM_UNFOUND if not found
*/
-std::string SQItem::GetEntry(uint16_t group, uint16_t elem)
+std::string SQItem::GetEntryValue(uint16_t group, uint16_t elem)
{
/*
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:39:49 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BinEntry *GetBinEntry(uint16_t group, uint16_t elem);
SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
- bool SetEntry(std::string const &val, uint16_t group,
+ bool SetEntryValue(std::string const &val, uint16_t group,
uint16_t elem);
- std::string GetEntry(uint16_t group, uint16_t elem);
+ std::string GetEntryValue(uint16_t group, uint16_t elem);
/// \brief returns the ordinal position of a given SQItem
int GetSQItemNumber() { return SQItemNumber; };
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ Version: $Revision: 1.50 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Public
/*
* \brief canonical Writer
+ * @param fp pointer to an already open file
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:55 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ 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
if( header->IsReadable() )
{
// 0020 000e UI REL Series Instance UID
- std::string uid = header->GetEntry (0x0020, 0x000e);
+ std::string uid = header->GetEntryValue (0x0020, 0x000e);
// if uid == GDCM_UNFOUND then consistenly we should find GDCM_UNFOUND
// no need here to do anything special
if( CurrentSerieUID == "" )
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2005/01/24 16:10:53 $
+ Version: $Revision: 1.50 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
os << "V ";
DocEntry::Print(os);
- if (g == 0xfffe)
+ if (g == 0xfffe) // delimiters have NO value
{
// just to avoid identing all the remaining code
return;
/**
* \brief Writes the std::string representable' value of a ValEntry
* @param fp already open ofstream pointer
- * @param filetype type of the file to be written
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
const VRKey &vr = GetVR();
unsigned int lgr = GetLength();
- //std::cout<<std::hex<<GetGroup()<<"|"<<GetElement()
- // <<std::dec<<" : "<<GetReadLength()<<" / "<<GetLength()<<"\n";
if (vr == "US" || vr == "SS")
{
- // some 'Short integer' fields may be mulivaluated
+ // some 'Short integer' fields may be multivaluated
// each single value is separated from the next one by '\'
// we split the string and write each value as a short int
std::vector<std::string> tokens;
if (vr == "UL" || vr == "SL")
{
// Some 'Integer' fields may be multivaluated (multiple instances
- // of integers). But each single integer value is separated from the
+ // of integer). But each single integer value is separated from the
// next one by '\' (backslash character). Hence we split the string
// along the '\' and write each value as an int:
std::vector<std::string> tokens;