From 71f64e7a420374811ea79d211d5558dd103bcfe8 Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 13 Jan 2004 16:46:55 +0000 Subject: [PATCH] doxygenation improvement --- src/gdcmDictEntry.cxx | 2 +- src/gdcmElValSet.cxx | 34 +++++++++++++++++++--------------- src/gdcmFile.h | 10 +++++----- src/gdcmHeader.cxx | 13 ++++--------- src/gdcmHeader.h | 10 ++++++---- src/gdcmParse.cxx | 2 +- 6 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index 7ad40bee..ee04a0c6 100644 --- a/src/gdcmDictEntry.cxx +++ b/src/gdcmDictEntry.cxx @@ -39,7 +39,7 @@ gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement, * \brief concatenates 2 guint16 (supposed to be a Dicom group number * and a Dicom element number) * @param group the Dicom group number used to build the tag - * @param group the Dicom element number used to build the tag + * @param element the Dicom element number used to build the tag * return the built tag */ diff --git a/src/gdcmElValSet.cxx b/src/gdcmElValSet.cxx index fb99ba16..58f87458 100644 --- a/src/gdcmElValSet.cxx +++ b/src/gdcmElValSet.cxx @@ -42,7 +42,10 @@ void gdcmElValSet::Print(std::ostream & os) { TSKey v; std::string d2; gdcmTS * ts = gdcmGlobal::GetTS(); + std::ostringstream s; + + s << "------------- using tagHt ---------------------" << std::endl; // Tag HT s << "------------- using tagHt ---------------------" << std::endl; @@ -80,7 +83,9 @@ void gdcmElValSet::Print(std::ostream & os) { guint32 lgth; char greltag[10]; //group element tag + s << "------------ using listElem -------------------" << std::endl; + for (ListTag::iterator i = listElem.begin(); i != listElem.end(); ++i){ @@ -144,8 +149,8 @@ void gdcmElValSet::Add(gdcmElValue * newElValue) { * if you think it's NOT UNIQUE, check the count number * and use iterators to retrieve ALL the Dicoms Elements within * a given couple (group, element) - * @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 element Element number of the searched Dicom Element * @return */ gdcmElValue* gdcmElValSet::GetElementByNumber(guint16 group, guint16 element) { @@ -158,8 +163,8 @@ gdcmElValue* gdcmElValSet::GetElementByNumber(guint16 group, guint16 element) { /** * \ingroup gdcmElValSet * \brief Gets the value (string) of the target Dicom Element - * @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 element Element number of the searched Dicom Element * @return */ std::string gdcmElValSet::GetElValueByNumber(guint16 group, guint16 element) { @@ -173,8 +178,8 @@ std::string gdcmElValSet::GetElValueByNumber(guint16 group, guint16 element) { * \ingroup gdcmElValSet * \brief Sets the value (string) of the target Dicom Element * @param content string value of the Dicom Element - * @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 element Element number of the searched Dicom Element * @return */ bool gdcmElValSet::SetElValueByNumber(std::string content, @@ -222,8 +227,8 @@ bool gdcmElValSet::SetElValueByNumber(std::string content, * \brief Sets the value length of the Dicom Element * \warning : use with caution ! * @param length - * @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 element Element number of the searched Dicom Element * @return boolean */ bool gdcmElValSet::SetElValueLengthByNumber(guint32 length, @@ -237,13 +242,12 @@ bool gdcmElValSet::SetElValueLengthByNumber(guint32 length, return true ; } - /** * \ingroup gdcmElValSet * \brief Sets a 'non string' value to a given Dicom Element * @param area - * @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 element Element number of the searched Dicom Element * @return */ bool gdcmElValSet::SetVoidAreaByNumber(void * area, @@ -276,12 +280,12 @@ guint32 gdcmElValSet::GenerateFreeTagKeyInGroup(guint16 group) { * \ingroup gdcmElValSet * \brief Checks if a given Dicom Element exists * \ within the H table - * @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 element Element number of the searched Dicom Element * @return number of occurences */ -int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) { - std::string key = gdcmDictEntry::TranslateToKey(Group, Elem ); +int gdcmElValSet::CheckIfExistByNumber(guint16 group, guint16 element ) { + std::string key = gdcmDictEntry::TranslateToKey(group, element ); return (tagHt.count(key)); } diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 6773662c..dcf6f704 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -57,19 +57,19 @@ public: // TODO Swig int Write(); // Write pixels of ONE image on hard drive - // No test is made on processor "stupidity" + // No test is made on processor "endianity" // The user must call his reader correctly bool WriteRawData (std::string fileName); bool WriteDcmImplVR(std::string fileName); bool WriteDcmImplVR(const char * fileName); bool WriteDcmExplVR(std::string fileName); bool WriteAcr (std::string fileName); - -protected: - bool WriteBase(std::string FileName, FileType type); - + // Body in file gdcmParse.cxx bool ParsePixelData(void); + +protected: + bool WriteBase(std::string FileName, FileType type); private: void SwapZone(void* im, int swap, int lgr, int nb); diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index cbe330c0..a8966f15 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -82,6 +82,7 @@ gdcmHeader::~gdcmHeader (void) { //----------------------------------------------------------------------------- // Print + /** * \ingroup gdcmHeader * \brief @@ -102,6 +103,7 @@ void gdcmHeader::PrintPubDict(std::ostream & os) { //----------------------------------------------------------------------------- // Public + /** * \ingroup gdcmHeader * \brief This predicate, based on hopefully reasonable heuristics, @@ -795,7 +797,7 @@ std::string gdcmHeader::GetTransfertSyntaxName(void) { // use the gdcmTS (TS : Transfert Syntax) std::string TransfertSyntax = GetPubElValByNumber(0x0002,0x0010); if (TransfertSyntax == GDCM_UNFOUND) { - dbg.Verbose(0, "gdcmHeader::GetTransferSyntaxName: unfound Transfert Syntax (0002,0010)"); + dbg.Verbose(0, "gdcmHeader::GetTransfertSyntaxName: unfound Transfert Syntax (0002,0010)"); return "Uncompressed ACR-NEMA"; } // we do it only when we need it @@ -1439,6 +1441,7 @@ void gdcmHeader::LoadElements(void) { * \brief Loads the element content if it's length is not bigger * than the value specified with * gdcmHeader::SetMaxSizeLoadElementValue() + * @param ElVal string value of the Dicom Element */ void gdcmHeader::LoadElementValue(gdcmElValue * ElVal) { size_t item_read; @@ -1449,14 +1452,6 @@ void gdcmHeader::LoadElementValue(gdcmElValue * ElVal) { fseek(fp, (long)ElVal->GetOffset(), SEEK_SET); - // FIXME Sequences not treated yet ! - // - // Ne faudrait-il pas au contraire trouver immediatement - // une maniere 'propre' de traiter les sequences (vr = SQ) - // car commencer par les ignorer risque de conduire a qq chose - // qui pourrait ne pas etre generalisable - // Well, I'm expecting your code !!! - // the test was commented out to 'go inside' the SeQuences // we don't any longer skip them ! diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index 23df5390..31d98776 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -135,10 +135,15 @@ public: inline int GetSwapCode(void) { return sw; } guint16 SwapShort(guint16); // needed by gdcmFile guint32 SwapLong(guint32); // for JPEG Files + + // was protected + bool ReplaceOrCreateByNumber(std::string Value, guint16 Group, guint16 Elem); + bool ReplaceOrCreateByNumber( char * Value, guint16 Group, guint16 Elem); + bool ReplaceIfExistByNumber ( char * Value, guint16 Group, guint16 Elem); protected: - gdcmElValue * GetElValueByNumber(guint16 group, guint16 element); bool CheckIfExistByNumber(guint16 Group, guint16 Elem ); + gdcmElValue * GetElValueByNumber(guint16 group, guint16 element); int write(std::ostream&); int anonymize(std::ostream&); // FIXME : anonymize should be a friend ? @@ -147,9 +152,6 @@ protected: void * GetPubElValVoidAreaByNumber(guint16 Group, guint16 Elem); void * LoadElementVoidArea (guint16 Group, guint16 Element); - bool ReplaceOrCreateByNumber(std::string Value, guint16 Group, guint16 Elem); - bool ReplaceOrCreateByNumber( char * Value, guint16 Group, guint16 Elem); - bool ReplaceIfExistByNumber ( char * Value, guint16 Group, guint16 Elem); // Variables FILE * fp; diff --git a/src/gdcmParse.cxx b/src/gdcmParse.cxx index 57a09dac..b79efb72 100644 --- a/src/gdcmParse.cxx +++ b/src/gdcmParse.cxx @@ -29,7 +29,7 @@ */ bool gdcmFile::ParsePixelData(void) { // DO NOT remove the printf s. -// The ONLY purpose of this methos is to PRINT the content +// The ONLY purpose of this method is to PRINT the content FILE *fp; if ( !(fp=Header->OpenFile())) -- 2.48.1