+2005-01-31 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/*.cxx : first parss to normalize file organisation
+
2005-01-31 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmDirList.[h|cxx] : add method to find a directory
* Test/TestAllReadCompareDicom.cxx : bug fix under Windows
Program: gdcm
Module: $RCSfile: gdcmBase.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:32 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ 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
{
}
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
//-----------------------------------------------------------------------------
// Print
/**
{
}
-//-----------------------------------------------------------------------------
-// Public
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/30 17:30:57 $
- Version: $Revision: 1.59 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.60 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
/**
* \brief Constructor from a given BinEntry
*/
}
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints a BinEntry (Dicom entry)
- * @param os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void BinEntry::Print(std::ostream &os, std::string const & )
-{
- os << "B ";
- DocEntry::Print(os);
- std::ostringstream s;
- void* binArea = GetBinArea();
- if (binArea)
- {
- //s << " [" << GDCM_BINLOADED
- s << " [" << GetValue()
- << "; length = " << GetLength() << "]";
- }
- else
- {
- if ( GetLength() == 0 )
- {
- s << " []";
- }
- else
- {
- //s << " [gdcm::Binary data NOT loaded]";
- s << " [" <<GetValue() << "]";
- }
- }
- os << s.str();
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints a BinEntry (Dicom entry)
+ * @param os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void BinEntry::Print(std::ostream &os, std::string const & )
+{
+ os << "B ";
+ DocEntry::Print(os);
+ std::ostringstream s;
+ void* binArea = GetBinArea();
+ if (binArea)
+ {
+ //s << " [" << GDCM_BINLOADED
+ s << " [" << GetValue()
+ << "; length = " << GetLength() << "]";
+ }
+ else
+ {
+ if ( GetLength() == 0 )
+ {
+ s << " []";
+ }
+ else
+ {
+ //s << " [gdcm::Binary data NOT loaded]";
+ s << " [" <<GetValue() << "]";
+ }
+ }
+ os << s.str();
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2005/01/30 17:30:57 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
-/// warning message level to be displayed
+//-----------------------------------------------------------------------------
+// Warning message level to be displayed
static bool DebugFlag = false;
static bool DebugToFile = false;
static std::ofstream DebugFile;
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
Debug::Debug()
{
//-----------------------------------------------------------------------------
// Public
-
/**
* \brief Accessor
* @param flag Set the debug flag
Program: gdcm
Module: $RCSfile: gdcmDebug.h,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:33 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// This is a global flag that controls whether any debug, warning
/// messages are displayed.
- static bool GetDebugFlag ();
static void SetDebugFlag (bool flag);
- static void SetDebugOn () { SetDebugFlag(true); };
- static void SetDebugOff () { SetDebugFlag(false); };
+ static bool GetDebugFlag ();
+ static void DebugOn () { SetDebugFlag(true); };
+ static void DebugOff () { SetDebugFlag(false); };
/// This is a global flag that controls if debug are redirected
/// to a file or not
- static bool GetDebugToFile ();
static void SetDebugToFile (bool flag);
- static void SetDebugToFileOn () { SetDebugToFile(true); };
- static void SetDebugToFileOff () { SetDebugToFile(false); };
+ static bool GetDebugToFile ();
+ static void DebugToFileOn () { SetDebugToFile(true); };
+ static void DebugToFileOff () { SetDebugToFile(false); };
/// Set the filename the debug stream should be redirect to
/// Settting a filename also set DebugToFile to true
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/29 11:43:05 $
- Version: $Revision: 1.122 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.123 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
+//-----------------------------------------------------------------------------
+// For full DICOMDIR description, see:
+// PS 3.3-2003, pages 731-750
+//-----------------------------------------------------------------------------
#include "gdcmDicomDir.h"
#include "gdcmDicomDirStudy.h"
#include "gdcmDicomDirSerie.h"
namespace gdcm
{
-
-//-----------------------------------------------------------------------------
-// For full DICOMDIR description, see:
-// PS 3.3-2003, pages 731-750
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
/**
* \brief Constructor : creates an empty DicomDir
*/
}
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Canonical Printer
- * @param os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DicomDir::Print(std::ostream &os, std::string const & )
-{
- if( MetaElems )
- {
- MetaElems->SetPrintLevel(PrintLevel);
- MetaElems->Print(os);
- }
- for(ListDicomDirPatient::iterator cc = Patients.begin();
- cc != Patients.end();
- ++cc)
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Protected
-
/**
* \brief create a Document-like chained list from a root Directory
* @param path entry point of the tree-like structure
}
}
-//-----------------------------------------------------------------------------
/**
* \brief CallStartMethod
*/
}
}
-//-----------------------------------------------------------------------------
/**
* \brief CallProgressMethod
*/
}
}
-//-----------------------------------------------------------------------------
/**
* \brief CallEndMethod
*/
} // end namespace gdcm
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Canonical Printer
+ * @param os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DicomDir::Print(std::ostream &os, std::string const & )
+{
+ if( MetaElems )
+ {
+ MetaElems->SetPrintLevel(PrintLevel);
+ MetaElems->Print(os);
+ }
+ for(ListDicomDirPatient::iterator cc = Patients.begin();
+ cc != Patients.end();
+ ++cc)
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+}
+
+//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2005/01/25 11:11:58 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.51 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::vector<Document *> VectDocument;
//-----------------------------------------------------------------------------
-
/**
* \ingroup DicomDir
* \brief DicomDir defines an object representing a DICOMDIR in memory
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 17:01:29 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/02/01 10:29:54 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
+//-----------------------------------------------------------------------------
void FillDefaultDIRDict(DicomDirElement *dde);
+
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
/**
* \brief constructor : populates the chained lists
* from the file 'Dicts/DicomDir.dic'
DicomDirImageList.clear();
}
+//-----------------------------------------------------------------------------
+// Public
+/**
+ * \brief Add an entry
+ * @param type type
+ * @param elem elem
+ */
+bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem)
+{
+ switch( type )
+ {
+ case DD_META :
+ DicomDirMetaList.push_back(elem);
+ break;
+ case DD_PATIENT :
+ DicomDirPatientList.push_back(elem);
+ break;
+ case DD_STUDY :
+ DicomDirStudyList.push_back(elem);
+ break;
+ case DD_SERIE :
+ DicomDirSerieList.push_back(elem);
+ break;
+ case DD_IMAGE :
+ DicomDirImageList.push_back(elem);
+ break;
+ default :
+ return false;
+ }
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
//-----------------------------------------------------------------------------
// Print
/**
}
//-----------------------------------------------------------------------------
-// Public
-/**
- * \brief Add an entry
- * @param type type
- * @param elem elem
- */
-bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem)
-{
- switch( type )
- {
- case DD_META :
- DicomDirMetaList.push_back(elem);
- break;
- case DD_PATIENT :
- DicomDirPatientList.push_back(elem);
- break;
- case DD_STUDY :
- DicomDirStudyList.push_back(elem);
- break;
- case DD_SERIE :
- DicomDirSerieList.push_back(elem);
- break;
- case DD_IMAGE :
- DicomDirImageList.push_back(elem);
- break;
- default :
- return false;
- }
- return true;
-}
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
-//-----------------------------------------------------------------------------
-
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 17:01:29 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
}
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
//-----------------------------------------------------------------------------
// Print
/**
DicomDirObject::Print(os);
}
-//-----------------------------------------------------------------------------
-// Public
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
/**
* \brief Constructor
*/
{
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints the Meta Elements
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- */
-void DicomDirMeta::Print(std::ostream &os, std::string const & )
-{
- os << "META" << std::endl;
- // warning : META doesn't behave exactly like a Objet
- for (ListDocEntry::iterator i = DocEntries.begin();
- i != DocEntries.end();
- ++i)
- {
- (*i)->SetPrintLevel(PrintLevel);
- (*i)->Print();
- os << std::endl;
- }
-}
-
-
//-----------------------------------------------------------------------------
// Public
-
-
/**
* \brief Writes the Meta Elements
* @param fp ofstream to write to
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints the Meta Elements
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ */
+void DicomDirMeta::Print(std::ostream &os, std::string const & )
+{
+ os << "META" << std::endl;
+ // warning : META doesn't behave exactly like a Objet
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
+ ++i)
+ {
+ (*i)->SetPrintLevel(PrintLevel);
+ (*i)->Print();
+ os << std::endl;
+ }
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
/**
* \brief Constructor
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:33 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
ClearStudy();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints the Object
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- */
-void DicomDirPatient::Print(std::ostream &os, std::string const & )
-{
- os << "PATIENT" << std::endl;
- DicomDirObject::Print(os);
-
- for(ListDicomDirStudy::const_iterator cc = Studies.begin();
- cc != Studies.end();
- ++cc )
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ */
+void DicomDirPatient::Print(std::ostream &os, std::string const & )
+{
+ os << "PATIENT" << std::endl;
+ DicomDirObject::Print(os);
+
+ for(ListDicomDirStudy::const_iterator cc = Studies.begin();
+ cc != Studies.end();
+ ++cc )
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 17:01:29 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
ClearImage();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints the Object
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- */
-void DicomDirSerie::Print(std::ostream &os, std::string const &)
-{
- os << "SERIE" << std::endl;
- DicomDirObject::Print(os);
-
- for(ListDicomDirImage::iterator cc = Images.begin();
- cc != Images.end();
- ++cc)
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
// Private
//-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ */
+void DicomDirSerie::Print(std::ostream &os, std::string const &)
+{
+ os << "SERIE" << std::endl;
+ DicomDirObject::Print(os);
+ for(ListDicomDirImage::iterator cc = Images.begin();
+ cc != Images.end();
+ ++cc)
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+}
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:33 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
ClearSerie();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints the Object
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- * @return
- */
-void DicomDirStudy::Print(std::ostream &os, std::string const & )
-{
- os << "STUDY" << std::endl;
- DicomDirObject::Print(os);
-
- for(ListDicomDirSerie::iterator cc = Series.begin();
- cc != Series.end();
- ++cc)
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
// Private
//-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ * @return
+ */
+void DicomDirStudy::Print(std::ostream &os, std::string const & )
+{
+ os << "STUDY" << std::endl;
+ DicomDirObject::Print(os);
+ for(ListDicomDirSerie::iterator cc = Series.begin();
+ cc != Series.end();
+ ++cc)
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.71 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
+//-----------------------------------------------------------------------------
void FillDefaultDataDict(Dict *d);
+
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
ClearEntry();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Print all the dictionary entries contained in this dictionary.
- * Entries will be sorted by tag i.e. the couple (group, element).
- * @param os The output stream to be written to.
- * @param indent Indentation string to be prepended during printing
- */
-void Dict::Print(std::ostream &os, std::string const & )
-{
- os << "Dict file name : " << Filename << std::endl;
- std::ostringstream s;
-
- for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
- {
- s << "Entry : ";
- s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ',';
- s << std::hex << std::setw(4) << tag->second.GetElement() << ") = "
- << std::dec;
- s << tag->second.GetVR() << ", ";
- s << tag->second.GetVM() << ", ";
- s << tag->second.GetName() << "." << std::endl;
- }
- os << s.str();
-}
-
-
//-----------------------------------------------------------------------------
// Public
/**
// Private
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print all the dictionary entries contained in this dictionary.
+ * Entries will be sorted by tag i.e. the couple (group, element).
+ * @param os The output stream to be written to.
+ * @param indent Indentation string to be prepended during printing
+ */
+void Dict::Print(std::ostream &os, std::string const & )
+{
+ os << "Dict file name : " << Filename << std::endl;
+ std::ostringstream s;
+ for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
+ {
+ s << "Entry : ";
+ s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ',';
+ s << std::hex << std::setw(4) << tag->second.GetElement() << ") = "
+ << std::dec;
+ s << tag->second.GetVR() << ", ";
+ s << tag->second.GetVM() << ", ";
+ s << tag->second.GetName() << "." << std::endl;
+ }
+ os << s.str();
+}
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDictEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:33 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.44 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
Key = TranslateToKey(group, elem);
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints an entry of the Dicom DictionaryEntry
- * @param os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DictEntry::Print(std::ostream &os, std::string const & )
-{
- std::string vr;
- std::ostringstream s;
-
- vr = GetVR();
- if(vr==GDCM_UNKNOWN)
- vr=" ";
-
- s << DictEntry::TranslateToKey(GetGroup(),GetElement());
- s << " [" << vr << "] ";
-
- if (PrintLevel >= 1)
- {
- s.setf(std::ios::left);
- s << std::setw(66-GetName().length()) << " ";
- }
-
- s << "[" << GetName()<< "]";
- os << s.str() << std::endl;
-}
-
//-----------------------------------------------------------------------------
// Public
/**
return Util::Format("%04x|%04x", group, elem);
}
-//-----------------------------------------------------------------------------
/**
* \brief If-and only if-the V(alue) R(epresentation)
* \ is unset then overwrite it.
}
}
-//-----------------------------------------------------------------------------
/**
* \brief If-and only if-the V(alue) M(ultiplicity)
* \ is unset then overwrite it.
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints an entry of the Dicom DictionaryEntry
+ * @param os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DictEntry::Print(std::ostream &os, std::string const & )
+{
+ std::string vr;
+ std::ostringstream s;
+
+ vr = GetVR();
+ if(vr==GDCM_UNKNOWN)
+ vr=" ";
+
+ s << DictEntry::TranslateToKey(GetGroup(),GetElement());
+ s << " [" << vr << "] ";
+
+ if (PrintLevel >= 1)
+ {
+ s.setf(std::ios::left);
+ s << std::setw(66-GetName().length()) << " ";
+ }
+
+ s << "[" << GetName()<< "]";
+ os << s.str() << std::endl;
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:33 $
- Version: $Revision: 1.56 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
VirtualEntry.clear();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Print, in an informal fashion, the list of all the dictionaries
- * contained is this DictSet, along with their respective content.
- * @param os Output stream used for printing.
- * @param indent Indentation string to be prepended during printing
- */
-void DictSet::Print(std::ostream &os, std::string const & )
-{
- for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
- {
- os << "Printing dictionary " << dict->first << std::endl;
- dict->second->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
-/**
- * \brief Consider all the entries of the public dicom dictionary.
- * Build all list of all the tag names of all those entries.
- * \sa DictSet::GetPubDictTagNamesByCategory
- * @return A list of all entries of the public dicom dictionary.
- */
-
-// Probabely useless!
-
-//EntryNamesList *DictSet::GetPubDictEntryNames()
-//{
-// return GetDefaultPubDict()->GetDictEntryNames();
-//}
-
-/**
- * \brief
- * - Consider all the entries of the public dicom dictionary.
- * - 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 dictionary entries among that
- * group. Note that apparently the Dicom standard doesn't explicitely
- * define a name (as a string) for each group.
- * NO ! Dicom Standard explicitely doesn't define
- * any name, for any group !
- * - A typical usage of this method would be to enable a dynamic
- * configuration of a Dicom file browser: the admin/user can
- * select in the interface which Dicom tags should be displayed.
- * \warning
- * - Dicom *doesn't* define any name for any 'categorie'
- * (the dictionary fourth field was formerly NIH defined
- * -and no longer he is-
- * and will be removed when Dicom provides us a text file
- * with the 'official' Dictionary, that would be more friendly
- * than asking us to perform a line by line check of the dictionary
- * at the beginning of each year to -try to- guess the changes)
- * - Therefore : please NEVER use that fourth field :-(
- * *
- * @return An hashtable: whose keys are the names of the groups and whose
- * corresponding values are lists of all the dictionary entries
- * among that group.
- */
-
-
-// Probabely useless!
-
-//EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory()
-//{
-// return GetDefaultPubDict()->GetDictEntryNamesByCategory();
-//}
-
/**
* \brief Loads a dictionary from a specified file, and add it
* to already the existing ones contained in this DictSet.
return resultPath;
}
-
/**
* \brief Get the first entry while visiting the DictSet
* \return The first Dict if found, otherwhise NULL
//-----------------------------------------------------------------------------
// Protected
-
/**
* \brief Adds a Dictionary to a DictSet
* \return always true
// Private
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print, in an informal fashion, the list of all the dictionaries
+ * contained is this DictSet, along with their respective content.
+ * @param os Output stream used for printing.
+ * @param indent Indentation string to be prepended during printing
+ */
+void DictSet::Print(std::ostream &os, std::string const & )
+{
+ for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
+ {
+ os << "Printing dictionary " << dict->first << std::endl;
+ dict->second->Print(os);
+ }
+}
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:00:34 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
+//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
* \brief Constructor
//-----------------------------------------------------------------------------
// Public
-
/**
* \brief Print method
* @param os ostream to write to
//-----------------------------------------------------------------------------
// Private
-
/**
* \brief Explore a directory with possibility of recursion
* return number of files read
#endif
}
-} // end namespace gdcm
+//-----------------------------------------------------------------------------
+// Print
//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/30 17:30:57 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
+//-----------------------------------------------------------------------------
#define MAX_SIZE_PRINT_ELEMENT_VALUE 64
//-----------------------------------------------------------------------------
Length = 0;
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Prints the common part of ValEntry, BinEntry, SeqEntry
- * @param os ostream we want to print in
- * @param indent Indentation string to be prepended during printing
- */
-void DocEntry::Print(std::ostream &os, std::string const & )
-{
- size_t o;
- std::string st;
- TSKey v;
- std::string d2, vr;
- std::ostringstream s;
- uint32_t lgth;
-
- o = GetOffset();
- vr = GetVR();
- if(vr==GDCM_UNKNOWN)
- vr=" ";
-
- s << DictEntry::TranslateToKey(GetGroup(),GetElement());
-
- if (PrintLevel >= 2)
- {
- s << " lg : ";
- lgth = GetReadLength(); // ReadLength, as opposed to Length
- if (lgth == 0xffffffff)
- {
- st = Util::Format("x(ffff)"); // I said : "x(ffff)" !
- s.setf(std::ios::left);
- s << std::setw(10-st.size()) << " ";
- s << st << " ";
- s.setf(std::ios::left);
- s << std::setw(8) << "-1";
- }
- else
- {
- st = Util::Format("x(%x)",lgth);
- s.setf(std::ios::left);
- s << std::setw(10-st.size()) << " ";
- s << st << " ";
- s.setf(std::ios::left);
- s << std::setw(8) << lgth;
- }
- s << " Off.: ";
- st = Util::Format("x(%x)",o);
- s << std::setw(10-st.size()) << " ";
- s << st << " ";
- s << std::setw(8) << o;
- }
-
- s << "[" << vr << "] ";
-
- if (PrintLevel >= 1)
- {
- s.setf(std::ios::left);
- s << std::setw(66-GetName().length()) << " ";
- }
-
- s << "[" << GetName()<< "]";
- os << s.str();
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints the common part of ValEntry, BinEntry, SeqEntry
+ * @param os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void DocEntry::Print(std::ostream &os, std::string const & )
+{
+ size_t o;
+ std::string st;
+ TSKey v;
+ std::string d2, vr;
+ std::ostringstream s;
+ uint32_t lgth;
+
+ o = GetOffset();
+ vr = GetVR();
+ if(vr==GDCM_UNKNOWN)
+ vr=" ";
+
+ s << DictEntry::TranslateToKey(GetGroup(),GetElement());
+
+ if (PrintLevel >= 2)
+ {
+ s << " lg : ";
+ lgth = GetReadLength(); // ReadLength, as opposed to Length
+ if (lgth == 0xffffffff)
+ {
+ st = Util::Format("x(ffff)"); // I said : "x(ffff)" !
+ s.setf(std::ios::left);
+ s << std::setw(10-st.size()) << " ";
+ s << st << " ";
+ s.setf(std::ios::left);
+ s << std::setw(8) << "-1";
+ }
+ else
+ {
+ st = Util::Format("x(%x)",lgth);
+ s.setf(std::ios::left);
+ s << std::setw(10-st.size()) << " ";
+ s << st << " ";
+ s.setf(std::ios::left);
+ s << std::setw(8) << lgth;
+ }
+ s << " Off.: ";
+ st = Util::Format("x(%x)",o);
+ s << std::setw(10-st.size()) << " ";
+ s << st << " ";
+ s << std::setw(8) << o;
+ }
+
+ s << "[" << vr << "] ";
+
+ if (PrintLevel >= 1)
+ {
+ s.setf(std::ios::left);
+ s << std::setw(66-GetName().length()) << " ";
+ }
+
+ s << "[" << GetName()<< "]";
+ os << s.str();
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocEntryArchive.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 11:42:02 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
//-----------------------------------------------------------------------------
+// Constructor / Destructor
/**
* \brief Constructor
*/
ArchFile = file;
}
-//-----------------------------------------------------------------------------
/**
* \brief Destructor
*/
ClearArchive();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Print all
- * @param os The output stream to be written to.
- */
-void DocEntryArchive::Print(std::ostream &os)
-{
- os << "Elements in archives :" << std::endl;
- for(TagDocEntryHT::iterator it = Archive.begin();
- it!=Archive.end();
- ++it)
- {
- if(it->second)
- it->second->Print(os);
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
// Set the new DocEntry
ArchFile->AddEntry(newEntry);
-/* // Save the old DocEntry if any
- TagDocEntryHT::iterator it = HeaderHT.find(key);
- if( it!=HeaderHT.end() )
- {
- Archive[key] = it->second;
- }
- else
- {
- Archive[key] = NULL;
- }
-
- // Set the new DocEntry
- HeaderHT[key] = newEntry;*/
-
return true;
}
return false;
if( old )
ArchFile->RemoveEntryNoDestroy(old);
-/* // Save the old DocEntry if any
- TagDocEntryHT::iterator it = HeaderHT.find(key);
- if( it!=HeaderHT.end() )
- {
- Archive[key] = it->second;
- HeaderHT.erase(it);
- }*/
-
return true;
}
return false;
if( Archive[key] )
ArchFile->AddEntry(Archive[key]);
-/* // Delete the new value
- TagDocEntryHT::iterator restorePos = HeaderHT.find(key);
- if( restorePos!=HeaderHT.end() )
- {
- delete restorePos->second;
- }
-
- // Restore the old value
- if( Archive[key] )
- {
- HeaderHT[key] = Archive[key];
- }
- else
- {
- HeaderHT.erase(restorePos);
- }*/
-
Archive.erase(restoreIt);
return true;
// Private
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print all
+ * @param os The output stream to be written to.
+ */
+void DocEntryArchive::Print(std::ostream &os)
+{
+ os << "Elements in archives :" << std::endl;
+ for(TagDocEntryHT::iterator it = Archive.begin();
+ it!=Archive.end();
+ ++it)
+ {
+ if(it->second)
+ it->second->Print(os);
+ }
+}
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 11:42:02 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
//-----------------------------------------------------------------------------
// Public
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:34 $
- Version: $Revision: 1.217 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.218 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Refer to Document::CheckSwap()
//const unsigned int Document::HEADER_LENGTH_TO_READ = 256;
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
+// Constructors and destructors are protected to avoid user to invoke directly
/**
* \brief constructor
* @param filename 'Document' (File or DicomDir) to be opened for parsing
RefShaDict = NULL;
}
-//-----------------------------------------------------------------------------
-// Print
-
-/**
- * \brief Prints The Dict Entries of THE public Dicom Dictionary
- * @param os ostream to print to
- * @return
- */
-void Document::PrintPubDict(std::ostream &os)
-{
- RefPubDict->SetPrintLevel(PrintLevel);
- RefPubDict->Print(os);
-}
-
-/**
- * \brief Prints The Dict Entries of THE shadow Dicom Dictionary
- * @param os ostream to print to
- * @return
- */
-void Document::PrintShaDict(std::ostream &os)
-{
- RefShaDict->SetPrintLevel(PrintLevel);
- RefShaDict->Print(os);
-}
-
//-----------------------------------------------------------------------------
// Public
/**
// -----------------------------------------
// Content entries
-
/**
* \brief Loads (from disk) the element content
* when a string is not suitable
//-----------------------------------------------------------------------------
// Protected
-
-// Constructors and destructors are protected to avoid user to invoke directly
-
/**
* \brief Reads a supposed to be 16 Bits integer
* (swaps it depending on processor endianity)
//-----------------------------------------------------------------------------
// Private
-
/**
* \brief Parses a DocEntrySet (Zero-level DocEntries or SQ Item DocEntries)
* @return length of the parsed set.
}
}
-// GenerateFreeTagKeyInGroup?
-// --> What was it designed for ?!?
-/**
- * \brief Generate a free TagKey i.e. a TagKey that is not present
- * in the TagHt dictionary.
- * @param group The generated tag must belong to this group.
- * @return The element of tag with given group which is fee.
- */
-//uint32_t Document::GenerateFreeTagKeyInGroup(uint16_t group)
-//{
-// for (uint32_t elem = 0; elem < UINT32_MAX; elem++)
-// {
-// TagKey key = DictEntry::TranslateToKey(group, elem);
-// if (TagHT.count(key) == 0)
-// {
-// return elem;
-// }
-// }
-// return UINT32_MAX;
-//}
-
/**
* \brief Compares two documents, according to \ref DicomDir rules
* \warning Does NOT work with ACR-NEMA files
return false;
}
-/*
- * \brief Walk recursively the given \ref DocEntrySet, and feed
- * the given hash table (\ref TagDocEntryHT) with all the
- * \ref DocEntry (Dicom entries) encountered.
- * This method does the job for \ref BuildFlatHashTable.
- * @param builtHT Where to collect all the \ref DocEntry encountered
- * when recursively walking the given set.
- * @param set The structure to be traversed (recursively).
- */
-/*void Document::BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
- DocEntrySet *set )
-{
- if (ElementSet *elementSet = dynamic_cast< ElementSet* > ( set ) )
- {
- TagDocEntryHT const ¤tHT = elementSet->GetTagHT();
- for( TagDocEntryHT::const_iterator i = currentHT.begin();
- i != currentHT.end();
- ++i)
- {
- DocEntry *entry = i->second;
- if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
- {
- const ListSQItem& items = seqEntry->GetSQItems();
- for( ListSQItem::const_iterator item = items.begin();
- item != items.end();
- ++item)
- {
- BuildFlatHashTableRecurse( builtHT, *item );
- }
- continue;
- }
- builtHT[entry->GetKey()] = entry;
- }
- return;
- }
-
- if (SQItem *SQItemSet = dynamic_cast< SQItem* > ( set ) )
- {
- const ListDocEntry& currentList = SQItemSet->GetDocEntries();
- for (ListDocEntry::const_iterator i = currentList.begin();
- i != currentList.end();
- ++i)
- {
- DocEntry *entry = *i;
- if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
- {
- const ListSQItem& items = seqEntry->GetSQItems();
- for( ListSQItem::const_iterator item = items.begin();
- item != items.end();
- ++item)
- {
- BuildFlatHashTableRecurse( builtHT, *item );
- }
- continue;
- }
- builtHT[entry->GetKey()] = entry;
- }
-
- }
-}*/
-
-/*
- * \brief Build a \ref TagDocEntryHT (i.e. a std::map<>) from the current
- * Document.
- *
- * The structure used by a Document (through \ref ElementSet),
- * in order to hold the parsed entries of a Dicom header, is a recursive
- * one. This is due to the fact that the sequences (when present)
- * can be nested. Additionaly, the sequence items (represented in
- * gdcm as \ref SQItem) add an extra complexity to the data
- * structure. Hence, a gdcm user whishing to visit all the entries of
- * a Dicom header will need to dig in the gdcm internals (which
- * implies exposing all the internal data structures to the API).
- * In order to avoid this burden to the user, \ref BuildFlatHashTable
- * recursively builds a temporary hash table, which holds all the
- * Dicom entries in a flat structure (a \ref TagDocEntryHT i.e. a
- * std::map<>).
- * \warning Of course there is NO integrity constrain between the
- * returned \ref TagDocEntryHT and the \ref ElementSet used
- * to build it. Hence if the underlying \ref ElementSet is
- * altered, then it is the caller responsability to invoke
- * \ref BuildFlatHashTable again...
- * @return The flat std::map<> we juste build.
- */
-/*TagDocEntryHT *Document::BuildFlatHashTable()
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints The Dict Entries of THE public Dicom Dictionary
+ * @param os ostream to print to
+ * @return
+ */
+void Document::PrintPubDict(std::ostream &os)
{
- TagDocEntryHT *FlatHT = new TagDocEntryHT;
- BuildFlatHashTableRecurse( *FlatHT, this );
- return FlatHT;
-}*/
+ RefPubDict->SetPrintLevel(PrintLevel);
+ RefPubDict->Print(os);
+}
-} // end namespace gdcm
+/**
+ * \brief Prints The Dict Entries of THE shadow Dicom Dictionary
+ * @param os ostream to print to
+ * @return
+ */
+void Document::PrintShaDict(std::ostream &os)
+{
+ RefShaDict->SetPrintLevel(PrintLevel);
+ RefShaDict->Print(os);
+}
//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:24 $
- Version: $Revision: 1.51 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.52 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
ClearEntry();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \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
- */
-void ElementSet::Print(std::ostream &os, std::string const & )
-{
- for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
- {
- DocEntry* entry = i->second;
-
- entry->SetPrintLevel(PrintLevel);
- entry->Print(os);
-
- if ( dynamic_cast<SeqEntry*>(entry) )
- {
- // Avoid the newline for a sequence:
- continue;
- }
- os << std::endl;
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Private
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \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
+ */
+void ElementSet::Print(std::ostream &os, std::string const & )
+{
+ for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
+ {
+ DocEntry* entry = i->second;
+
+ entry->SetPrintLevel(PrintLevel);
+ entry->Print(os);
+
+ if ( dynamic_cast<SeqEntry*>(entry) )
+ {
+ // Avoid the newline for a sequence:
+ continue;
+ }
+ os << std::endl;
+ }
+}
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmException.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 14:28:32 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
#include <typeinfo>
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Exception
-
/**
* \brief constructor
* @param f f
*/
Exception::Exception(const std::string &f, const std::string &msg) throw()
#ifdef __GNUC__
- try
+ try
#endif
- : From(f), Error(msg) {
- }
+ : From(f), Error(msg)
+ {
+ }
#ifdef __GNUC__
-catch(...) {
- fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)");
-}
+ catch(...)
+ {
+ fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)");
+ }
#endif
-
/**
* \brief fatal
* @param from from
*/
-void Exception::fatal(const char *from) throw() {
+void Exception::fatal(const char *from) throw()
+{
try
{
std::cerr << "Fatal: exception received in " << from
std::string name = typeid(*this).name();
return name;
#endif
- }
- catch(...) {
- fatal("Exception::getName(std::string &)");
- return "";
- }
+ }
+ catch(...)
+ {
+ fatal("Exception::getName(std::string &)");
+ return "";
+ }
}
/**
* \brief Exception
*/
- Exception::operator const char *() const throw() {
- return getName().c_str();
+Exception::operator const char *() const throw()
+{
+ return getName().c_str();
}
//-----------------------------------------------------------------------------
* @param os ostream to write to
* @param e exception to raise
*/
- std::ostream& operator<<(std::ostream &os, const Exception &e) {
- try {
- os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl;
- }
- catch(...) {
- Exception::fatal("operator<<(std::ostream &, const Exception&)");
- }
- return os;
+std::ostream& operator<<(std::ostream &os, const Exception &e)
+{
+ try
+ {
+ os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl;
+ }
+ catch(...)
+ {
+ Exception::fatal("operator<<(std::ostream &, const Exception&)");
+ }
+ return os;
}
+
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 15:10:56 $
- Version: $Revision: 1.205 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
delete JPEGInfo;
}
+//-----------------------------------------------------------------------------
+// Public
/**
* \brief Performs some consistency checking on various 'File related'
* (as opposed to 'DicomDir related') entries
return true;
}
-//-----------------------------------------------------------------------------
-// Print
-
-
-//-----------------------------------------------------------------------------
-// Public
-
/**
* \brief This predicate, based on hopefully reasonable heuristics,
* decides whether or not the current File was properly parsed
}
//-----------------------------------------------------------------------------
+// Print
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/01/26 16:28:58 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
-typedef std::pair<TagDocEntryHT::iterator,TagDocEntryHT::iterator> IterHT;
-
//-------------------------------------------------------------------------
// Constructor / Destructor
/**
FileInternal = 0;
}
-//-----------------------------------------------------------------------------
-// Print
-void FileHelper::Print(std::ostream &os, std::string const &)
-{
- FileInternal->SetPrintLevel(PrintLevel);
- FileInternal->Print(os);
-
- PixelReadConverter->SetPrintLevel(PrintLevel);
- PixelReadConverter->Print(os);
-}
-
//-----------------------------------------------------------------------------
// Public
/**
//-----------------------------------------------------------------------------
// Protected
-
/**
* \brief Check the write integrity
*
}
//-----------------------------------------------------------------------------
-// Protected
+// Private
/**
* \brief Factorization for various forms of constructors.
*/
}
//-----------------------------------------------------------------------------
-// Private
+// Print
+void FileHelper::Print(std::ostream &os, std::string const &)
+{
+ FileInternal->SetPrintLevel(PrintLevel);
+ FileInternal->Print(os);
+
+ PixelReadConverter->SetPrintLevel(PrintLevel);
+ PixelReadConverter->Print(os);
+}
//-----------------------------------------------------------------------------
} // end namespace gdcm
-
Program: gdcm
Module: $RCSfile: gdcmGlobal.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
+//-----------------------------------------------------------------------------
// Those global string that are return by reference everywhere in gdcm code
// used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX
// you cannot have static initialization in a multithreaded environment
const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
const std::string GDCM_UNREAD = "gdcm::UnRead";
-/**
- * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
- */
+//-----------------------------------------------------------------------------
DictSet *Global::Dicts = (DictSet *)0;
-
-/**
- * \brief Pointer to a hash table containing the 'Value Representations'.
- */
VR *Global::ValRes = (VR *)0;
-
-/**
- * \brief Pointer to a hash table containing the Transfer Syntax codes
- * and their english description
- */
TS *Global::TranSyn = (TS *)0;
-
-/**
- * \brief Pointer to the hash table containing the Dicom Elements
- * necessary to describe each part of a DICOMDIR
- */
DicomDirElement *Global::ddElem = (DicomDirElement *)0;
+//-----------------------------------------------------------------------------
/**
* \brief Global container
*/
Global Glob;
+//-------------------------------------------------------------------------
+// Constructor / Destructor
/**
* \brief constructor : populates the various H Tables
*/
delete TranSyn;
delete ddElem;
}
+
+//-----------------------------------------------------------------------------
+// Public
/**
* \brief returns a pointer to the 'Value Representation Table'
*/
{
return ddElem;
}
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmGlobal.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static DicomDirElement *GetDicomDirElements();
private:
- static DictSet *Dicts;
+ /// Pointer to a container, holding _all_ the Dicom Dictionaries.
+ static DictSet *Dicts;
+ /// Pointer to a hash table containing the 'Value Representations'.
static VR *ValRes;
+ /// Pointer to a hash table containing the Transfer Syntax codes and their
+ /// english description
static TS *TranSyn;
+ /// Pointer to the hash table containing the Dicom Elements necessary
+ /// to describe each part of a DICOMDIR
static DicomDirElement *ddElem;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmJPEGFragment.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 04:15:33 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
-
+//-------------------------------------------------------------------------
// For JPEG 2000, body in file gdcmJpeg2000.cxx
// Not yet made
bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer);
// Not yet made
bool gdcm_read_JPEGLS_file (std::ifstream* fp, void* image_buffer);
+//-------------------------------------------------------------------------
+// Constructor / Destructor
/**
* \brief Default constructor.
*/
}
-/**
- * \brief Print self.
- * @param os Stream to print to.
- * @param indent Indentation string to be prepended during printing.
- */
-void JPEGFragment::Print( std::ostream &os, std::string indent )
-{
- os << indent
- << "JPEG fragment: offset : " << Offset
- << " length : " << Length
- << std::endl;
-}
-
+//-----------------------------------------------------------------------------
+// Public
/**
* \brief Decompress 8bits JPEG Fragment
* @param fp ifstream to write to
}
}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print self.
+ * @param os Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
+ */
+void JPEGFragment::Print( std::ostream &os, std::string indent )
+{
+ os << indent
+ << "JPEG fragment: offset : " << Offset
+ << " length : " << Length
+ << std::endl;
+}
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 05:24:21 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
-
+//-------------------------------------------------------------------------
+// Constructor / Destructor
JPEGFragmentsInfo::JPEGFragmentsInfo()
{
StateSuspension = 0;
Fragments.clear();
}
-/**
- * \brief Print self.
- * @param os Stream to print to.
- * @param indent Indentation string to be prepended during printing.
- */
-void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent )
-{
- os << std::endl;
- os << indent
- << "----------------- JPEG fragments --------------------------------"
- << std::endl << std::endl;
- os << indent
- << "Total number of fragments : " << Fragments.size()
- << std::endl;
- int fragmentNumber = 0;
- for(JPEGFragmentsList::iterator it = Fragments.begin();
- it != Fragments.end();
- ++it)
- {
- os << indent
- << " fragment number :" << fragmentNumber++;
- (*it)->Print( os, indent + " ");
- }
- os << std::endl;
-}
-
+//-----------------------------------------------------------------------------
+// Public
void JPEGFragmentsInfo::DecompressFromFile(std::ifstream *fp, uint8_t *buffer, int nBits, int , int )
{
// Pointer to the Raw image
return Fragments.size();
}
-} // end namespace gdcm
+//-----------------------------------------------------------------------------
+// Protected
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print self.
+ * @param os Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
+ */
+void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent )
+{
+ os << std::endl;
+ os << indent
+ << "----------------- JPEG fragments --------------------------------"
+ << std::endl << std::endl;
+ os << indent
+ << "Total number of fragments : " << Fragments.size()
+ << std::endl;
+ int fragmentNumber = 0;
+ for(JPEGFragmentsList::iterator it = Fragments.begin();
+ it != Fragments.end();
+ ++it)
+ {
+ os << indent
+ << " fragment number :" << fragmentNumber++;
+ (*it)->Print( os, indent + " ");
+ }
+ os << std::endl;
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmJpeg2000.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 17:17:12 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ 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
namespace gdcm
{
-
//-----------------------------------------------------------------------------
/**
* \brief routine for JPEG decompression
std::cout << "Sorry JPEG 2000 File not yet taken into account" << std::endl;
return false;
}
-} // end namespace gdcm
//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 06:17:22 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2005/02/01 10:29:55 $
+ Version: $Revision: 1.43 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
+//-----------------------------------------------------------------------------
#define str2num(str, typeNum) *((typeNum *)(str))
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
PixelReadConvert::PixelReadConvert()
LutBlueData =0;
}
+PixelReadConvert::~PixelReadConvert()
+{
+ Squeeze();
+}
+
+//-----------------------------------------------------------------------------
+// Public
void PixelReadConvert::Squeeze()
{
if ( RGB )
LutRGBA = 0;
}
-PixelReadConvert::~PixelReadConvert()
-{
- Squeeze();
-}
-
void PixelReadConvert::AllocateRGB()
{
if ( RGB )
return true;
}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
/**
* \brief Print self.
* @param indent Indentation string to be prepended during printing.
}
}
+//-----------------------------------------------------------------------------
} // end namespace gdcm
// NOTES on File internal calls
Program: gdcm
Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
//-----------------------------------------------------------------------------
// Constructor / Destructor
-
-/// \brief Construcror
+/**
+ * \brief Construcror
+ */
PixelWriteConvert::PixelWriteConvert()
{
ReadData = 0;
UserDataSize = 0;
}
-/// \brief Destructor
+/**
+ * \brief Destructor
+ */
PixelWriteConvert::~PixelWriteConvert()
{
}
//-----------------------------------------------------------------------------
// Public
-
/**
* \brief SetReadData
* @param data data
}
}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+
//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmRLEFrame.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 06:17:22 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ 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
namespace gdcm
{
+//-------------------------------------------------------------------------
+// Constructor / Destructor
-/**
- * \brief Print self.
- * @param indent Indentation string to be prepended during printing.
- * @param os Stream to print to.
- */
-void RLEFrame::Print( std::ostream &os, std::string indent )
-{
- os << indent
- << "--- fragments"
- << std::endl;
- for ( unsigned int i = 0; i < NumberOfFragments; i++ )
- {
- os << indent
- << " offset : " << Offset[i]
- << " length : " << Length[i]
- << std::endl;
- }
-}
-
+//-----------------------------------------------------------------------------
+// Public
void RLEFrame::SetOffset(unsigned int id,long offset)
{
gdcmAssertMacro(id<15);
return true;
}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os Stream to print to.
+ */
+void RLEFrame::Print( std::ostream &os, std::string indent )
+{
+ os << indent
+ << "--- fragments"
+ << std::endl;
+ for ( unsigned int i = 0; i < NumberOfFragments; i++ )
+ {
+ os << indent
+ << " offset : " << Offset[i]
+ << " length : " << Length[i]
+ << std::endl;
+ }
+}
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 06:17:22 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ 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
namespace gdcm
{
-
+//-------------------------------------------------------------------------
+// Constructor / Destructor
RLEFramesInfo::~RLEFramesInfo()
{
for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
Frames.clear();
}
-/**
- * \brief Print self.
- * @param indent Indentation string to be prepended during printing.
- * @param os Stream to print to.
- */
-void RLEFramesInfo::Print( std::ostream &os, std::string indent )
-{
- os << std::endl;
- os << indent
- << "----------------- RLE frames --------------------------------"
- << std::endl;
- os << indent
- << "Total number of Frames : " << Frames.size()
- << std::endl;
- int frameNumber = 0;
- for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
- {
- os << indent
- << " frame number :" << frameNumber++
- << std::endl;
- (*it)->Print( os, indent + " " );
- }
-}
-
+//-----------------------------------------------------------------------------
+// Public
void RLEFramesInfo::AddFrame(RLEFrame *frame)
{
Frames.push_back(frame);
return true;
}
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print self.
+ * @param indent Indentation string to be prepended during printing.
+ * @param os Stream to print to.
+ */
+void RLEFramesInfo::Print( std::ostream &os, std::string indent )
+{
+ os << std::endl;
+ os << indent
+ << "----------------- RLE frames --------------------------------"
+ << std::endl;
+ os << indent
+ << "Total number of Frames : " << Frames.size()
+ << std::endl;
+ int frameNumber = 0;
+ for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it)
+ {
+ os << indent
+ << " frame number :" << frameNumber++
+ << std::endl;
+ (*it)->Print( os, indent + " " );
+ }
+}
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:34 $
- Version: $Revision: 1.63 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.64 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
//-----------------------------------------------------------------------------
-// Print
-/*
- * \brief canonical Printer
- * @param os Stream to print to.
- * @param indent Indentation string to be prepended during printing.
- */
-void SQItem::Print(std::ostream &os, std::string const &)
-{
- std::ostringstream s;
-
- if (SQDepthLevel > 0)
- {
- for (int i = 0; i < SQDepthLevel; ++i)
- {
- s << " | " ;
- }
- }
- os << s.str() << " --- SQItem number " << SQItemNumber << std::endl;
- for (ListDocEntry::iterator i = DocEntries.begin();
- i != DocEntries.end();
- ++i)
- {
- DocEntry *Entry = *i;
- bool PrintEndLine = true;
-
- os << s.str();
- Entry->SetPrintLevel(PrintLevel);
- Entry->Print(os);
- if ( dynamic_cast<SeqEntry*>(Entry) )
- {
- PrintEndLine = false;
- }
- if (PrintEndLine)
- {
- os << std::endl;
- }
- }
-}
-
+// Public
/*
* \brief canonical Writer
* @param fp file pointer to an already open file.
}
-//-----------------------------------------------------------------------------
-// Public
/**
* \brief Remove all entry in the Sequence Item
*/
//-----------------------------------------------------------------------------
// Private
-
//-----------------------------------------------------------------------------
+// Print
+/*
+ * \brief canonical Printer
+ * @param os Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
+ */
+void SQItem::Print(std::ostream &os, std::string const &)
+{
+ std::ostringstream s;
+ if (SQDepthLevel > 0)
+ {
+ for (int i = 0; i < SQDepthLevel; ++i)
+ {
+ s << " | " ;
+ }
+ }
+ os << s.str() << " --- SQItem number " << SQItemNumber << std::endl;
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
+ ++i)
+ {
+ DocEntry *Entry = *i;
+ bool PrintEndLine = true;
+
+ os << s.str();
+ Entry->SetPrintLevel(PrintLevel);
+ Entry->Print(os);
+ if ( dynamic_cast<SeqEntry*>(Entry) )
+ {
+ PrintEndLine = false;
+ }
+ if (PrintEndLine)
+ {
+ os << std::endl;
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:34 $
- Version: $Revision: 1.51 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.52 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
}
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief canonical Printer
- */
-void SeqEntry::Print( std::ostream &os, std::string const & )
-{
- // First, Print the Dicom Element itself.
- os << "S ";
- DocEntry::Print(os);
- os << std::endl;
-
- if (GetReadLength() == 0)
- return;
-
- // Then, Print each SQ Item
- for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-
- // at end, print the sequence terminator item, if any
- if (DelimitorMode)
- {
- for ( int i = 0; i < SQDepthLevel; i++ )
- {
- os << " | " ;
- }
- if (SeqTerm != NULL)
- {
- SeqTerm->SetPrintLevel(PrintLevel);
- SeqTerm->Print(os);
- os << std::endl;
- }
- else
- {
- // fuse
- gdcmVerboseMacro(" -------- should have a sequence terminator item");
- }
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/*
return *(Items.end());
}
-/// \brief returns the number of SQItems within the current Sequence
+/**
+ * \brief returns the number of SQItems within the current Sequence
+ */
unsigned int SeqEntry::GetNumberOfSQItems()
{
return Items.size();
}
-/// \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
-/// @param sqItem SQItem to be pushed back in the SeqEntry
-/// @param itemNumber ordinal number of the SQItem
-/// \note NOT end-user intendend method !
+/**
+ * \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
+ * @param sqItem SQItem to be pushed back in the SeqEntry
+ * @param itemNumber ordinal number of the SQItem
+ * \note NOT end-user intendend method !
+ */
void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
{
// FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
// Private
//-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief canonical Printer
+ */
+void SeqEntry::Print( std::ostream &os, std::string const & )
+{
+ // First, Print the Dicom Element itself.
+ os << "S ";
+ DocEntry::Print(os);
+ os << std::endl;
+ if (GetReadLength() == 0)
+ return;
+
+ // Then, Print each SQ Item
+ for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+
+ // at end, print the sequence terminator item, if any
+ if (DelimitorMode)
+ {
+ for ( int i = 0; i < SQDepthLevel; i++ )
+ {
+ os << " | " ;
+ }
+ if (SeqTerm != NULL)
+ {
+ SeqTerm->SetPrintLevel(PrintLevel);
+ SeqTerm->Print(os);
+ os << std::endl;
+ }
+ else
+ {
+ // fuse
+ gdcmVerboseMacro(" -------- should have a sequence terminator item");
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/31 12:19:34 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ 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
}
}
-//-----------------------------------------------------------------------------
-// Print
-
-/**
- * \brief Canonical printer.
- */
-void SerieHeader::Print()
-{
- // For all the Coherent File lists of the gdcm::Serie
- CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin();
- if ( itl == CoherentGdcmFileListHT.end() )
- {
- gdcmVerboseMacro( "No Coherent File list found" );
- return;
- }
- while (itl != CoherentGdcmFileListHT.end())
- {
- std::cout << "Serie UID :[" << itl->first << "]" << std::endl;
-
- // For all the files of a Coherent File list
- for (GdcmFileList::iterator it = (itl->second)->begin();
- it != (itl->second)->end();
- ++it)
- {
- std::cout << " --- " << (*it)->GetFileName() << std::endl;
- }
- ++itl;
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/**
return true;
}
-} // end namespace gdcm
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Canonical printer.
+ */
+void SerieHeader::Print()
+{
+ // For all the Coherent File lists of the gdcm::Serie
+ CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin();
+ if ( itl == CoherentGdcmFileListHT.end() )
+ {
+ gdcmVerboseMacro( "No Coherent File list found" );
+ return;
+ }
+ while (itl != CoherentGdcmFileListHT.end())
+ {
+ std::cout << "Serie UID :[" << itl->first << "]" << std::endl;
+
+ // For all the files of a Coherent File list
+ for (GdcmFileList::iterator it = (itl->second)->begin();
+ it != (itl->second)->end();
+ ++it)
+ {
+ std::cout << " --- " << (*it)->GetFileName() << std::endl;
+ }
+ ++itl;
+ }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/01/23 10:12:34 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
"Unknown Transfer Syntax"
};
+//-----------------------------------------------------------------------------
void FillDefaultTSDict(TSHT &ts);
+
//-----------------------------------------------------------------------------
// Constructor / Destructor
TS::TS()
}
}
-//-----------------------------------------------------------------------------
TS::~TS()
{
TsMap.clear();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Print all
- * @param os The output stream to be written to.
- */
-void TS::Print(std::ostream &os)
-{
- std::ostringstream s;
-
- for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
- {
- s << "TS : " << it->first << " = " << it->second << std::endl;
- }
- os << s.str();
-}
-
//-----------------------------------------------------------------------------
// Public
int TS::Count(TSKey const &key)
// Private
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print all
+ * @param os The output stream to be written to.
+ */
+void TS::Print(std::ostream &os)
+{
+ std::ostringstream s;
+ for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
+ {
+ s << "TS : " << it->first << " = " << it->second << std::endl;
+ }
+ os << s.str();
+}
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 17:29:59 $
- Version: $Revision: 1.127 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.128 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// For GetCurrentThreadID()
#ifdef __linux__
-#include <sys/types.h>
-#include <linux/unistd.h>
+ #include <sys/types.h>
+ #include <linux/unistd.h>
#endif
#ifdef __sun
-#include <thread.h>
+ #include <thread.h>
#endif
namespace gdcm
{
+//-------------------------------------------------------------------------
const std::string Util::GDCM_UID = "1.2.826.0.1.3680043.2.1143";
std::string Util::RootUID = GDCM_UID;
+//-------------------------------------------------------------------------
/**
* \brief Provide a better 'c++' approach for sprintf
* For example c code is:
* gdcm style code is
* Format("%04x|%04x", group , elem);
*/
-
std::string Util::Format(const char *format, ...)
{
char buffer[2048];
#endif
}
-
-
#ifdef _WIN32
-typedef BOOL(WINAPI * pSnmpExtensionInit) (
- IN DWORD dwTimeZeroReference,
- OUT HANDLE * hPollForTrapEvent,
- OUT AsnObjectIdentifier * supportedView);
-
-typedef BOOL(WINAPI * pSnmpExtensionTrap) (
- OUT AsnObjectIdentifier * enterprise,
- OUT AsnInteger * genericTrap,
- OUT AsnInteger * specificTrap,
- OUT AsnTimeticks * timeStamp,
- OUT RFC1157VarBindList * variableBindings);
-
-typedef BOOL(WINAPI * pSnmpExtensionQuery) (
- IN BYTE requestType,
- IN OUT RFC1157VarBindList * variableBindings,
- OUT AsnInteger * errorStatus,
- OUT AsnInteger * errorIndex);
-
-typedef BOOL(WINAPI * pSnmpExtensionInitEx) (
- OUT AsnObjectIdentifier * supportedView);
+ typedef BOOL(WINAPI * pSnmpExtensionInit) (
+ IN DWORD dwTimeZeroReference,
+ OUT HANDLE * hPollForTrapEvent,
+ OUT AsnObjectIdentifier * supportedView);
+
+ typedef BOOL(WINAPI * pSnmpExtensionTrap) (
+ OUT AsnObjectIdentifier * enterprise,
+ OUT AsnInteger * genericTrap,
+ OUT AsnInteger * specificTrap,
+ OUT AsnTimeticks * timeStamp,
+ OUT RFC1157VarBindList * variableBindings);
+
+ typedef BOOL(WINAPI * pSnmpExtensionQuery) (
+ IN BYTE requestType,
+ IN OUT RFC1157VarBindList * variableBindings,
+ OUT AsnInteger * errorStatus,
+ OUT AsnInteger * errorIndex);
+
+ typedef BOOL(WINAPI * pSnmpExtensionInitEx) (
+ OUT AsnObjectIdentifier * supportedView);
#endif //_WIN32
// We should investiage the use of SIZEOF_ADDR_IFREQ
//
#ifdef HAVE_SA_LEN
-#ifndef max
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif
-#define ifreq_size(i) max(sizeof(struct ifreq),\
- sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
+ #ifndef max
+ #define max(a,b) ((a) > (b) ? (a) : (b))
+ #endif
+ #define ifreq_size(i) max(sizeof(struct ifreq),\
+ sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
#else
-#define ifreq_size(i) sizeof(struct ifreq)
+ #define ifreq_size(i) sizeof(struct ifreq)
#endif // HAVE_SA_LEN
if( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0 )
// SUSv2 guarantees that `Host names are limited to 255 bytes'.
// POSIX 1003.1-2001 guarantees that `Host names (not including the
// terminating NUL) are limited to HOST_NAME_MAX bytes'.
-# define HOST_NAME_MAX 255
+#define HOST_NAME_MAX 255
// In this case we should maybe check the string was not truncated.
// But I don't known how to check that...
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
// get process identification, POSIX
return (unsigned int)getpid();
#endif
-
}
/**
return RootUID;
}
+//-------------------------------------------------------------------------
/**
* \brief
* @param os ostream to write to
return os.write(val.c_str(), val.size());
}
+//-------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/28 17:01:30 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ 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
namespace gdcm
{
+//-----------------------------------------------------------------------------
void FillDefaultVRDict(VRHT &vr);
+
//-----------------------------------------------------------------------------
+// Constructor / Destructor
/**
* \brief Constructor
*/
-
VR::VR()
{
std::string filename = DictSet::BuildDictPath() + DICT_VR;
}
}
-//-----------------------------------------------------------------------------
/**
* \brief Destructor
*/
vr.clear();
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief Print all
- * @param os The output stream to be written to.
- */
-void VR::Print(std::ostream &os)
-{
- std::ostringstream s;
-
- for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it)
- {
- s << "VR : " << it->first << " = " << it->second << std::endl;
- }
- os << s.str();
-}
-
//-----------------------------------------------------------------------------
// Public
/**
return vr.count(key);
}
-//-----------------------------------------------------------------------------
/**
* \brief Simple predicate that checks whether the given argument
* corresponds to the Value Representation of a \ref BinEntry .
// Private
//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print all
+ * @param os The output stream to be written to.
+ */
+void VR::Print(std::ostream &os)
+{
+ std::ostringstream s;
+ for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it)
+ {
+ s << "VR : " << it->first << " = " << it->second << std::endl;
+ }
+ os << s.str();
+}
+
+//-----------------------------------------------------------------------------
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/30 17:30:57 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
-// CLEAN ME
+//-----------------------------------------------------------------------------
#define MAX_SIZE_PRINT_ELEMENT_VALUE 128
//-----------------------------------------------------------------------------
{
}
+//-----------------------------------------------------------------------------
+// Public
+/**
+ * \brief Sets the std::string representable' value of a ValEntry
+ * @param val value to set
+ */
+void ValEntry::SetValue(std::string const &val)
+{
+ // Integers have a special treatement for their length:
+ int l = val.length();
+ if ( l != 0) // To avoid to be cheated by 'zero length' integers
+ {
+ const VRKey &vr = GetVR();
+ if( vr == "US" || vr == "SS" )
+ {
+ // for multivaluated items
+ l = (Util::CountSubstring(val, "\\") + 1) * 2;
+ ContentEntry::SetValue(val);
+ }
+ else if( vr == "UL" || vr == "SL" )
+ {
+ // for multivaluated items
+ l = (Util::CountSubstring(val, "\\") + 1) * 4;;
+ ContentEntry::SetValue(val);
+ }
+ else
+ {
+ std::string finalVal = Util::DicomString( val.c_str() );
+ gdcmAssertMacro( !(finalVal.size() % 2) );
+
+ l = finalVal.length();
+ ContentEntry::SetValue(finalVal);
+ }
+ }
+ else
+ {
+ std::string finalVal = Util::DicomString( val.c_str() );
+ gdcmAssertMacro( !(finalVal.size() % 2) );
+
+ l = finalVal.length();
+ ContentEntry::SetValue(finalVal);
+ }
+
+ SetLength(l);
+}
+
+/**
+ * \brief Writes the std::string representable' value of a ValEntry
+ * @param fp already open ofstream pointer
+ * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
+ */
+void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
+{
+ DocEntry::WriteContent(fp, filetype);
+
+ if ( GetGroup() == 0xfffe )
+ {
+ return; //delimitors have NO value
+ }
+
+ const VRKey &vr = GetVR();
+ unsigned int lgr = GetLength();
+ if (vr == "US" || vr == "SS")
+ {
+ // 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;
+ tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
+ Util::Tokenize (GetValue(), tokens, "\\");
+ for (unsigned int i=0; i<tokens.size();i++)
+ {
+ uint16_t val_uint16 = atoi(tokens[i].c_str());
+ binary_write( *fp, val_uint16);
+ }
+ tokens.clear();
+ return;
+ }
+ if (vr == "UL" || vr == "SL")
+ {
+ // Some 'Integer' fields may be multivaluated (multiple instances
+ // 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;
+ tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
+ Util::Tokenize (GetValue(), tokens, "\\");
+ for (unsigned int i=0; i<tokens.size();i++)
+ {
+ uint32_t val_uint32 = atoi(tokens[i].c_str());
+ binary_write( *fp, val_uint32);
+ }
+ tokens.clear();
+ return;
+ }
+
+ gdcmAssertMacro( lgr == GetValue().length() );
+ binary_write(*fp, GetValue());
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
//-----------------------------------------------------------------------------
// Print
/**
os << s.str();
}
-//-----------------------------------------------------------------------------
-// Public
-
-/**
- * \brief Sets the std::string representable' value of a ValEntry
- * @param val value to set
- */
-void ValEntry::SetValue(std::string const &val)
-{
- // Integers have a special treatement for their length:
- int l = val.length();
- if ( l != 0) // To avoid to be cheated by 'zero length' integers
- {
- const VRKey &vr = GetVR();
- if( vr == "US" || vr == "SS" )
- {
- // for multivaluated items
- l = (Util::CountSubstring(val, "\\") + 1) * 2;
- ContentEntry::SetValue(val);
- }
- else if( vr == "UL" || vr == "SL" )
- {
- // for multivaluated items
- l = (Util::CountSubstring(val, "\\") + 1) * 4;;
- ContentEntry::SetValue(val);
- }
- else
- {
- std::string finalVal = Util::DicomString( val.c_str() );
- gdcmAssertMacro( !(finalVal.size() % 2) );
-
- l = finalVal.length();
- ContentEntry::SetValue(finalVal);
- }
- }
- else
- {
- std::string finalVal = Util::DicomString( val.c_str() );
- gdcmAssertMacro( !(finalVal.size() % 2) );
-
- l = finalVal.length();
- ContentEntry::SetValue(finalVal);
- }
-
- SetLength(l);
-}
-
-/**
- * \brief Writes the std::string representable' value of a ValEntry
- * @param fp already open ofstream pointer
- * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
- */
-void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
-{
- DocEntry::WriteContent(fp, filetype);
-
- if ( GetGroup() == 0xfffe )
- {
- return; //delimitors have NO value
- }
-
- const VRKey &vr = GetVR();
- unsigned int lgr = GetLength();
- if (vr == "US" || vr == "SS")
- {
- // 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;
- tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
- Util::Tokenize (GetValue(), tokens, "\\");
- for (unsigned int i=0; i<tokens.size();i++)
- {
- uint16_t val_uint16 = atoi(tokens[i].c_str());
- binary_write( *fp, val_uint16);
- }
- tokens.clear();
- return;
- }
- if (vr == "UL" || vr == "SL")
- {
- // Some 'Integer' fields may be multivaluated (multiple instances
- // 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;
- tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
- Util::Tokenize (GetValue(), tokens, "\\");
- for (unsigned int i=0; i<tokens.size();i++)
- {
- uint32_t val_uint32 = atoi(tokens[i].c_str());
- binary_write( *fp, val_uint32);
- }
- tokens.clear();
- return;
- }
-
- gdcmAssertMacro( lgr == GetValue().length() );
- binary_write(*fp, GetValue());
-}
-
-//-----------------------------------------------------------------------------
-// Protected
-
-//-----------------------------------------------------------------------------
-// Private
-
//-----------------------------------------------------------------------------
} // end namespace gdcm