From 1a11accd11061d63d3c09db7b1445637207e81e4 Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 24 Mar 2004 18:14:50 +0000 Subject: [PATCH] 2004-03-24 Jean-Pierre Roux * FIX a lot of little surface modifications to be doxygen 1.3.6 compliant --- ChangeLog | 4 +- Doc/DoxyInstallation.txt | 47 +++++++------- src/gdcmDicomDir.cxx | 118 ++++++++++++++++++++---------------- src/gdcmDicomDir.h | 34 +++++++++-- src/gdcmDicomDirPatient.cxx | 2 +- src/gdcmDicomDirSerie.cxx | 2 +- src/gdcmDicomDirStudy.cxx | 2 +- src/gdcmDictEntry.h | 27 ++++++--- src/gdcmDictSet.cxx | 5 +- src/gdcmDirList.cxx | 12 ++-- src/gdcmDirList.h | 7 ++- src/gdcmException.cxx | 12 ++-- src/gdcmException.h | 25 ++++---- src/gdcmFile.cxx | 2 +- src/gdcmHeader.cxx | 7 +-- src/gdcmHeaderHelper.cxx | 6 +- src/gdcmJpeg.cxx | 106 ++++++++++++++++---------------- src/gdcmJpeg12.cxx | 42 ++++++------- src/gdcmObject.cxx | 2 +- src/gdcmObject.h | 11 ++-- src/gdcmParser.cxx | 14 ++--- src/gdcmRLE.cxx | 2 +- src/gdcmUtil.cxx | 20 +++--- vtk/vtkGdcmReader.cxx | 2 +- 24 files changed, 275 insertions(+), 236 deletions(-) diff --git a/ChangeLog b/ChangeLog index 107bf87e..270348ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ - +2004-03-24 Jean-Pierre Roux + * FIX a lot of little surface modifications to be doxygen 1.3.6 compliant + 2004-03-23 Jean-Pierre Roux * FIX Now gdcmFile::SwapZone doesn't seg faults any longer for big endian made volumes diff --git a/Doc/DoxyInstallation.txt b/Doc/DoxyInstallation.txt index 304e8cc0..95a80569 100644 --- a/Doc/DoxyInstallation.txt +++ b/Doc/DoxyInstallation.txt @@ -2,10 +2,10 @@ * \page DoxyInstallation Installing gdcm and gdcmPython * \section DoxyRequirements Requirements * - For the core C++ library you shall need a C++ compiler with the - * and STL containers. Gdcm is developped and tested under: + * "list" and "map" STL containers. Gdcm is developped and tested under: * -# GNU/linux (gcc 2.96.x) * -# Win32/VC++ 6.x - * . + * . * - For \ref DoxyPythonComplete you shall need: * -# Python version 2.2.x * -# Swig version >= 1.3.17x (in order @@ -21,38 +21,39 @@ * the sources * * \endhtmlonly - * . + * . * . - * + * * \section DoxyInstallLinux Un*x * \subsection DoxyInstallLinuxCvs Starting from cvs sources. - * - Retrieve the - - sources through cvs, - * - cd gdcm - * - ./autogen.sh --help in order to select your preferences - * - ./autogen.sh to launch the usual automake/autoconf + * - Retrieve the + * + * sources through cvs, + * - cd gdcm + * - ./autogen.sh --help in order to select your preferences + * - ./autogen.sh to launch the usual automake/autoconf * process e.g. - * -# ./autogen.sh --prefix=/where/ever/you/want + * -# ./autogen.sh --prefix=/where/ever/you/want * to configure the script to force installation in a specified * place. - * -# ./autogen.sh --enable-python to generate the + * -# ./autogen.sh --enable-python to generate the * python wrappers (a.k.a. gdcmPython) - * -# ./autogen.sh --enable-vtk to generate the + * -# ./autogen.sh --enable-vtk to generate the * vtk clases that shallow wrap gdcm, - * -# ./autogen.sh --enable-doxygen to generate the + * -# ./autogen.sh --enable-doxygen to generate the * doxygen * based documentation - * . - * - make - * - make instal - * - As usual, you can optionnally: - * -# make clean - * -# make CFLAGS='-g' CXXFLAGS='-DPUB_DICT_PATH=\"/usr/local/share/gdcm/\" -D__STDC_LIMIT_MACROS' + * . + * . + * - make + * - make instal + * - As usual, you can optionnally: + * -# make clean + * -# make CFLAGS='-g' CXXFLAGS='-DPUB_DICT_PATH=\"/usr/local/share/gdcm/\" -D__STDC_LIMIT_MACROS' * if you are in hurry and want to omit "-g -O2" default flags - * -# make snapshot - * . - * . + * -# make snapshot + * . + * * \subsection DoxyInstallLinuxSources Starting from the sources (snapshot). * The process is exactly the same as the one using the cvs sources * (see above) except that you shall use ./configure instead diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index b74bad25..b5fba687 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -26,21 +26,23 @@ // Constructor / Destructor -/* +/** * \ingroup gdcmDicomDir - * \brief Constructor : Parses recursively the directory and creates the DicomDir - * \ or uses an already built DICOMDIR, depending on 'parseDir' value - * @param Name name of the root directory (parseDir = true) - * name of the DICOMDIR (parseDir = false) - * @param parseDir - true if user passed an entry point + * \brief Constructor Parses recursively the directory and creates the DicomDir + * or uses an already built DICOMDIR, depending on 'parseDir' value + * @param FileName name + - of the root directory (parseDir = true) + * - of the DICOMDIR (parseDir = false) + * @param parseDir boolean + * - true if user passed an entry point * and wants to explore recursively the directories - * - false if user passed an already built DICOMDIR file + * - false if user passed an already built DICOMDIR file * and wants to use it - * @param exception_on_error whether we want to throw an exception or not + * @param exception_on_error whether we want to throw an exception or not */ -gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir, +gdcmDicomDir::gdcmDicomDir(const char *FileName, bool parseDir, bool exception_on_error): - gdcmParser(Name,exception_on_error,true) // true : enable SeQuences + gdcmParser(FileName,exception_on_error,true) // true : enable SeQuences { // que l'on ai passe un root directory ou un DICOMDIR // et quelle que soit la valeur de parseDir, @@ -69,7 +71,7 @@ gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir, // if parseDir == false, it should be tagged as an error dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : entry list empty"); - if(strlen(Name)==1 && Name[0]=='.') { // user passed '.' as Name + if(strlen(FileName)==1 && FileName[0]=='.') { // user passed '.' as Name // we get current directory name char*dummy=(char*) malloc(1000); #ifdef _MSC_VER @@ -95,7 +97,7 @@ gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir, } } -/* +/** * \ingroup gdcmDicomDir * \brief Constructor : creates an empty gdcmDicomDir * @param exception_on_error whether we want to throw an exception or not @@ -122,7 +124,7 @@ gdcmDicomDir::gdcmDicomDir(bool exception_on_error): } -/* +/** * \ingroup gdcmDicomDir * \brief Canonical destructor */ @@ -143,7 +145,7 @@ gdcmDicomDir::~gdcmDicomDir() //----------------------------------------------------------------------------- // Print -/* +/** * \ingroup gdcmDicomDir * \brief Canonical Printer */ @@ -163,7 +165,7 @@ void gdcmDicomDir::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -/* +/** * \ingroup gdcmDicomDir * \brief This predicate, based on hopefully reasonable heuristics, * decides whether or not the current header was properly parsed @@ -184,7 +186,7 @@ bool gdcmDicomDir::IsReadable(void) return(true); } -/* +/** * \ingroup gdcmDicomDir * \brief fills the whole structure, starting from a root Directory */ @@ -194,11 +196,12 @@ void gdcmDicomDir::ParseDirectory(void) CreateDicomDir(); } -/* +/** * \ingroup gdcmDicomDir * \brief Set the start method to call when the parsing of the directory starts * @param method Method to call * @param arg Argument to pass to the method + * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ void gdcmDicomDir::SetStartMethod(gdcmMethod *method,void *arg,gdcmMethod *argDelete) @@ -211,7 +214,7 @@ void gdcmDicomDir::SetStartMethod(gdcmMethod *method,void *arg,gdcmMethod *argDe startMethodArgDelete=argDelete; } -/* +/** * \ingroup gdcmDicomDir * \brief Set the method to delete the argument * The argument is destroyed when the method is changed or when the @@ -223,11 +226,12 @@ void gdcmDicomDir::SetStartMethodArgDelete(gdcmMethod *method) startMethodArgDelete=method; } -/* +/** * \ingroup gdcmDicomDir * \brief Set the progress method to call when the parsing of the directory progress * @param method Method to call * @param arg Argument to pass to the method + * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ void gdcmDicomDir::SetProgressMethod(gdcmMethod *method,void *arg,gdcmMethod *argDelete) @@ -240,7 +244,7 @@ void gdcmDicomDir::SetProgressMethod(gdcmMethod *method,void *arg,gdcmMethod *ar progressMethodArgDelete=argDelete; } -/* +/** * \ingroup gdcmDicomDir * \brief Set the method to delete the argument * The argument is destroyed when the method is changed or when the @@ -252,14 +256,15 @@ void gdcmDicomDir::SetProgressMethodArgDelete(gdcmMethod *method) progressMethodArgDelete=method; } -/* +/** * \ingroup gdcmDicomDir * \brief Set the end method to call when the parsing of the directory ends * @param method Method to call * @param arg Argument to pass to the method + * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ -void gdcmDicomDir::SetEndMethod(gdcmMethod *method,void *arg,gdcmMethod *argDelete) +void gdcmDicomDir::SetEndMethod(gdcmMethod *method, void *arg, gdcmMethod *argDelete) { if((endArg)&&(endMethodArgDelete)) endMethodArgDelete(endArg); @@ -269,7 +274,7 @@ void gdcmDicomDir::SetEndMethod(gdcmMethod *method,void *arg,gdcmMethod *argDele endMethodArgDelete=argDelete; } -/* +/** * \ingroup gdcmDicomDir * \brief Set the method to delete the argument * The argument is destroyed when the method is changed or when the class @@ -373,7 +378,7 @@ void gdcmDicomDir::WriteDicomDirEntries(FILE *_fp) //----------------------------------------------------------------------------- // Protected -/* +/** * \ingroup gdcmDicomDir * \brief create a gdcmHeader-like chained list from a root Directory * @param path entry point of the tree-like structure @@ -418,7 +423,10 @@ void gdcmDicomDir::CreateDicomDirChainedList(std::string path) CallEndMethod(); } - +/** + * \ingroup gdcmDicomDir + * \brief modifies the limits of a gdcmObject, created from a DICOMDIR file + */ void gdcmDicomDir::CheckBoundaries() { @@ -453,7 +461,7 @@ void gdcmDicomDir::CheckBoundaries() } -/* +/** * \ingroup gdcmDicomDir * \brief adds a new Patient to a partially created DICOMDIR */ @@ -516,7 +524,7 @@ gdcmDicomDirPatient * gdcmDicomDir::NewPatient(void) { return p; } -/* +/** * \ingroup gdcmDicomDir * \brief CallStartMethod */ @@ -527,7 +535,7 @@ void gdcmDicomDir::CallStartMethod(void) if(startMethod) startMethod(startArg); } -/* +/** * \ingroup gdcmDicomDir * \brief CallProgressMethod */ @@ -536,7 +544,7 @@ void gdcmDicomDir::CallProgressMethod(void) if(progressMethod) progressMethod(progressArg); } -/* +/** * \ingroup gdcmDicomDir * \brief CallEndMethod */ @@ -549,7 +557,7 @@ void gdcmDicomDir::CallEndMethod(void) //----------------------------------------------------------------------------- // Private -/* +/** * \ingroup gdcmDicomDir * \brief create a 'gdcmDicomDir' from a DICOMDIR gdcmHeader */ @@ -609,12 +617,12 @@ void gdcmDicomDir::CreateDicomDir() if(begin!=end) AddObjectToEnd(type,begin,--end2); } -/* +/** * \ingroup gdcmDicomDir * \brief AddObjectToEnd * @param type - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddObjectToEnd(gdcmDicomDirType type,ListTag::iterator begin,ListTag::iterator end) { @@ -641,11 +649,11 @@ void gdcmDicomDir::AddObjectToEnd(gdcmDicomDirType type,ListTag::iterator begin, } } -/* +/** * \ingroup gdcmDicomDir * \brief Well ... Not realy to end, there is only one occurence - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddDicomDirMetaToEnd(ListTag::iterator begin,ListTag::iterator end) { @@ -654,22 +662,22 @@ void gdcmDicomDir::AddDicomDirMetaToEnd(ListTag::iterator begin,ListTag::iterato metaElems = new gdcmDicomDirMeta(begin,end,&tagHT,&listEntries); } -/* +/** * \ingroup gdcmDicomDir * \brief AddDicomDirPatientToEnd - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddDicomDirPatientToEnd(ListTag::iterator begin,ListTag::iterator end) { patients.push_back(new gdcmDicomDirPatient(begin,end,&tagHT, &listEntries)); } -/* +/** * \ingroup gdcmDicomDir * \brief AddDicomDirStudyToEnd - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddDicomDirStudyToEnd(ListTag::iterator begin,ListTag::iterator end) { @@ -680,11 +688,11 @@ void gdcmDicomDir::AddDicomDirPatientToEnd(ListTag::iterator begin,ListTag::iter (*itp)->AddDicomDirStudy(new gdcmDicomDirStudy(begin,end,&tagHT, &listEntries)); } } -/* +/** * \ingroup gdcmDicomDir * \brief AddDicomDirSerieToEnd - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddDicomDirSerieToEnd(ListTag::iterator begin,ListTag::iterator end) { @@ -702,11 +710,11 @@ void gdcmDicomDir::AddDicomDirSerieToEnd(ListTag::iterator begin,ListTag::iterat } } -/* +/** * \ingroup gdcmDicomDir * \brief AddDicomDirImageToEnd - * @param begin - * @param end + * @param begin iterator on the first HeaderEntry within the chained List + * @param end iterator on the last HeaderEntry within the chained List */ void gdcmDicomDir::AddDicomDirImageToEnd(ListTag::iterator begin,ListTag::iterator end) { @@ -730,7 +738,7 @@ void gdcmDicomDir::AddDicomDirSerieToEnd(ListTag::iterator begin,ListTag::iterat } } -/* +/** * \ingroup gdcmDicomDir * \brief for each Header of the chained list, add/update the Patient/Study/Serie/Image info * @param path path of the root directory @@ -782,7 +790,7 @@ void gdcmDicomDir::SetElements(std::string &path, ListHeader &list) } } -/* +/** * \ingroup gdcmDicomDir * \brief adds to the HTable and at the end of the Chained List * the gdcmEntries (Dicom Elements) corresponding to the given type @@ -893,13 +901,19 @@ void gdcmDicomDir::SetElement(std::string &path,gdcmDicomDirType type,gdcmHeader //wasUpdated = 1; // is private } } - +/** + * \ingroup gdcmDicomDir + * \brief compares two dgcmHeaders + */ bool gdcmDicomDir::HeaderLessThan(gdcmHeader *header1,gdcmHeader *header2) { return(*header1<*header2); } - +/** + * \ingroup gdcmDicomDir + * \brief Sets the accurate value for the (0x0004,0x1220) element of a DICOMDIR + */ void gdcmDicomDir::UpdateDirectoryRecordSequenceLength() { int offset = 0; diff --git a/src/gdcmDicomDir.h b/src/gdcmDicomDir.h index 7b2e724f..7f3fb538 100644 --- a/src/gdcmDicomDir.h +++ b/src/gdcmDicomDir.h @@ -74,10 +74,22 @@ public: void SetProgressMethodArgDelete(gdcmMethod *); void SetEndMethod(gdcmMethod *,void * =NULL,gdcmMethod * =NULL); void SetEndMethodArgDelete(gdcmMethod *); - - inline float GetProgress(void) {return(progress);}; - inline void AbortProgress(void){abort=true; }; - inline bool IsAborted(void) {return(abort); }; +/** + * \ingroup gdcmDicomDir + * \brief GetProgress. + */ + inline float GetProgress(void) + {return(progress);}; +/** + * \ingroup gdcmDicomDir + * \brief AbortProgress. + */ inline void AbortProgress(void) + {abort=true; }; +/** + * \ingroup gdcmDicomDir + * \brief IsAborted. + */ inline bool IsAborted(void) + {return(abort); }; // Adding gdcmDicomDirPatient * NewPatient(void); @@ -131,17 +143,27 @@ private: */ ListDicomDirPatient patients; +/// pointer to the initialisation method for any progress bar gdcmMethod *startMethod; - gdcmMethod *progressMethod; +/// pointer to the incrementation method for any progress bar + gdcmMethod *progressMethod; +/// pointer to the tremination method for any progress bar gdcmMethod *endMethod; +/// pointer to the ??? method for any progress bar gdcmMethod *startMethodArgDelete; +/// pointer to the ??? method for any progress bar gdcmMethod *progressMethodArgDelete; +/// pointer to the ??? method for any progress bar gdcmMethod *endMethodArgDelete; +/// pointer to the ??? for any progress bar void *startArg; +/// pointer to the ??? for any progress bar void *progressArg; +/// pointer to the ??? for any progress bar void *endArg; - +/// value of the ??? for any progress bar float progress; +/// value of the ??? for any progress bar bool abort; }; diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index 2859349e..2ab6f894 100644 --- a/src/gdcmDicomDirPatient.cxx +++ b/src/gdcmDicomDirPatient.cxx @@ -61,7 +61,7 @@ void gdcmDicomDirPatient::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -/* +/** * \ingroup gdcmDicomDir * \brief adds a new Patient at the begining of the PatientList * of a partially created DICOMDIR diff --git a/src/gdcmDicomDirSerie.cxx b/src/gdcmDicomDirSerie.cxx index 0c0caf0f..7324e059 100644 --- a/src/gdcmDicomDirSerie.cxx +++ b/src/gdcmDicomDirSerie.cxx @@ -60,7 +60,7 @@ void gdcmDicomDirSerie::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -/* +/** * \ingroup gdcmDicomSerie * \brief adds a new Image to a partially created DICOMDIR */ diff --git a/src/gdcmDicomDirStudy.cxx b/src/gdcmDicomDirStudy.cxx index 417af762..a2cf5859 100644 --- a/src/gdcmDicomDirStudy.cxx +++ b/src/gdcmDicomDirStudy.cxx @@ -62,7 +62,7 @@ void gdcmDicomDirStudy::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -/* +/** * \ingroup gdcmDicomStudy * \brief adds a new Serie at the begining of the SerieList * of a partially created DICOMDIR diff --git a/src/gdcmDictEntry.h b/src/gdcmDictEntry.h index cd329bd1..5828bfd7 100644 --- a/src/gdcmDictEntry.h +++ b/src/gdcmDictEntry.h @@ -102,22 +102,31 @@ private: guint16 group; // e.g. 0x0010 /// DicomElement number guint16 element; // e.g. 0x0103 - /// Value Representation i.e. some clue about the nature - /// of the data represented e.g. "FD" short for - /// "Floating Point Double" + /** + * \ingroup gdcmDictEntry + * \brief Value Representation i.e. some clue about the nature + * of the data represented + * e.g. "FD" short for "Floating Point Double" + */ std::string vr; // CLEANME: find the official dicom name for this field ! - - ///Fourth field containing some semantics. - ///(Group Name abbr.) - /// DON'T USER ANY LONGER ! + /** + * \ingroup gdcmDictEntry + * \brief Fourth field containing some semantics + * (Group Name abbr.) + * DON'T USER ANY LONGER ! + */ std::string fourth; - /// e.g. "Patient_Name" + /// e.g. "Patient's Name" std::string name; /// Redundant with (group, element) but we add it /// on efficiency purposes. - TagKey key; + /** + * \ingroup gdcmDictEntry + * \brief Redundant with (group, element) but we add it + * on efficiency purposes. + */ TagKey key; // DCMTK has many fields for handling a DictEntry (see below). What are the // relevant ones for gdcmlib ? diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 24a3eafb..d1e21100 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -85,8 +85,9 @@ std::list *gdcmDictSet::GetPubDictEntryNames(void) /** * \ingroup gdcmDictSet - * \brief - Consider all the entries of the public dicom dictionnary. - * Build an hashtable whose keys are the names of the groups + * \brief + * - Consider all the entries of the public dicom dictionnary. + * - Build an hashtable whose keys are the names of the groups * (fourth field in each line of dictionary) and whose corresponding * values are lists of all the dictionnary entries among that * group. Note that apparently the Dicom standard doesn't explicitely diff --git a/src/gdcmDirList.cxx b/src/gdcmDirList.cxx index 203c0a5f..f49c0ba9 100644 --- a/src/gdcmDirList.cxx +++ b/src/gdcmDirList.cxx @@ -21,12 +21,8 @@ #include #endif -// ================= WARNING -// ================= DOXYGEN DOESN'T WORK FOR THIS FILE ?!? -// ================= - // Constructor / Destructor -/* +/** * \ingroup gdcmDirList * \brief Constructor * @param dirName root directory name @@ -40,7 +36,7 @@ gdcmDirList::gdcmDirList(std::string dirName,bool recursive) Explore(name,recursive); } -/* +/** * \ingroup gdcmDirList * \brief Destructor */ @@ -53,7 +49,7 @@ gdcmDirList::~gdcmDirList(void) //----------------------------------------------------------------------------- // Public -/* +/** * \ingroup gdcmDirList * \brief Get the directory name * @return the directory name @@ -69,7 +65,7 @@ std::string gdcmDirList::GetDirName(void) //----------------------------------------------------------------------------- // Private -/* +/** * \ingroup gdcmDirList * \brief Explore a directory with possibility of recursion * @param dirName directory to explore diff --git a/src/gdcmDirList.h b/src/gdcmDirList.h index 5fa55a2b..6dd6624a 100644 --- a/src/gdcmDirList.h +++ b/src/gdcmDirList.h @@ -17,13 +17,16 @@ public : std::string GetDirName(void); +/// \ static const char SEPARATOR_X; - static const char SEPARATOR_WIN; +/// / +static const char SEPARATOR_WIN; +/// depending on the O.S. static const std::string SEPARATOR; private : void Explore(std::string dirName,bool recursive=false); - +/// name of the root directory to explore std::string name; }; diff --git a/src/gdcmException.cxx b/src/gdcmException.cxx index cc95e0cd..719c7744 100644 --- a/src/gdcmException.cxx +++ b/src/gdcmException.cxx @@ -8,7 +8,7 @@ //----------------------------------------------------------------------------- // gdcmException -/* +/** * \ingroup gdcmException * \brief constructor * @param f @@ -27,7 +27,7 @@ catch(...) { #endif -/* +/** * \ingroup gdcmException * \brief fatal * @param from @@ -50,7 +50,7 @@ catch(...) { } } -/* +/** * \ingroup gdcmException * \brief getName * @return string @@ -86,20 +86,18 @@ catch(...) { } } -/* +/** * \ingroup gdcmException * \brief gdcmException::operator - * @param */ gdcmException::operator const char *() const throw() { return getName().c_str(); } //----------------------------------------------------------------------------- -/* +/** * \ingroup gdcmException * \brief gdcmException::operator << - * @param */ std::ostream& operator<<(std::ostream &os, const gdcmException &e) { try { diff --git a/src/gdcmException.h b/src/gdcmException.h index 436d664a..510ef725 100644 --- a/src/gdcmException.h +++ b/src/gdcmException.h @@ -24,37 +24,37 @@ public: explicit gdcmException(const std::string &from, const std::string &error = "") throw(); - /* - * virtual destructor makes this class dynamic + /** + * \brief virtual destructor makes this class dynamic */ virtual ~gdcmException() throw() { } - // exception caught within exception class: print error message and die + /// exception caught within exception class: print error message and die static void fatal(const char *from) throw(); - // returns error message + /// returns error message const std::string &getError(void) const throw() { return error; } - // try to discover this (dynamic) class name + /// try to discover this (dynamic) class name virtual std::string getName() const throw(); - // returns exception name string (overloads std::exception::what) + /// returns exception name string (overloads std::exception::what) virtual const char *what() const throw() { return (const char *) *this; } - // returns exception name string + /// returns exception name string operator const char *() const throw(); friend std::ostream& operator<<(std::ostream &os, const gdcmException &e); protected: - // error message + /// error message part 1 std::string from; - // error message + /// error message part 2 std::string error; }; @@ -65,10 +65,9 @@ protected: */ class GDCM_EXPORT gdcmFileError : public gdcmException { public: - /* - * Builds an file-related exception with minimal information: name of - * the thrower method and error message - * + /** + * \brief Builds an file-related exception with minimal information: name of + * the thrower method and error message * @param from name of the thrower * @param error error description string */ diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 62e75550..8e84268d 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -79,7 +79,7 @@ gdcmFile::gdcmFile(std::string & filename) { /** * \ingroup gdcmFile * \brief canonical destructor - * \Note If the gdcmHeader is created by the gdcmFile, it is destroyed + * \note If the gdcmHeader is created by the gdcmFile, it is destroyed * by the gdcmFile */ gdcmFile::~gdcmFile(void) { diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 04c501ac..f230f4de 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -15,8 +15,8 @@ /** * \ingroup gdcmHeader * \brief Constructor - * @param InFilename - * @param exception_on_error + * @param InFilename name of the file whose header we want to analyze + * @param exception_on_error whether we want to throw an exception or not * @param enable_sequences = true to allow the header * to be parsed *inside* the SeQuences, * when they have an actual length @@ -63,7 +63,7 @@ gdcmHeader::gdcmHeader(const char *InFilename, /** * \ingroup gdcmHeader * \brief Constructor - * @param exception_on_error + * @param exception_on_error whether we want to throw an exception or not */ gdcmHeader::gdcmHeader(bool exception_on_error) : gdcmParser(exception_on_error) @@ -790,7 +790,6 @@ void gdcmHeader::SetImageDataSize(size_t ImageDataSize) { * \ingroup gdcmHeader * \brief anonymize a Header (removes Patient's personal info) * (read the code to see which ones ...) - * @param */ bool gdcmHeader::anonymizeHeader() { diff --git a/src/gdcmHeaderHelper.cxx b/src/gdcmHeaderHelper.cxx index 9cdab570..a9af79bc 100644 --- a/src/gdcmHeaderHelper.cxx +++ b/src/gdcmHeaderHelper.cxx @@ -280,8 +280,8 @@ int gdcmHeaderHelper::GetNumberOfScalarComponents() { /** * \ingroup gdcmHeaderHelper * \brief This function is intended to user that DOESN'T want - * \to get RGB pixels image when it's stored as a PALETTE COLOR image - * \ - the (vtk) user is supposed to know how deal with LUTs - + * to get RGB pixels image when it's stored as a PALETTE COLOR image + * - the (vtk) user is supposed to know how deal with LUTs - * \warning to be used with GetImagePixelsRaw() * @return 1 if Gray level, 3 if Color (RGB or YBR - NOT 'PALETTE COLOR' -) */ @@ -788,7 +788,7 @@ bool gdcmSerieHeaderHelper::ImagePositionPatientOrdering() bool gdcmSerieHeaderHelper::ImageNumberOrdering() { int min, max, pos; - int n = 0;//CoherentGdcmFileList.size(); //O(N) operation !! + int n = 0;//CoherentGdcmFileList.size() is a O(N) operation !! unsigned char *partition; std::list::iterator it = CoherentGdcmFileList.begin(); diff --git a/src/gdcmJpeg.cxx b/src/gdcmJpeg.cxx index 1f6e45f4..c2b93070 100644 --- a/src/gdcmJpeg.cxx +++ b/src/gdcmJpeg.cxx @@ -157,27 +157,26 @@ METHODDEF(void) my_error_exit (j_common_ptr cinfo) { * @return 1 on success, 0 on error */ -//GLOBAL(bool) bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { char *pimage; /* This struct contains the JPEG decompression parameters and pointers to - * working space (which is allocated as needed by the JPEG library). - */ + * working space (which is allocated as needed by the JPEG library). + */ struct jpeg_decompress_struct cinfo; /* -------------- inside, we found : - JDIMENSION image_width; // input image width - JDIMENSION image_height; // input image height - int input_components; // nb of color components in input image - J_COLOR_SPACE in_color_space; // colorspace of input image - double input_gamma; // image gamma of input image - -------------- */ + * JDIMENSION image_width; // input image width + * JDIMENSION image_height; // input image height + * int input_components; // nb of color components in input image + * J_COLOR_SPACE in_color_space; // colorspace of input image + * double input_gamma; // image gamma of input image + * -------------- */ /* We use our private extension JPEG error handler. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ + * Note that this struct must live as long as the main JPEG parameter + * struct, to avoid dangling-pointer problems. + */ struct my_error_mgr jerr; /* More stuff */ @@ -189,28 +188,26 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { // typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ // typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ // typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + int row_stride; /* physical row width in output buffer */ - if (DEBUG) printf("entree dans gdcmFile::gdcm_read_JPEG_file, depuis gdcmJpeg\n"); - + if (DEBUG) printf("entree dans gdcmFile::gdcm_read_JPEG_file12, depuis gdcmJpeg\n"); - /* In this example we want to open the input file before doing anything else, - * so that the setjmp() error recovery below can assume the file is open. - * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that - * requires it in order to read binary files. - */ - - /* Step 1: allocate and initialize JPEG decompression object */ - + /* In this example we want to open the input file before doing anything else, + * so that the setjmp() error recovery below can assume the file is open. + * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that + * requires it in order to read binary files. + */ + + /* Step 1: allocate and initialize JPEG decompression object */ if (DEBUG)printf("Entree Step 1\n"); - + /* We set up the normal JPEG error routines, then override error_exit. */ cinfo.err = jpeg_std_error(&jerr.pub); jerr.pub.error_exit = my_error_exit; - /* Establish the setjmp return context for my_error_exit to use. */ - + /* Establish the setjmp return context for my_error_exit to use. */ if (setjmp(jerr.setjmp_buffer)) { /* If we get here, the JPEG code has signaled an error. * We need to clean up the JPEG object, close the input file, and return. @@ -248,15 +245,14 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { } -/* - JDIMENSION image_width; // input image width - JDIMENSION image_height; // input image height - int output_components; // # of color components returned - J_COLOR_SPACE in_color_space; // colorspace of input image - double input_gamma; // image gamma of input image - int data_precision; // bits of precision in image data - -*/ + /* + * JDIMENSION image_width; // input image width + * JDIMENSION image_height; // input image height + * int output_components; // # of color components returned + * J_COLOR_SPACE in_color_space; // colorspace of input image + * double input_gamma; // image gamma of input image + * int data_precision; // bits of precision in image data + */ /* Step 4: set parameters for decompression */ if (DEBUG) printf("Entree Step 4\n"); @@ -267,23 +263,23 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { /* Step 5: Start decompressor */ if (DEBUG) printf("Entree Step 5\n"); - (void) jpeg_start_decompress(&cinfo); - /* We can ignore the return value since suspension is not possible - * with the stdio data source. - */ - - /* We may need to do some setup of our own at this point before reading - * the data. After jpeg_start_decompress() we have the correct scaled - * output image dimensions available, as well as the output colormap - * if we asked for color quantization. - * In this example, we need to make an output work buffer of the right size. - */ - - /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; + (void) jpeg_start_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* We may need to do some setup of our own at this point before reading + * the data. After jpeg_start_decompress() we have the correct scaled + * output image dimensions available, as well as the output colormap + * if we asked for color quantization. + * In this example, we need to make an output work buffer of the right size. + */ + + /* JSAMPLEs per row in output buffer */ + row_stride = cinfo.output_width * cinfo.output_components; if (DEBUG) printf ("cinfo.output_width %d cinfo.output_components %d row_stride %d\n", - cinfo.output_width, cinfo.output_components,row_stride); + cinfo.output_width, cinfo.output_components,row_stride); /* Make a one-row-high sample array that will go away when done with image */ buffer = (*cinfo.mem->alloc_sarray) @@ -304,10 +300,10 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { pimage=(char *)image_buffer; while (cinfo.output_scanline < cinfo.output_height) { - /* jpeg_read_scanlines expects an array of pointers to scanlines. - * Here the array is only one element long, but you could ask for - * more than one scanline at a time if that's more convenient. - */ + /* jpeg_read_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could ask for + * more than one scanline at a time if that's more convenient. + */ // l'image est deja allouée (et passée en param) // on ecrit directement les pixels @@ -328,8 +324,8 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { /* Step 7: Finish decompression */ if (DEBUG) printf("Entree Step 7\n"); - (void) jpeg_finish_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible * with the stdio data source. */ @@ -354,7 +350,7 @@ bool gdcmFile::gdcm_read_JPEG_file (FILE *fp,void * image_buffer) { /* And we're done! */ - return 1; + return(true); } /* diff --git a/src/gdcmJpeg12.cxx b/src/gdcmJpeg12.cxx index f67a3fa6..29b6d928 100644 --- a/src/gdcmJpeg12.cxx +++ b/src/gdcmJpeg12.cxx @@ -5,6 +5,8 @@ #define BITS_IN_JSAMPLE 12 +#define DEBUG 0 + // BITS_IN_JSAMPLE is a compile time defined options. // We need both 8 an 12; // To avoid renaming *all* the Jpeg functions, @@ -71,8 +73,6 @@ #define jpeg_destroy jDestroy #define jpeg_resync_to_restart jResyncRestart -#define DEBUG 0 - /* * is used for the optional error recovery mechanism shown in * the second part of the example. @@ -132,27 +132,26 @@ extern "C" { //----------------------------------------------------------------------------- struct my_error_mgr { - struct jpeg_error_mgr pub; /* "public" fields */ - jmp_buf setjmp_buffer; /* for return to caller */ + struct jpeg_error_mgr pub; /* "public" fields */ + jmp_buf setjmp_buffer; /* for return to caller */ }; +//----------------------------------------------------------------------------- typedef struct my_error_mgr * my_error_ptr; -//----------------------------------------------------------------------------- /* * Here's the routine that will replace the standard error_exit method: */ -METHODDEF(void) -my_error_exit (j_common_ptr cinfo) { - /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ - my_error_ptr myerr = (my_error_ptr) cinfo->err; +METHODDEF(void) my_error_exit (j_common_ptr cinfo) { + /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ + my_error_ptr myerr = (my_error_ptr) cinfo->err; - /* Always display the message. */ - /* We could postpone this until after returning, if we chose. */ - (*cinfo->err->output_message) (cinfo); + /* Always display the message. */ + /* We could postpone this until after returning, if we chose. */ + (*cinfo->err->output_message) (cinfo); - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); + /* Return control to the setjmp point */ + longjmp(myerr->setjmp_buffer, 1); } @@ -177,7 +176,6 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { /* This struct contains the JPEG decompression parameters and pointers to * working space (which is allocated as needed by the JPEG library). */ - struct jpeg_decompress_struct cinfo; /* -------------- inside, we found : @@ -204,12 +202,10 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { // typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ // typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - int row_stride; /* physical row width in output buffer */ if (DEBUG) printf("entree dans gdcmFile::gdcm_read_JPEG_file12, depuis gdcmJpeg\n"); - /* In this example we want to open the input file before doing anything else, * so that the setjmp() error recovery below can assume the file is open. * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that @@ -253,11 +249,11 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { if (DEBUG) { printf("--------------Header contents :----------------\n"); printf("image_width %d image_height %d\n", - cinfo.image_width , cinfo.image_height); + cinfo.image_width , cinfo.image_height); printf("bits of precision in image data %d \n", - cinfo.output_components); + cinfo.output_components); printf("nb of color components returned %d \n", - cinfo.data_precision); + cinfo.data_precision); } @@ -301,7 +297,7 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { /* Make a one-row-high sample array that will go away when done with image */ buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); /* Step 6: while (scan lines remain to be read) */ if (DEBUG) printf("Entree Step 6\n"); @@ -313,7 +309,7 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { */ if (DEBUG) printf ("cinfo.output_height %d cinfo.output_width %d\n", - cinfo.output_height,cinfo.output_width); + cinfo.output_height,cinfo.output_width); pimage=(char *)image_buffer; @@ -336,7 +332,7 @@ bool gdcmFile::gdcm_read_JPEG_file12 (FILE *fp,void * image_buffer) { /* Step 7: Finish decompression */ if (DEBUG) printf("Entree Step 7\n"); - (void) jpeg_finish_decompress(&cinfo); + (void) jpeg_finish_decompress(&cinfo); /* We can ignore the return value since suspension is not possible * with the stdio data source. */ diff --git a/src/gdcmObject.cxx b/src/gdcmObject.cxx index 1d43c4e7..1d39f1e3 100644 --- a/src/gdcmObject.cxx +++ b/src/gdcmObject.cxx @@ -203,7 +203,7 @@ ListTag gdcmObject::GetListEntry(void) { //----------------------------------------------------------------------------- // Protected -/* +/** * \ingroup gdcmObject * \brief add the 'Object' related Dicom Elements to the listEntries * of a partially created DICOMDIR diff --git a/src/gdcmObject.h b/src/gdcmObject.h index 7e20d9cc..6670cf01 100644 --- a/src/gdcmObject.h +++ b/src/gdcmObject.h @@ -60,7 +60,7 @@ protected: ~gdcmObject(void); -void FillObject(std::list elemList); + void FillObject(std::list elemList); /** * \brief iterator on the first Header Entry (i.e Dicom Element), @@ -85,13 +85,16 @@ void FillObject(std::list elemList); */ ListTag *plistEntries; /** -* \brief +* \brief detail level to be printed */ int printLevel; /// used to pass variables to FillObject function -/// Work as 'global' variables - std::list::iterator debInsertion, finInsertion, i,j; +/// Works as 'global' variable +/** +* \brief used to pass variables to FillObject function +* Works as 'global' variable +*/ std::list::iterator debInsertion, finInsertion, i,j; private: diff --git a/src/gdcmParser.cxx b/src/gdcmParser.cxx index 2d75ea70..b78abc29 100644 --- a/src/gdcmParser.cxx +++ b/src/gdcmParser.cxx @@ -438,7 +438,7 @@ bool gdcmParser::Write(FILE *fp, FileType type) { SetEntryLengthByNumber(20, 0x0002, 0x0010); } -/* TODO : rewrite later +/* TODO : rewrite later, if really usefull if ( (type == ImplicitVR) || (type == ExplicitVR) ) UpdateGroupLength(false,type); @@ -1979,7 +1979,7 @@ bool gdcmParser::IsHeaderEntryAnInteger(gdcmHeaderEntry *Entry) { return 0; TotalLength += 4; // We even have to decount the group and element - if ( g != 0xfffe && g!=0xb00c ) /*for bogus header */ + if ( g != 0xfffe && g!=0xb00c ) //for bogus header { char msg[100]; // for sprintf. Sorry sprintf(msg,"wrong group (%04x) for an item sequence (%04x,%04x)\n",g, g,n); @@ -1987,7 +1987,7 @@ bool gdcmParser::IsHeaderEntryAnInteger(gdcmHeaderEntry *Entry) { errno = 1; return 0; } - if ( n == 0xe0dd || ( g==0xb00c && n==0x0eb6 ) ) /* for bogus header */ + if ( n == 0xe0dd || ( g==0xb00c && n==0x0eb6 ) ) // for bogus header FoundSequenceDelimiter = true; else if ( n != 0xe000 ) { @@ -2404,15 +2404,15 @@ gdcmHeaderEntry *gdcmParser::ReadNextHeaderEntry(void) { // header parsing has to be considered as finished. return (gdcmHeaderEntry *)0; -/* Pb : how to propagate the element length (used in SkipHeaderEntry) +// Pb : how to propagate the element length (used in SkipHeaderEntry) // direct call to SkipBytes ? - if (ignoreShadow == 1 && g%2 ==1) +// if (ignoreShadow == 1 && g%2 ==1) // if user wants to skip shadow groups // and current element *is* a shadow element // we don't create anything - return (gdcmHeaderEntry *)1; // to tell caller it's NOT finished -*/ +// return (gdcmHeaderEntry *)1; // to tell caller it's NOT finished + NewEntry = NewHeaderEntryByNumber(g, n); FindHeaderEntryVR(NewEntry); FindHeaderEntryLength(NewEntry); diff --git a/src/gdcmRLE.cxx b/src/gdcmRLE.cxx index 784b5f59..2f38ae17 100644 --- a/src/gdcmRLE.cxx +++ b/src/gdcmRLE.cxx @@ -2,7 +2,7 @@ //----------------------------------------------------------------------------- #include #include "gdcmFile.h" -#include /* to declare isprint() */ +#include // to declare isprint() #define str2num(str, typeNum) *((typeNum *)(str)) diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 897899eb..0760f383 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -179,9 +179,9 @@ void Tokenize (const std::string& str, /////////////////////////////////////////////////////////////////////////// -/* +/** * \brief to prevent a flashing screen when non-printable character - * @param + * @param v characters array to remove non printable characters from */ char *_cleanString(char *v) { char *d; @@ -197,9 +197,9 @@ char *_cleanString(char *v) { } /////////////////////////////////////////////////////////////////////////// -/* +/** * \brief to prevent a flashing screen when non-printable character - * @param + * @param s string to remove non printable characters from */ std::string _CreateCleanString(std::string s) { std::string str=s; @@ -220,9 +220,9 @@ std::string _CreateCleanString(std::string s) { } /////////////////////////////////////////////////////////////////////////// -/* +/** * \brief Add a SEPARATOR to the end of the name is necessary - * @param + * @param name file/directory name to normalize */ void NormalizePath(std::string &name) { @@ -237,9 +237,9 @@ const std::string SEPARATOR = "/"; } /////////////////////////////////////////////////////////////////////////// -/* +/** * \brief Get the (directory) path from a full path file name - * @param + * @param fullName file/directory name to extract Path from */ std::string GetPath(std::string &fullName) { @@ -253,9 +253,9 @@ std::string GetPath(std::string &fullName) } /////////////////////////////////////////////////////////////////////////// -/* +/** * \brief Get the (last) name of a full path file name - * @param + * @param fullName file/directory name to extract end name from */ std::string GetName(std::string &fullName) { diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 89ff5dc0..5fb33b22 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -581,7 +581,7 @@ size_t vtkGdcmReader::LoadImageInMemory( size_t size; // If the data structure of vtk for image/volume representation - // were straigthforwards the following would suffice: + // were straigthforwards the following would be enough: // GdcmFile.GetImageDataIntoVector((void*)Dest, size); // But vtk chooses to invert the lines of an image, that is the last // line comes first (for some axis related reasons?). Hence we need -- 2.45.2