From b616acd3a7a3dc34524e9f2482d70b25a6e1beff Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 26 Jan 2005 09:49:53 +0000 Subject: [PATCH] Typo --- Example/TestPapyrus.cxx | 17 +++-------------- src/gdcmContentEntry.cxx | 13 +++++-------- src/gdcmDicomDir.cxx | 18 ++---------------- src/gdcmDicomDirElement.h | 13 ++++++------- src/gdcmDocEntry.cxx | 11 ++++------- src/gdcmDocEntrySet.cxx | 33 +++++++++++++++++++++------------ src/gdcmDocument.cxx | 20 +++++++++++--------- src/gdcmFile.cxx | 10 ++-------- src/gdcmSQItem.cxx | 18 +++++++----------- 9 files changed, 61 insertions(+), 92 deletions(-) diff --git a/Example/TestPapyrus.cxx b/Example/TestPapyrus.cxx index d82083b0..1dd3e144 100644 --- a/Example/TestPapyrus.cxx +++ b/Example/TestPapyrus.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestPapyrus.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:22 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/26 09:49:53 $ + 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 @@ -147,7 +147,6 @@ int main(int argc, char* argv[]) // inside the loop // Get caracteristics of the first image - SamplesPerPixel = sqi->GetEntryValue(0x0028,0x0002); Rows = sqi->GetEntryValue(0x0028,0x0010); Columns = sqi->GetEntryValue(0x0028,0x0011); @@ -165,20 +164,10 @@ int main(int argc, char* argv[]) int lgrImage = iRows*iColumns * iSamplesPerPixel * (iBitsAllocated/8); // compute number of images - int nbImages = seqPapyrus->GetNumberOfSQItems(); -/* - int nbImages = 0; - while (sqi) - { - nbImages++; - sqi = seqPapyrus->GetNextSQItem(); - } -*/ std::cout <<"Number of frames :" << nbImages << std::endl; // allocate enough room to get the pixels of all images. - uint8_t *PixelArea = new uint8_t[lgrImage*nbImages]; uint8_t *currentPosition = PixelArea; gdcm::BinEntry *pixels; @@ -234,7 +223,7 @@ int main(int argc, char* argv[]) n->InsertValEntry(MediaStSOPinstUID, 0x0002,0x0002); // Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian) // since using Papyrus one (Implicit VR Little Endian) is a mess - //n->Insert(TransferSyntax, 0x0002,0x0010); + //n->InsertValEntry(TransferSyntax, 0x0002,0x0010); n->InsertValEntry(StudyDate, 0x0008,0x0020); n->InsertValEntry(StudyTime, 0x0008,0x0030); n->InsertValEntry(Modality, 0x0008,0x0060); diff --git a/src/gdcmContentEntry.cxx b/src/gdcmContentEntry.cxx index 3c1ed7c4..c09cfb78 100644 --- a/src/gdcmContentEntry.cxx +++ b/src/gdcmContentEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmContentEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 16:32:45 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/26 09:49:53 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,13 +28,10 @@ namespace gdcm { -// CLEAN ME -#define MAX_SIZE_PRINT_ELEMENT_VALUE 128 - //----------------------------------------------------------------------------- // Constructor / Destructor /** - * \brief Constructor from a given DictEntry + * \brief Constructor for a given DictEntry * @param e Pointer to existing dictionary entry */ ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e) @@ -43,7 +40,7 @@ ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e) } /** - * \brief Constructor from a given DocEntry + * \brief Constructor for a given DocEntry * @param e Pointer to existing Doc entry */ ContentEntry::ContentEntry(DocEntry *e) @@ -64,7 +61,7 @@ ContentEntry::~ContentEntry () // Public /** - * \brief Writes the std::string representable' value of a ContentEntry + * \brief Writes the 'std::string representable' value of a ContentEntry * @param fp already open ofstream pointer * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...) */ diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 97d1f3de..80591ac0 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:23 $ - Version: $Revision: 1.118 $ + Date: $Date: 2005/01/26 09:49:53 $ + Version: $Revision: 1.119 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -472,7 +472,6 @@ DicomDirMeta *DicomDir::NewMeta() // to be able to remove any direct reference to TagHT DocEntry *entry = GetFirstEntry(); if( entry ) - //if ( TagHT.begin() != TagHT.end() ) // after Document Parsing { MetaElems = new DicomDirMeta(true); @@ -487,16 +486,6 @@ DicomDirMeta *DicomDir::NewMeta() entry = GetFirstEntry(); } - /*TagDocEntryHT::iterator lastOneButSequence = TagHT.end(); - lastOneButSequence --; - // ALL the 'out of Sequence' Tags belong to Meta Elems - // (we skip 0004|1220 [Directory record sequence] ) - for ( TagDocEntryHT::iterator cc = TagHT.begin(); - cc != lastOneButSequence; - ++cc) - { - MetaElems->AddEntry( cc->second ); - }*/ } else // after root directory parsing { @@ -830,9 +819,6 @@ void DicomDir::CreateDicomDir() // neither an 'IMAGE' SQItem. Skip to next item. continue; } - - //if( si ) - //MoveSQItem(si,tmpSI); tmpSI=s->GetNextSQItem(); } // friend hunting : this one will be difficult to remove ! diff --git a/src/gdcmDicomDirElement.h b/src/gdcmDicomDirElement.h index 33b3a34f..c2b1afe7 100644 --- a/src/gdcmDicomDirElement.h +++ b/src/gdcmDicomDirElement.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirElement.h,v $ Language: C++ - Date: $Date: 2005/01/24 14:14:11 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/26 09:49:53 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,6 +27,10 @@ namespace gdcm { //----------------------------------------------------------------------------- +/** + * \brief internal structure, not end user intended + * shouln't appear here + */ GDCM_EXPORT typedef struct { /// DicomGroup number @@ -46,7 +50,6 @@ typedef std::list ListDicomDirImageElem; //----------------------------------------------------------------------------- /** - * \ingroup DicomDirElement * \brief Represents elements contained in a DicomDir * class for the chained lists from the file 'Dicts/DicomDir.dic' */ @@ -70,7 +73,6 @@ public: { return DicomDirMetaList; }; /** - * \ingroup DicomDirElement * \brief returns a reference to the chained List * related to the PATIENT Elements of a DICOMDIR. */ @@ -78,7 +80,6 @@ public: { return DicomDirPatientList; }; /** - * \ingroup DicomDirElement * \brief returns a reference to the chained List * related to the STUDY Elements of a DICOMDIR. */ @@ -86,7 +87,6 @@ public: { return DicomDirStudyList; }; /** - * \ingroup DicomDirElement * \brief returns a reference to the chained List * related to the SERIE Elements of a DICOMDIR. */ @@ -94,7 +94,6 @@ public: { return DicomDirSerieList; }; /** - * \ingroup DicomDirElement * \brief returns a reference to the chained List * related to the IMAGE Elements of a DICOMDIR. */ diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index 8dd098b0..c8e5b4ba 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/24 16:10:52 $ - Version: $Revision: 1.46 $ + Date: $Date: 2005/01/26 09:49:53 $ + Version: $Revision: 1.47 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -150,11 +150,8 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype) // Hence we skip writing the VR. // In order to avoid further troubles, we choose to write them // as 'no-length' Item Delimitors (we pad by writing 0xffffffff) - // The end of a given Item will be found when : - // - a new Item Delimitor Item is encountered (the Seq goes on) - // - a Sequence Delimitor Item is encountered (the Seq just ended) - - // TODO : verify if the Sequence Delimitor Item was forced during Parsing + // We shall force the end of a given Item by writting + // a Item Delimitation Item (fffe, e00d) uint32_t ff = 0xffffffff; binary_write(*fp, ff); diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 0616a1b6..9a44fc31 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 16:32:45 $ - Version: $Revision: 1.46 $ + Date: $Date: 2005/01/26 09:49:54 $ + Version: $Revision: 1.47 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -32,7 +32,7 @@ namespace gdcm //----------------------------------------------------------------------------- // Public /** - * \brief Get the (std::string representable) value of the Dicom entry + * \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 when it exists, @@ -48,7 +48,6 @@ std::string DocEntrySet::GetEntryValue(uint16_t group, uint16_t elem) /** * \brief Gets (from Header) a 'non string' element value - * (LoadElementValues has already be executed) * @param group group number of the Entry * @param elem element number of the Entry * @return Pointer to the 'non string' area @@ -79,7 +78,7 @@ int DocEntrySet::GetEntryLength(uint16_t group, uint16_t elem) /** * \brief Searches within Header Entries (Dicom Elements) parsed with - * the public and private dictionaries + * the public [and private dictionaries] * for the element value representation of a given tag.. * Obtaining the VR (Value Representation) might be needed by caller * to convert the string typed content to caller's native type @@ -119,15 +118,19 @@ ValEntry *DocEntrySet::GetValEntry(uint16_t group, uint16_t elem) * \brief Same as \ref Document::GetDocEntry except it only * returns a result when the corresponding entry is of type * BinEntry. - * @param group Group number of the searched Dicom Element - * @param elem Element number of the searched Dicom Element + * @param group Group number of the searched Dicom Element + * @param elem Element number of the searched Dicom Element * @return When present, the corresponding BinEntry. */ BinEntry *DocEntrySet::GetBinEntry(uint16_t group, uint16_t elem) { DocEntry *currentEntry = GetDocEntry(group, elem); if ( !currentEntry ) + { + gdcmVerboseMacro( "No corresponding BinEntry " << std::hex << group << + "," << elem); return NULL; + } return dynamic_cast(currentEntry); } @@ -144,7 +147,11 @@ SeqEntry *DocEntrySet::GetSeqEntry(uint16_t group, uint16_t elem) { DocEntry *currentEntry = GetDocEntry(group, elem); if ( !currentEntry ) + { + gdcmVerboseMacro( "No corresponding SeqEntry " << std::hex << group << + "," << elem); return NULL; + } return dynamic_cast(currentEntry); } @@ -163,7 +170,8 @@ bool DocEntrySet::SetValEntry(std::string const& content, ValEntry *entry = GetValEntry(group, elem); if (!entry ) { - gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); + gdcmVerboseMacro( "No corresponding ValEntry " << std::hex << group << + "," << elem << " element (try promotion first)."); return false; } return SetValEntry(content,entry); @@ -178,13 +186,14 @@ bool DocEntrySet::SetValEntry(std::string const& content, * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool DocEntrySet::SetBinEntry(uint8_t*content, int lgth, +bool DocEntrySet::SetBinEntry(uint8_t *content, int lgth, uint16_t group, uint16_t elem) { BinEntry *entry = GetBinEntry(group, elem); if (!entry ) { - gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); + gdcmVerboseMacro( "No corresponding ValEntry " << std::hex << group << + "," << elem << " element (try promotion first)."); return false; } @@ -532,8 +541,8 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem) /** - * \brief Searches both the public and the shadow dictionary (when they - * exist) for the presence of the DictEntry with given + * \brief Searches [both] the public [and the shadow dictionary (when they + * exist)] for the presence of the DictEntry with given * group and element, and create a new virtual DictEntry if necessary * @param group group number of the searched DictEntry * @param elem element number of the searched DictEntry diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index fcf5c290..5a66053d 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:23 $ - Version: $Revision: 1.210 $ + Date: $Date: 2005/01/26 09:49:54 $ + Version: $Revision: 1.211 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -192,6 +192,7 @@ Document::~Document () /** * \brief Prints The Dict Entries of THE public Dicom Dictionary + * @param os ostream to print to * @return */ void Document::PrintPubDict(std::ostream &os) @@ -202,6 +203,7 @@ void Document::PrintPubDict(std::ostream &os) /** * \brief Prints The Dict Entries of THE shadow Dicom Dictionary + * @param os ostream to print to * @return */ void Document::PrintShaDict(std::ostream &os) @@ -432,7 +434,6 @@ bool Document::CloseFile() delete Fp; Fp = 0; } - return true; //FIXME how do we detect a non-closed ifstream ? } @@ -441,14 +442,15 @@ bool Document::CloseFile() * @param fp file pointer on an already open file (actually: Output File Stream) * @param filetype Type of the File to be written * (ACR-NEMA, ExplicitVR, ImplicitVR) - * \return Always true. + * @return Always true. */ void Document::WriteContent(std::ofstream *fp, FileType filetype) { - /// \todo move the following lines (and a lot of others, to be written) - /// to a future function CheckAndCorrectHeader - /// (necessary if user wants to write a DICOM V3 file - /// starting from an ACR-NEMA (V2) Header + // \TODO move the following lines (and a lot of others, to be written) + // to a future function CheckAndCorrectHeader + + // (necessary if user wants to write a DICOM V3 file + // starting from an ACR-NEMA (V2) Header if ( filetype == ImplicitVR || filetype == ExplicitVR ) { @@ -459,7 +461,7 @@ void Document::WriteContent(std::ofstream *fp, FileType filetype) fp->write("DICM", 4); } -/** +/* * \todo rewrite later, if really usefull * - 'Group Length' element is optional in DICOM * - but un-updated odd groups lengthes can causes pb diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 17e4a80a..c58c8334 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:24 $ - Version: $Revision: 1.200 $ + Date: $Date: 2005/01/26 09:49:54 $ + Version: $Revision: 1.201 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -587,9 +587,6 @@ int File::GetNumberOfScalarComponentsRaw() // or Location (0020,0050) // as the Z coordinate, // 0. for all the coordinates if nothing is found - -// \todo find a way to inform the caller nothing was found -// \todo How to tell the caller a wrong number of values was found? // // --------------------------------------------------------------- // @@ -612,7 +609,6 @@ float File::GetXOrigin() if ( strImPos == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); - /// \todo How to tell the caller nothing was found ? return 0.; } } @@ -643,7 +639,6 @@ float File::GetYOrigin() if ( strImPos == GDCM_UNFOUND ) { gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); - /// \todo How to tell the caller nothing was found ? return 0.; } } @@ -1093,7 +1088,6 @@ size_t File::GetPixelOffset() } } -/// \todo TODO : unify those two (previous one and next one) /** * \brief Recover the pixel area length (in Bytes) * @return Pixel Element Length, as stored in the header diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 0431202c..bb907582 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:24 $ - Version: $Revision: 1.60 $ + Date: $Date: 2005/01/26 09:49:54 $ + 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 @@ -161,7 +161,6 @@ void SQItem::ClearEntry() bool SQItem::AddEntry(DocEntry *entry) { DocEntries.push_back(entry); - //TODO : check if it worked return true; } @@ -230,13 +229,10 @@ DocEntry * SQItem::GetFirstEntry() */ DocEntry *SQItem::GetNextEntry() { - // gdcmAssertMacro (ItDocEntries != DocEntries.end()); - { - ++ItDocEntries; - if (ItDocEntries != DocEntries.end()) - return *ItDocEntries; - return NULL; - } + ++ItDocEntries; + if (ItDocEntries != DocEntries.end()) + return *ItDocEntries; + return NULL; } /** @@ -250,7 +246,7 @@ 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()==elem ) + if ( (*i)->GetGroup() == group && (*i)->GetElement() == elem ) return *i; } return NULL; -- 2.48.1