Program: gdcm
Module: $RCSfile: TestVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 17:16:15 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcm::VR vr;
// There should be 16 entries
vr.Print( std::cout );
+
vr.IsVROfStringRepresentable( "" );
vr.IsVROfBinaryRepresentable( "" );
vr.IsVROfSequence( "" );
Program: gdcm
Module: $RCSfile: gdcmBase.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 17:08:06 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Print all the object
* @param os The output stream to be written to.
*/
-void Base::Print(std::ostream & os)
+void Base::Print(std::ostream &os)
{
}
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:36 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ 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
/**
* \brief Constructor from a given BinEntry
*/
-BinEntry::BinEntry(DictEntry* e) : ValEntry(e)
+BinEntry::BinEntry(DictEntry *e) : ValEntry(e)
{
BinArea = 0;
SelfArea = true;
* \brief Constructor from a given BinEntry
* @param e Pointer to existing Doc entry
*/
-BinEntry::BinEntry(DocEntry* e) : ValEntry(e->GetDictEntry())
+BinEntry::BinEntry(DocEntry *e) : ValEntry(e->GetDictEntry())
{
UsableLength = e->GetLength();
ReadLength = e->GetReadLength();
* @param fp already open file pointer
* @param filetype type of the file to be written
*/
-void BinEntry::WriteContent(std::ofstream* fp, FileType filetype)
+void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
DocEntry::WriteContent(fp, filetype);
void* binArea = GetBinArea();
/// \brief Sets the value (non string) of the current Dicom Header Entry
-void BinEntry::SetBinArea( uint8_t* area, bool self )
+void BinEntry::SetBinArea( uint8_t *area, bool self )
{
if (BinArea && SelfArea)
delete[] BinArea;
Program: gdcm
Module: $RCSfile: gdcmBinEntry.h,v $
Language: C++
- Date: $Date: 2004/12/07 13:39:32 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT BinEntry : public ValEntry
{
public:
- BinEntry( DictEntry* e );
- BinEntry( DocEntry* d );
+ BinEntry( DictEntry *e );
+ BinEntry( DocEntry *d );
~BinEntry();
void Print( std::ostream &os = std::cout );
- void WriteContent( std::ofstream*, FileType );
+ void WriteContent( std::ofstream *fp, FileType ft);
/// \brief Returns the area value of the current Dicom Header Entry
/// when it's not string-translatable (e.g : a LUT table)
- uint8_t* GetBinArea() { return BinArea; }
- void SetBinArea( uint8_t* area, bool self = true );
+ uint8_t *GetBinArea() { return BinArea; }
+ void SetBinArea( uint8_t *area, bool self = true );
/// Sets the value (string) of the current Dicom Document Entry
- virtual void SetValue(std::string const & val) {SetValueOnly(val);};
+ virtual void SetValue(std::string const &val) { SetValueOnly(val); };
private:
/// \brief unsecure memory area to hold 'non string' values
/// (ie : Lookup Tables, overlays, icons)
- uint8_t* BinArea;
+ uint8_t *BinArea;
bool SelfArea;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2005/01/05 15:38:28 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ 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
#include <stdint.h> // For uint8_t uint16_t and uint32_t
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
-typedef signed char int8_t;
+typedef signed char int8_t;
#endif
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2004/11/09 22:30:43 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ 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
* @param msg1 first message part
* @param msg2 second message part
*/
-void Debug::Verbose(int level, const char * msg1, const char * msg2)
+void Debug::Verbose(int level, const char *msg1, const char *msg2)
{
if (level > DebugLevel)
{
* @param msg1 first message part
* @param msg2 second message part
*/
-void Debug::Error(bool test, const char * msg1, const char * msg2)
+void Debug::Error(bool test, const char *msg1, const char *msg2)
{
if (!test)
{
* @param msg2 second message part
* @param msg3 Third message part
*/
-void Debug::Error(const char* msg1, const char* msg2,
- const char* msg3)
+void Debug::Error(const char *msg1, const char *msg2,
+ const char *msg3)
{
std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3
<< std::endl << std::flush;
* @param msg1 first message part
* @param msg2 second message part
*/
-void Debug::Assert(int level, bool test, const char * msg1,
- const char * msg2)
+void Debug::Assert(int level, bool test, const char *msg1,
+ const char *msg2)
{
if (level > DebugLevel)
{
Program: gdcm
Module: $RCSfile: gdcmDebug.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Debug(int level = -1);
void SetDebug (int level);
- void Verbose(int level, const char* msg1, const char* msg2 = "") ;
- void Error (bool test, const char* msg1, const char* msg2 = "");
- void Error (const char* msg1, const char* msg2 = "", const char* msg3 = "");
+ void Verbose(int level, const char *msg1, const char *msg2 = "") ;
+ void Error (bool test, const char *msg1, const char *msg2 = "");
+ void Error (const char *msg1, const char *msg2 = "", const char *msg3 = "");
- void Assert(int level, bool test, const char * msg1, const char * msg2);
+ void Assert(int level, bool test, const char *msg1, const char *msg2);
void Exit(int a);
static Debug &GetReference();
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 15:41:28 $
- Version: $Revision: 1.91 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.92 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* - false if user passed an already built DICOMDIR file
* and wants to use it
*/
-DicomDir::DicomDir(std::string const & fileName, bool parseDir ):
+DicomDir::DicomDir(std::string const &fileName, bool parseDir ):
Document( fileName )
{
// Whatever user passed (a root directory or a DICOMDIR)
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void DicomDir::SetStartMethod( DicomDir::Method* method, void* arg,
- DicomDir::Method* argDelete )
+void DicomDir::SetStartMethod( DicomDir::Method *method, void *arg,
+ DicomDir::Method *argDelete )
{
if( StartArg && StartMethodArgDelete )
{
* class is destroyed
* @param method Method to call to delete the argument
*/
-void DicomDir::SetStartMethodArgDelete( DicomDir::Method* method )
+void DicomDir::SetStartMethodArgDelete( DicomDir::Method *method )
{
StartMethodArgDelete = method;
}
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void DicomDir::SetProgressMethod( DicomDir::Method* method, void* arg,
- DicomDir::Method* argDelete )
+void DicomDir::SetProgressMethod( DicomDir::Method *method, void *arg,
+ DicomDir::Method *argDelete )
{
if( ProgressArg && ProgressMethodArgDelete )
{
* class is destroyed
* @param method Method to call to delete the argument
*/
-void DicomDir::SetProgressMethodArgDelete( DicomDir::Method* method )
+void DicomDir::SetProgressMethodArgDelete( DicomDir::Method *method )
{
ProgressMethodArgDelete = method;
}
* @param argDelete Argument
* \warning In python : the arg parameter isn't considered
*/
-void DicomDir::SetEndMethod( DicomDir::Method* method, void* arg,
- DicomDir::Method* argDelete )
+void DicomDir::SetEndMethod( DicomDir::Method *method, void *arg,
+ DicomDir::Method *argDelete )
{
if( EndArg && EndMethodArgDelete )
{
* the class is destroyed
* @param method Method to call to delete the argument
*/
-void DicomDir::SetEndMethodArgDelete( DicomDir::Method* method )
+void DicomDir::SetEndMethodArgDelete( DicomDir::Method *method )
{
EndMethodArgDelete = method;
}
* @return false only when fail to open
*/
-bool DicomDir::WriteDicomDir(std::string const& fileName)
+bool DicomDir::WriteDicomDir(std::string const &fileName)
{
int i;
uint16_t sq[4] = { 0x0004, 0x1220, 0xffff, 0xffff };
uint16_t sqt[4]= { 0xfffe, 0xe0dd, 0xffff, 0xffff };
- std::ofstream* fp = new std::ofstream(fileName.c_str(),
+ std::ofstream *fp = new std::ofstream(fileName.c_str(),
std::ios::out | std::ios::binary);
if( !fp )
{
}
else // after root directory parsing
{
- ListDicomDirMetaElem const & elemList =
+ ListDicomDirMetaElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirMetaElements();
m->FillObject(elemList);
}
/**
* \brief adds a new Patient (with the basic elements) to a partially created DICOMDIR
*/
-DicomDirPatient * DicomDir::NewPatient()
+DicomDirPatient *DicomDir::NewPatient()
{
ListDicomDirPatientElem::const_iterator it;
uint16_t tmpGr,tmpEl;
* GDCM_DICOMDIR_STUDY, GDCM_DICOMDIR_SERIE ...)
* @param header Header of the current file
*/
-void DicomDir::SetElement(std::string const & path, DicomDirType type,
+void DicomDir::SetElement(std::string const &path, DicomDirType type,
Document *header)
{
ListDicomDirElem elemList; //FIXME this is going to be a by copy operation
return;
}
- SeqEntry* s = dynamic_cast<SeqEntry*>(e);
+ SeqEntry *s = dynamic_cast<SeqEntry *>(e);
if ( !s )
{
dbg.Verbose(0, "DicomDir::CreateDicomDir: no SeqEntry present");
ListSQItem listItems = s->GetSQItems();
- DocEntry * d;
+ DocEntry *d;
std::string v;
- SQItem * si;
+ SQItem *si;
for( ListSQItem::iterator i = listItems.begin();
i !=listItems.end(); ++i )
{
d = (*i)->GetDocEntryByNumber(0x0004, 0x1430); // Directory Record Type
- if ( ValEntry* valEntry = dynamic_cast< ValEntry* >(d) )
+ if ( ValEntry* valEntry = dynamic_cast<ValEntry *>(d) )
{
v = valEntry->GetValue();
}
* Only DocEntry's are moved
*
*/
-void DicomDir::MoveSQItem(SQItem* dst,SQItem *src)
+void DicomDir::MoveSQItem(SQItem *dst,SQItem *src)
{
DocEntry *entry;
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:36 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ 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
class DicomDirImage;
class SQItem;
-typedef std::list<DicomDirPatient*> ListDicomDirPatient;
-typedef std::vector<Document*> VectDocument;
+typedef std::list<DicomDirPatient *> ListDicomDirPatient;
+typedef std::vector<Document *> VectDocument;
//-----------------------------------------------------------------------------
public:
typedef void(Method)(void*);
- DicomDir( std::string const & filename, bool parseDir = false );
+ DicomDir( std::string const &filename, bool parseDir = false );
DicomDir();
~DicomDir();
// Note: the DicomDir:: namespace prefix is needed by Swig in the
// following method declarations. Refer to gdcmPython/gdcm.i
// for the reasons of this unecessary notation at C++ level.
- void SetStartMethod( DicomDir::Method*,
+ void SetStartMethod( DicomDir::Method *m,
void* = NULL,
- DicomDir::Method* = NULL );
- void SetProgressMethod( DicomDir::Method*,
+ DicomDir::Method *m = NULL );
+ void SetProgressMethod( DicomDir::Method *m,
void* = NULL,
- DicomDir::Method* = NULL );
- void SetEndMethod( DicomDir::Method*,
+ DicomDir::Method *m = NULL );
+ void SetEndMethod( DicomDir::Method *m,
void* = NULL,
- DicomDir::Method* = NULL );
- void SetStartMethodArgDelete( DicomDir::Method* );
- void SetProgressMethodArgDelete( DicomDir::Method* );
- void SetEndMethodArgDelete( DicomDir::Method* );
+ DicomDir::Method *m = NULL );
+ void SetStartMethodArgDelete( DicomDir::Method *m );
+ void SetProgressMethodArgDelete( DicomDir::Method *m );
+ void SetEndMethodArgDelete( DicomDir::Method *m );
/// GetProgress GetProgress
float GetProgress() { return Progress; };
bool IsAborted() { return Abort; };
/// Adding
- DicomDirMeta* NewMeta();
- DicomDirPatient* NewPatient();
+ DicomDirMeta *NewMeta();
+ DicomDirPatient *NewPatient();
/// Write
- bool WriteDicomDir(std::string const & fileName);
+ bool WriteDicomDir(std::string const &fileName);
/// Types of the DicomDirObject within the DicomDir
typedef enum
} DicomDirType;
protected:
- void CreateDicomDirChainedList(std::string const & path);
+ void CreateDicomDirChainedList(std::string const &path);
void CallStartMethod();
void CallProgressMethod();
void CallEndMethod();
void CreateDicomDir();
bool AddDicomDirMeta();
- bool AddDicomDirPatientToEnd(DicomDirPatient* dd);
- bool AddDicomDirStudyToEnd (DicomDirStudy* dd);
- bool AddDicomDirSerieToEnd (DicomDirSerie* dd);
- bool AddDicomDirImageToEnd (DicomDirImage* dd);
+ bool AddDicomDirPatientToEnd(DicomDirPatient *dd);
+ bool AddDicomDirStudyToEnd (DicomDirStudy *dd);
+ bool AddDicomDirSerieToEnd (DicomDirSerie *dd);
+ bool AddDicomDirImageToEnd (DicomDirImage *dd);
- void SetElements(std::string const & path, VectDocument const &list);
- void SetElement (std::string const & path, DicomDirType type,
- Document* header);
- void MoveSQItem(SQItem* dst,SQItem *src);
+ void SetElements(std::string const &path, VectDocument const &list);
+ void SetElement (std::string const &path, DicomDirType type,
+ Document *header);
+ void MoveSQItem(SQItem *dst,SQItem *src);
- static bool HeaderLessThan(Document* header1, Document* header2);
+ static bool HeaderLessThan(Document *header1, Document *header2);
// Variables
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2004/11/04 15:59:37 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/01/06 20:03:26 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Public
-bool DicomDirElement::AddNewEntry(std::string const & type,
- Element const & elem)
+bool DicomDirElement::AddNewEntry(std::string const &type,
+ Element const &elem)
{
if( type == "metaElem" )
{
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2005/01/05 15:38:28 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
* \brief returns a reference to the chained List
* related to the META Elements of a DICOMDIR.
*/
- ListDicomDirMetaElem const & GetDicomDirMetaElements() const
+ ListDicomDirMetaElem const &GetDicomDirMetaElements() const
{ return DicomDirMetaList; };
/**
* \brief returns a reference to the chained List
* related to the PATIENT Elements of a DICOMDIR.
*/
- ListDicomDirPatientElem const & GetDicomDirPatientElements() const
+ ListDicomDirPatientElem const &GetDicomDirPatientElements() const
{ return DicomDirPatientList; };
/**
* \brief returns a reference to the chained List
* related to the STUDY Elements of a DICOMDIR.
*/
- ListDicomDirStudyElem const & GetDicomDirStudyElements() const
+ ListDicomDirStudyElem const &GetDicomDirStudyElements() const
{ return DicomDirStudyList; };
/**
* \brief returns a reference to the chained List
* related to the SERIE Elements of a DICOMDIR.
*/
- ListDicomDirSerieElem const & GetDicomDirSerieElements() const
+ ListDicomDirSerieElem const &GetDicomDirSerieElements() const
{ return DicomDirSerieList; };
/**
* \brief returns a reference to the chained List
* related to the IMAGE Elements of a DICOMDIR.
*/
- ListDicomDirImageElem const & GetDicomDirImageElements() const
+ ListDicomDirImageElem const &GetDicomDirImageElements() const
{ return DicomDirImageList; };
/**
* Public method to add an element
*/
- bool AddNewEntry(std::string const & type, Element const & elem);
+ bool AddNewEntry(std::string const &type, Element const &elem);
private:
/// Elements chained list, related to the MetaElements of DICOMDIR
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
/**
* \brief Prints the Meta Elements
*/
-void DicomDirMeta::Print(std::ostream& os)
+void DicomDirMeta::Print(std::ostream &os)
{
os << "META" << std::endl;
// warning : META doesn't behave exactly like a Objet
* \brief Writes the Meta Elements
* @return
*/
-void DicomDirMeta::WriteContent(std::ofstream* fp, FileType t)
+void DicomDirMeta::WriteContent(std::ofstream *fp, FileType t)
{
for (ListDocEntry::iterator i = DocEntries.begin();
i != DocEntries.end();
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
~DicomDirMeta();
virtual void Print(std::ostream &os = std::cout);
- virtual void WriteContent(std::ofstream * fp, FileType t);
+ virtual void WriteContent(std::ofstream *fp, FileType t);
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* of a partially created DICOMDIR
* @param elemList Element List to add at the right place
*/
-void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList)
+void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
{
// FillObject rempli le SQItem qui sera accroche au bon endroit
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.h,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<DicomDirObject *> ListContent;
public:
TagDocEntryHT GetEntry();
- void FillObject(ListDicomDirMetaElem const & elemList);
+ void FillObject(ListDicomDirMetaElem const &elemList);
protected:
// Constructor and destructor are protected to avoid end user to
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Prints the Object
* @param os ostream to write to
*/
-void DicomDirPatient::Print(std::ostream& os)
+void DicomDirPatient::Print(std::ostream &os)
{
os << "PATIENT" << std::endl;
DicomDirObject::Print(os);
* @param fp ofstream to write to
* @param t Type of the File (explicit VR, implicitVR, ...)
*/
-void DicomDirPatient::WriteContent(std::ofstream* fp, FileType t)
+void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t)
{
DicomDirObject::WriteContent(fp, t);
*/
DicomDirStudy* DicomDirPatient::NewStudy()
{
- ListDicomDirStudyElem const & elemList =
+ ListDicomDirStudyElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirStudyElements();
- DicomDirStudy* st = new DicomDirStudy();
+ DicomDirStudy *st = new DicomDirStudy();
st->FillObject(elemList);
Studies.push_front(st);
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void WriteContent(std::ofstream *fp, FileType t);
/// Returns the STUDY chained List for this PATIENT.
- ListDicomDirStudy const & GetDicomDirStudies() const { return Studies; };
+ ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; };
/// adds the passed STUDY to the STUDY chained List for this PATIENT.
void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); };
/// TODO
- DicomDirStudy* NewStudy();
+ DicomDirStudy *NewStudy();
private:
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Prints the Object
* @param os ostream to write to
*/
-void DicomDirSerie::Print(std::ostream& os)
+void DicomDirSerie::Print(std::ostream &os)
{
os << "SERIE" << std::endl;
DicomDirObject::Print(os);
* @param fp ofstream to write to
* @param t Type of the File (explicit VR, implicitVR, ...)
*/
-void DicomDirSerie::WriteContent(std::ofstream* fp, FileType t)
+void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t)
{
DicomDirObject::WriteContent(fp, t);
/**
* \brief adds a new Image (with the basic elements) to a partially created DICOMDIR
*/
-DicomDirImage* DicomDirSerie::NewImage()
+DicomDirImage *DicomDirSerie::NewImage()
{
- ListDicomDirImageElem const & elemList =
+ ListDicomDirImageElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirImageElements();
- DicomDirImage* st = new DicomDirImage();
+ DicomDirImage *st = new DicomDirImage();
FillObject(elemList);
Images.push_front(st);
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
DicomDirSerie();
~DicomDirSerie();
- void Print( std::ostream& os = std::cout );
- void WriteContent( std::ofstream* fp, FileType t );
+ void Print( std::ostream &os = std::cout );
+ void WriteContent( std::ofstream *fp, FileType t );
/**
* \ingroup DicomDirSerie
* \brief returns the IMAGE chained List for this SERIE.
*/
- ListDicomDirImage const & GetDicomDirImages() const { return Images; };
+ ListDicomDirImage const &GetDicomDirImages() const { return Images; };
/**
* \ingroup DicomDirSerie
* \ingroup DicomDirSerie
* \brief TODO
*/
- DicomDirImage* NewImage();
+ DicomDirImage *NewImage();
private:
/**
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
* @param os ostream to write to
* @return
*/
-void DicomDirStudy::Print(std::ostream& os)
+void DicomDirStudy::Print(std::ostream &os)
{
os << "STUDY" << std::endl;
DicomDirObject::Print(os);
* @param t Type of the File (explicit VR, implicitVR, ...)
* @return
*/
-void DicomDirStudy::WriteContent(std::ofstream* fp, FileType t)
+void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t)
{
DicomDirObject::WriteContent(fp, t);
* \brief adds a new Serie at the begining of the SerieList
* of a partially created DICOMDIR
*/
-DicomDirSerie* DicomDirStudy::NewSerie()
+DicomDirSerie *DicomDirStudy::NewSerie()
{
- ListDicomDirSerieElem const & elemList =
+ ListDicomDirSerieElem const &elemList =
Global::GetDicomDirElements()->GetDicomDirSerieElements();
DicomDirSerie* st = new DicomDirSerie();
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 17:08:06 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
* \brief removes an already existing Dicom Dictionary Entry,
* identified by its group,element number
* @param group Dicom group number of the Dicom Element
- * @param element Dicom element number of the Dicom Element
+ * @param elem Dicom element number of the Dicom Element
* @return false if Dicom Dictionary Entry doesn't exist
*/
-bool Dict::RemoveEntry (uint16_t group, uint16_t element)
+bool Dict::RemoveEntry (uint16_t group, uint16_t elem)
{
- return RemoveEntry(DictEntry::TranslateToKey(group, element));
+ return RemoveEntry(DictEntry::TranslateToKey(group, elem));
}
/**
Program: gdcm
Module: $RCSfile: gdcmDict.h,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
void PrintByName(std::ostream &os = std::cout);
// Entries
- bool AddNewEntry (DictEntry const & newEntry);
- bool ReplaceEntry(DictEntry const & newEntry);
- bool RemoveEntry (TagKey const & key);
+ bool AddNewEntry (DictEntry const &newEntry);
+ bool ReplaceEntry(DictEntry const &newEntry);
+ bool RemoveEntry (TagKey const &key);
bool RemoveEntry (uint16_t group, uint16_t element);
// Tag
- DictEntry *GetDictEntryByName(TagName const & name);
+ DictEntry *GetDictEntryByName(TagName const &name);
DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element);
EntryNamesList *GetDictEntryNames();
Program: gdcm
Module: $RCSfile: gdcmDictEntry.cxx,v $
Language: C++
- Date: $Date: 2004/11/16 02:54:35 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
DictEntry::DictEntry(uint16_t group, uint16_t element,
- TagName const & vr, TagName const & fourth,
- TagName const & name)
+ TagName const &vr, TagName const &fourth,
+ TagName const &name)
{
Group = group;
Element = element;
* \ is unset then overwrite it.
* @param vr New V(alue) R(epresentation) to be set.
*/
-void DictEntry::SetVR(TagName const & vr)
+void DictEntry::SetVR(TagName const &vr)
{
if ( IsVRUnknown() )
{
Program: gdcm
Module: $RCSfile: gdcmDictEntry.h,v $
Language: C++
- Date: $Date: 2005/01/06 13:35:38 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
DictEntry(uint16_t group,
uint16_t element,
- TagName const & vr = GDCM_UNKNOWN,
- TagName const & fourth = GDCM_UNKNOWN,
- TagName const & name = GDCM_UNKNOWN);
+ TagName const &vr = GDCM_UNKNOWN,
+ TagName const &fourth = GDCM_UNKNOWN,
+ TagName const &name = GDCM_UNKNOWN);
static TagKey TranslateToKey(uint16_t group, uint16_t element);
- void SetVR(TagName const & vr);
+ void SetVR(TagName const &vr);
/// \brief tells if the V(alue) R(epresentation) is known (?!)
/// @return
/// \brief Returns the Dicom Value Representation of the current
/// DictEntry
/// @return the Dicom Value Representation
- const TagName & GetVR() const { return VR; }
+ const TagName &GetVR() const { return VR; }
/// \brief sets the key of the current DictEntry
/// @param k New key to be set.
- void SetKey(TagName const & k) { Key = k; }
+ void SetKey(TagName const &k) { Key = k; }
/// \brief returns the Fourth field of the current DictEntry
/// \warning NOT part of the Dicom Standard.
/// May be REMOVED an any time. NEVER use it.
/// @return The Fourth field
- const TagName & GetFourth() const { return Fourth; }
+ const TagName &GetFourth() const { return Fourth; }
/// \brief Returns the Dicom Name of the current DictEntry
/// e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
/// @return the Dicom Name
- const TagName & GetName() const { return Name; }
+ const TagName &GetName() const { return Name; }
/// \brief Gets the key of the current DictEntry
/// @return the key.
- const TagName & GetKey() const { return Key; }
+ const TagName &GetKey() const { return Key; }
private:
/// \todo FIXME
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2004/10/28 19:53:29 $
- Version: $Revision: 1.44 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.45 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* contained is this DictSet, along with their respective content.
* @param os Output stream used for printing.
*/
-void DictSet::Print(std::ostream& os)
+void DictSet::Print(std::ostream &os)
{
for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
{
* \sa DictSet::GetPubDictTagNamesByCategory
* @return A list of all entries of the public dicom dictionnary.
*/
-EntryNamesList * DictSet::GetPubDictEntryNames()
+EntryNamesList *DictSet::GetPubDictEntryNames()
{
return GetDefaultPubDict()->GetDictEntryNames();
}
* corresponding values are lists of all the dictionnary entries
* among that group.
*/
-EntryNamesByCatMap * DictSet::GetPubDictEntryNamesByCategory()
+EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory()
{
return GetDefaultPubDict()->GetDictEntryNamesByCategory();
}
* @param dictName The symbolic name of the searched dictionary.
* \result The retrieved dictionary.
*/
-Dict *DictSet::GetDict(DictKey const & dictName)
+Dict *DictSet::GetDict(DictKey const &dictName)
{
DictSetHT::iterator dict = Dicts.find(dictName);
if(dict != Dicts.end())
//-----------------------------------------------------------------------------
// Protected
-bool DictSet::AppendDict(Dict *newDict, DictKey const & name)
+bool DictSet::AppendDict(Dict *newDict, DictKey const &name)
{
Dicts[name] = newDict;
Program: gdcm
Module: $RCSfile: gdcmDictSet.h,v $
Language: C++
- Date: $Date: 2005/01/05 15:38:28 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DictSet();
~DictSet();
- void Print(std::ostream& os);
+ void Print(std::ostream &os);
- EntryNamesList * GetPubDictEntryNames();
- EntryNamesByCatMap * GetPubDictEntryNamesByCategory();
+ EntryNamesList *GetPubDictEntryNames();
+ EntryNamesByCatMap* GetPubDictEntryNamesByCategory();
- Dict* LoadDictFromFile( std::string const & fileName,
- DictKey const & name );
+ Dict *LoadDictFromFile( std::string const &fileName,
+ DictKey const &name );
- Dict* GetDict( DictKey const & DictName );
+ Dict *GetDict( DictKey const &DictName );
/// \brief Retrieve the default reference DICOM V3 public dictionary.
Dict* GetDefaultPubDict() { return GetDict(PUB_DICT_NAME); };
// \brief Retrieve the virtual reference DICOM dictionary.
// \warning : not end user intended
- // Dict* GetVirtualDict() { return &VirtualEntry; };
+ // Dict *GetVirtualDict() { return &VirtualEntry; };
- DictEntry* NewVirtualDictEntry(uint16_t group, uint16_t element,
+ DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element,
TagName vr = GDCM_UNKNOWN,
TagName fourth = GDCM_UNKNOWN,
TagName name = GDCM_UNKNOWN);
static std::string BuildDictPath();
protected:
- bool AppendDict(Dict *NewDict, DictKey const & name);
+ bool AppendDict(Dict *NewDict, DictKey const &name);
private:
/// Hash table of all dictionaries contained in this DictSet
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2004/12/12 13:32:23 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param dirName root directory name
* @param recursive whether we want to explore recursively or not
*/
-DirList::DirList(std::string const & dirName, bool recursive)
+DirList::DirList(std::string const &dirName, bool recursive)
{
name = dirName;
Util::NormalizePath(name);
* \brief Get the directory name
* @return the directory name
*/
-std::string const & DirList::GetDirName() const
+std::string const &DirList::GetDirName() const
{
return name;
}
* @param dirpath directory to explore
* @param recursive whether we want recursion or not
*/
-int DirList::Explore(std::string const & dirpath, bool recursive)
+int DirList::Explore(std::string const &dirpath, bool recursive)
{
int numberOfFiles = 0;
std::string fileName;
numberOfFiles++;
}
- found = FindNextFile(hFile,&fileData);
+ found = FindNextFile(hFile, &fileData);
}
#else
// bility of your programs.
struct stat buf;
- dirent* d = 0;
+ dirent *d = 0;
for (d = readdir(dir); d; d = readdir(dir))
{
fileName = dirName + d->d_name;
Program: gdcm
Module: $RCSfile: gdcmDirList.h,v $
Language: C++
- Date: $Date: 2004/10/27 22:58:06 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class DirList: public std::list<std::string>
{
public :
- DirList(std::string const & dirName, bool recursive=false);
+ DirList(std::string const &dirName, bool recursive=false);
virtual ~DirList();
- std::string const & GetDirName() const;
+ std::string const &GetDirName() const;
/// Character '\'
static const char SEPARATOR_X;
static const std::string SEPARATOR;
private :
- int Explore(std::string const & dirName, bool recursive=false);
+ int Explore(std::string const &dirName, bool recursive=false);
/// name of the root directory to explore
std::string name;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 13:35:38 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.38 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor from a given DictEntry
* @param in Pointer to existing dictionary entry
*/
-DocEntry::DocEntry(DictEntry* in)
+DocEntry::DocEntry(DictEntry *in)
{
ImplicitVR = false;
DicomDict = in;
* \brief Prints the common part of ValEntry, BinEntry, SeqEntry
* @param os ostream we want to print in
*/
-void DocEntry::Print(std::ostream& os)
+void DocEntry::Print(std::ostream &os)
{
size_t o;
std::string st;
* @param fp already open file pointer
* @param filetype type of the file to be written
*/
-void DocEntry::WriteContent(std::ofstream* fp, FileType filetype)
+void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
uint32_t ffff = 0xffffffff;
uint16_t group = GetGroup();
* \ingroup DocEntry
* \brief Copies all the attributes from an other DocEntry
*/
-void DocEntry::Copy (DocEntry* e)
+void DocEntry::Copy (DocEntry *e)
{
// DicomDict = e->DicomDict;
UsableLength = e->UsableLength;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
uint16_t GetElement() { return DicomDict->GetElement();};
/// Returns the 'key' of the current Dicom Header Entry
- void SetKey( TagKey const & key ) { Key = key; }
+ void SetKey( TagKey const &key ) { Key = key; }
/// Returns the 'key' of the current Dicom Header Entry
- std::string const & GetKey() const { return Key; }
+ std::string const &GetKey() const { return Key; }
/// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
/// Dictionnary of the current Dicom Header Entry
- std::string const & GetName() const { return DicomDict->GetName(); };
+ std::string const &GetName() const { return DicomDict->GetName(); };
/// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name,
/// "SL" : Signed Long), found in the Dicom Header or in the Dicom
/// Dictionnary, of the current Dicom Header Entry
- std::string const & GetVR() const { return DicomDict->GetVR(); };
+ std::string const &GetVR() const { return DicomDict->GetVR(); };
/// \brief Returns offset (since the beginning of the file, including
/// the File Preamble, if any) of the value of the current Dicom HeaderEntry
uint32_t GetReadLength() { return ReadLength; };
/// Sets the 'Value Representation' of the current Dicom Header Entry
- void SetVR( TagName const & v) { DicomDict->SetVR(v); };
+ void SetVR( TagName const &v) { DicomDict->SetVR(v); };
/// \brief Sets both 'Read Length' and 'Usable Length' of the current
/// Dicom Header Entry
bool IsItemDelimitor();
bool IsSequenceDelimitor();
- virtual void Print (std::ostream & os = std::cout);
+ virtual void Print (std::ostream &os = std::cout);
private:
// FIXME: In fact we should be more specific and use :
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2005/01/06 17:20:53 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
/// \brief write any type of entry to the entry set
virtual void WriteContent (std::ofstream *fp, FileType filetype) = 0;// pure virtual
- virtual DocEntry* GetDocEntryByNumber(uint16_t group,
+ virtual DocEntry *GetDocEntryByNumber(uint16_t group,
uint16_t elem) = 0;
- DocEntry* GetDocEntryByName(TagName const & name);
+ DocEntry *GetDocEntryByName(TagName const &name);
virtual std::string GetEntryByNumber(uint16_t group, uint16_t elem) = 0;
- std::string GetEntryByName(TagName const & name);
+ std::string GetEntryByName(TagName const &name);
- DictEntry* NewVirtualDictEntry(uint16_t group,
+ DictEntry *NewVirtualDictEntry(uint16_t group,
uint16_t element,
- TagName const & vr = GDCM_UNKNOWN,
- TagName const & fourth = GDCM_UNKNOWN,
- TagName const & name = GDCM_UNKNOWN );
+ TagName const &vr = GDCM_UNKNOWN,
+ TagName const &fourth = GDCM_UNKNOWN,
+ TagName const &name = GDCM_UNKNOWN );
protected:
// DocEntry related utilities
- ValEntry* NewValEntryByNumber(uint16_t group,uint16_t elem,
- TagName const & vr = GDCM_UNKNOWN);
- BinEntry* NewBinEntryByNumber(uint16_t group,uint16_t elem,
- TagName const & vr = GDCM_UNKNOWN);
- SeqEntry* NewSeqEntryByNumber(uint16_t group,uint16_t elem);
+
+ ValEntry *NewValEntryByNumber(uint16_t group,uint16_t elem,
+ TagName const &vr = GDCM_UNKNOWN);
+ BinEntry *NewBinEntryByNumber(uint16_t group,uint16_t elem,
+ TagName const &vr = GDCM_UNKNOWN);
+ SeqEntry *NewSeqEntryByNumber(uint16_t group,uint16_t elem);
// DictEntry related utilities
- DictEntry *GetDictEntryByName (TagName const & name);
+ DictEntry *GetDictEntryByName (TagName const &name);
DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem);
DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem,
- TagName const & vr);
+ TagName const &vr);
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 17:16:15 $
- Version: $Revision: 1.160 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.161 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief constructor
* @param filename file to be opened for parsing
*/
-Document::Document( std::string const & filename ) : ElementSet(-1)
+Document::Document( std::string const &filename ) : ElementSet(-1)
{
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Filename = filename;
* \brief Prints The Dict Entries of THE public Dicom Dictionary
* @return
*/
-void Document::PrintPubDict(std::ostream & os)
+void Document::PrintPubDict(std::ostream &os)
{
RefPubDict->SetPrintLevel(PrintLevel);
RefPubDict->Print(os);
* \brief Prints The Dict Entries of THE shadow Dicom Dictionary
* @return
*/
-void Document::PrintShaDict(std::ostream & os)
+void Document::PrintShaDict(std::ostream &os)
{
RefShaDict->SetPrintLevel(PrintLevel);
RefShaDict->Print(os);
/**
* \brief Get the public dictionary used
*/
-Dict* Document::GetPubDict()
+Dict *Document::GetPubDict()
{
return RefPubDict;
}
/**
* \brief Get the shadow dictionary used
*/
-Dict* Document::GetShaDict()
+Dict *Document::GetShaDict()
{
return RefShaDict;
}
/**
* \brief Set the shadow dictionary used
- * \param dict dictionary to use in shadow
+ * @param dict dictionary to use in shadow
*/
bool Document::SetShaDict(Dict *dict)
{
/**
* \brief Set the shadow dictionary used
- * \param dictName name of the dictionary to use in shadow
+ * @param dictName name of the dictionary to use in shadow
*/
-bool Document::SetShaDict(DictKey const & dictName)
+bool Document::SetShaDict(DictKey const &dictName)
{
RefShaDict = Global::GetDicts()->GetDict(dictName);
return !RefShaDict;
// The entry might be present but not loaded (parsing and loading
// happen at different stages): try loading and proceed with check...
LoadDocEntrySafe(entry);
- if (ValEntry* valEntry = dynamic_cast< ValEntry* >(entry) )
+ if (ValEntry *valEntry = dynamic_cast< ValEntry* >(entry) )
{
std::string transfer = valEntry->GetValue();
// The actual transfer (as read from disk) might be padded. We
* checks the preamble when existing.
* @return The FILE pointer on success.
*/
-std::ifstream* Document::OpenFile()
+std::ifstream *Document::OpenFile()
{
if (Filename.length() == 0)
{
* (ACR-NEMA, ExplicitVR, ImplicitVR)
* \return Always true.
*/
-void Document::WriteContent(std::ofstream* fp, FileType filetype)
+void Document::WriteContent(std::ofstream *fp, FileType filetype)
{
/// \todo move the following lines (and a lot of others, to be written)
/// to a future function CheckAndCorrectHeader
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-ValEntry* Document::ReplaceOrCreateByNumber(std::string const & value,
+ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value,
uint16_t group,
uint16_t elem,
- TagName const & vr )
+ TagName const &vr )
{
- ValEntry* valEntry = 0;
- DocEntry* currentEntry = GetDocEntryByNumber( group, elem);
+ ValEntry *valEntry = 0;
+ DocEntry *currentEntry = GetDocEntryByNumber( group, elem);
if (currentEntry)
{
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-BinEntry* Document::ReplaceOrCreateByNumber(uint8_t* binArea,
+BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea,
int lgth,
uint16_t group,
uint16_t elem,
- TagName const & vr )
+ TagName const &vr )
{
- BinEntry* binEntry = 0;
- DocEntry* currentEntry = GetDocEntryByNumber( group, elem);
+ BinEntry *binEntry = 0;
+ DocEntry *currentEntry = GetDocEntryByNumber( group, elem);
// Verify the currentEntry
if (currentEntry)
* \return pointer to the modified/created SeqEntry (NULL when creation
* failed).
*/
-SeqEntry* Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem)
+SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem)
{
- SeqEntry* seqEntry = 0;
- DocEntry* currentEntry = GetDocEntryByNumber( group, elem);
+ SeqEntry *seqEntry = 0;
+ DocEntry *currentEntry = GetDocEntryByNumber( group, elem);
// Verify the currentEntry
if (currentEntry)
* @param elem element number of the Entry
* \return boolean
*/
-bool Document::ReplaceIfExistByNumber(std::string const & value,
+bool Document::ReplaceIfExistByNumber(std::string const &value,
uint16_t group, uint16_t elem )
{
SetEntryByNumber(value, group, elem);
* @return Corresponding element value when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
-std::string Document::GetEntryByName(TagName const & tagName)
+std::string Document::GetEntryByName(TagName const &tagName)
{
- DictEntry* dictEntry = RefPubDict->GetDictEntryByName(tagName);
+ DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
if( !dictEntry )
{
return GDCM_UNFOUND;
return GDCM_UNFOUND;
}
- DocEntry* elem = GetDocEntryByNumber(dictEntry->GetGroup(),
+ DocEntry *elem = GetDocEntryByNumber(dictEntry->GetGroup(),
dictEntry->GetElement());
return elem->GetVR();
}
*/
std::string Document::GetEntryVRByNumber(uint16_t group, uint16_t element)
{
- DocEntry* elem = GetDocEntryByNumber(group, element);
+ DocEntry *elem = GetDocEntryByNumber(group, element);
if ( !elem )
{
return GDCM_UNFOUND;
*/
int Document::GetEntryLengthByNumber(uint16_t group, uint16_t element)
{
- DocEntry* elem = GetDocEntryByNumber(group, element);
+ DocEntry *elem = GetDocEntryByNumber(group, element);
if ( !elem )
{
return -2; //magic number
* @param tagName name of the searched Dicom Element.
* @return true when found
*/
-bool Document::SetEntryByName( std::string const & content,
- TagName const & tagName)
+bool Document::SetEntryByName( std::string const &content,
+ TagName const &tagName)
{
DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
if( !dictEntry )
bool Document::SetEntryByNumber(std::string const& content,
uint16_t group, uint16_t element)
{
- ValEntry* entry = GetValEntryByNumber(group, element);
+ ValEntry *entry = GetValEntryByNumber(group, element);
if (!entry )
{
dbg.Verbose(0, "Document::SetEntryByNumber: no corresponding",
bool Document::SetEntryByNumber(uint8_t*content, int lgth,
uint16_t group, uint16_t element)
{
- BinEntry* entry = GetBinEntryByNumber(group, element);
+ BinEntry *entry = GetBinEntryByNumber(group, element);
if (!entry )
{
dbg.Verbose(0, "Document::SetEntryByNumber: no corresponding",
* @param content new value (string) to substitute with
* @param entry Entry to be modified
*/
-bool Document::SetEntry(std::string const & content,ValEntry* entry)
+bool Document::SetEntry(std::string const &content,ValEntry *entry)
{
if(entry)
{
* @param entry Entry to be modified
* @param lgth new value length
*/
-bool Document::SetEntry(uint8_t* content, int lgth, BinEntry* entry)
+bool Document::SetEntry(uint8_t *content, int lgth, BinEntry *entry)
{
if(entry)
{
* @param elem element number of the Entry
* @return Pointer to the 'non string' area
*/
-void* Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem)
+void *Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem)
{
- DocEntry* entry = GetDocEntryByNumber(group, elem);
+ DocEntry *entry = GetDocEntryByNumber(group, elem);
if (!entry)
{
dbg.Verbose(1, "Document::GetDocEntryByNumber: no entry");
return 0;
}
- if ( BinEntry* binEntry = dynamic_cast<BinEntry*>(entry) )
+ if ( BinEntry *binEntry = dynamic_cast<BinEntry*>(entry) )
{
return binEntry->GetBinArea();
}
* when a string is not suitable
* @param element Entry whose binArea is going to be loaded
*/
-void Document::LoadEntryBinArea(BinEntry* element)
+void Document::LoadEntryBinArea(BinEntry *element)
{
if(element->GetBinArea())
return;
Fp->seekg(o, std::ios::beg);
size_t l = element->GetLength();
- uint8_t* a = new uint8_t[l];
+ uint8_t *a = new uint8_t[l];
if( !a )
{
dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
* @param element Element number of the searched Dicom Element
* @return
*/
-/*bool Document::SetEntryBinAreaByNumber(uint8_t* area,
+/*bool Document::SetEntryBinAreaByNumber(uint8_t *area,
uint16_t group, uint16_t element)
{
- DocEntry* currentEntry = GetDocEntryByNumber(group, element);
+ DocEntry *currentEntry = GetDocEntryByNumber(group, element);
if ( !currentEntry )
{
return false;
}
- if ( BinEntry* binEntry = dynamic_cast<BinEntry*>(currentEntry) )
+ if ( BinEntry *binEntry = dynamic_cast<BinEntry*>(currentEntry) )
{
binEntry->SetBinArea( area );
return true;
* @return Corresponding Dicom Element when it exists, and NULL
* otherwise.
*/
-DocEntry* Document::GetDocEntryByName(TagName const & tagName)
+DocEntry *Document::GetDocEntryByName(TagName const &tagName)
{
DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
if( !dictEntry )
* @param element Element number of the searched Dicom Element
* @return
*/
-DocEntry* Document::GetDocEntryByNumber(uint16_t group, uint16_t element)
+DocEntry *Document::GetDocEntryByNumber(uint16_t group, uint16_t element)
{
TagKey key = DictEntry::TranslateToKey(group, element);
if ( !TagHT.count(key))
* ValEntry.
* @return When present, the corresponding ValEntry.
*/
-ValEntry* Document::GetValEntryByNumber(uint16_t group, uint16_t element)
+ValEntry *Document::GetValEntryByNumber(uint16_t group, uint16_t element)
{
- DocEntry* currentEntry = GetDocEntryByNumber(group, element);
+ DocEntry *currentEntry = GetDocEntryByNumber(group, element);
if ( !currentEntry )
{
return 0;
}
- if ( ValEntry* entry = dynamic_cast<ValEntry*>(currentEntry) )
+ if ( ValEntry *entry = dynamic_cast<ValEntry*>(currentEntry) )
{
return entry;
}
* BinEntry.
* @return When present, the corresponding BinEntry.
*/
-BinEntry* Document::GetBinEntryByNumber(uint16_t group, uint16_t element)
+BinEntry *Document::GetBinEntryByNumber(uint16_t group, uint16_t element)
{
- DocEntry* currentEntry = GetDocEntryByNumber(group, element);
+ DocEntry *currentEntry = GetDocEntryByNumber(group, element);
if ( !currentEntry )
{
return 0;
}
- if ( BinEntry* entry = dynamic_cast<BinEntry*>(currentEntry) )
+ if ( BinEntry *entry = dynamic_cast<BinEntry*>(currentEntry) )
{
return entry;
}
/**
* \brief Loads the element while preserving the current
- * underlying file position indicator as opposed to
+ * underlying file position indicator as opposed to
* to LoadDocEntry that modifies it.
* @param entry Header Entry whose value shall be loaded.
* @return
*/
-void Document::LoadDocEntrySafe(DocEntry * entry)
+void Document::LoadDocEntrySafe(DocEntry *entry)
{
if(Fp)
{
long l_max, bool delim_mode)
{
DocEntry *newDocEntry = 0;
- ValEntry* newValEntry;
- BinEntry* newBinEntry;
- SeqEntry* newSeqEntry;
+ ValEntry *newValEntry;
+ BinEntry *newBinEntry;
+ SeqEntry *newSeqEntry;
VRKey vr;
bool used=false;
long offsetEntry,readEntry;
//////////////////// BinEntry or UNKOWN VR:
// When "this" is a Document the Key is simply of the
// form ( group, elem )...
- if (Document* dummy = dynamic_cast< Document* > ( set ) )
+ if (Document *dummy = dynamic_cast< Document* > ( set ) )
{
(void)dummy;
newBinEntry->SetKey( newBinEntry->GetKey() );
// but when "this" is a SQItem, we are inserting this new
// valEntry in a sequence item, and the kay has the
// generalized form (refer to \ref BaseTagKey):
- if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) )
+ if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newBinEntry->SetKey( parentSQItem->GetBaseTagKey()
+ newBinEntry->GetKey() );
/////////////////////// ValEntry
// When "set" is a Document, then we are at the top of the
// hierarchy and the Key is simply of the form ( group, elem )...
- if (Document* dummy = dynamic_cast< Document* > ( set ) )
+ if (Document *dummy = dynamic_cast< Document* > ( set ) )
{
(void)dummy;
newValEntry->SetKey( newValEntry->GetKey() );
// ...but when "set" is a SQItem, we are inserting this new
// valEntry in a sequence item. Hence the key has the
// generalized form (refer to \ref BaseTagKey):
- if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) )
+ if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newValEntry->SetKey( parentSQItem->GetBaseTagKey()
+ newValEntry->GetKey() );
// is a Document, then we are building the first depth level.
// Hence the SeqEntry we are building simply has a depth
// level of one:
- if (Document* dummy = dynamic_cast< Document* > ( set ) )
+ if (Document *dummy = dynamic_cast< Document* > ( set ) )
{
(void)dummy;
newSeqEntry->SetDepthLevel( 1 );
// But when "set" is allready a SQItem, we are building a nested
// sequence, and hence the depth level of the new SeqEntry
// we are building, is one level deeper:
- if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) )
+ if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) )
{
newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 );
newSeqEntry->SetKey( parentSQItem->GetBaseTagKey()
* \brief Parses a Sequence ( SeqEntry after SeqEntry)
* @return parsed length for this level
*/
-void Document::ParseSQ( SeqEntry* seqEntry,
+void Document::ParseSQ( SeqEntry *seqEntry,
long offset, long l_max, bool delim_mode)
{
int SQItemNumber = 0;
while (true)
{
- DocEntry* newDocEntry = ReadNextDocEntry();
+ DocEntry *newDocEntry = ReadNextDocEntry();
if ( !newDocEntry )
{
// FIXME Should warn user
* the value specified with Document::SetMaxSizeLoadEntry()
* @param entry Header Entry (Dicom Element) to be dealt with
*/
-void Document::LoadDocEntry(DocEntry* entry)
+void Document::LoadDocEntry(DocEntry *entry)
{
uint16_t group = entry->GetGroup();
std::string vr = entry->GetVR();
std::ostringstream s;
if (length > MaxSizeLoadEntry)
{
- if (BinEntry* binEntryPtr = dynamic_cast< BinEntry* >(entry) )
+ if (BinEntry *binEntryPtr = dynamic_cast< BinEntry* >(entry) )
{
//s << "gdcm::NotLoaded (BinEntry)";
s << GDCM_NOTLOADED;
binEntryPtr->SetValue(s.str());
}
// Be carefull : a BinEntry IS_A ValEntry ...
- else if (ValEntry* valEntryPtr = dynamic_cast< ValEntry* >(entry) )
+ else if (ValEntry *valEntryPtr = dynamic_cast< ValEntry* >(entry) )
{
// s << "gdcm::NotLoaded. (ValEntry)";
s << GDCM_NOTLOADED;
}
// When we find a BinEntry not very much can be done :
- if (BinEntry* binEntryPtr = dynamic_cast< BinEntry* >(entry) )
+ if (BinEntry *binEntryPtr = dynamic_cast< BinEntry* >(entry) )
{
s << GDCM_BINLOADED;
binEntryPtr->SetValue(s.str());
}
delete[] str;
- if ( ValEntry* valEntry = dynamic_cast<ValEntry* >(entry) )
+ if ( ValEntry *valEntry = dynamic_cast<ValEntry* >(entry) )
{
if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1
{
// and the dictionary entry depending on them.
uint16_t correctGroup = SwapShort( entry->GetGroup() );
uint16_t correctElem = SwapShort( entry->GetElement() );
- DictEntry* newTag = GetDictEntryByNumber( correctGroup,
+ DictEntry *newTag = GetDictEntryByNumber( correctGroup,
correctElem );
if ( !newTag )
{
* @param entry Entry to reverse transform
* @return Reverse transformed entry value
*/
-std::string Document::GetDocEntryUnvalue(DocEntry* entry)
+std::string Document::GetDocEntryUnvalue(DocEntry *entry)
{
if ( IsDocEntryAnInteger(entry) && entry->IsImplicitVR() )
{
/**
* \brief Skips to the begining of the next Header Entry
* \warning NOT end user intended method !
- * @param entry entry to skip
+ * @param offset start of skipping
+ * @param readLgth length to skip
+
*/
void Document::SkipToNextDocEntry(long offset,long readLgth)
{
{
uint16_t element = entry->GetElement();
uint16_t group = entry->GetGroup();
- const std::string & vr = entry->GetVR();
+ const std::string &vr = entry->GetVR();
uint32_t length = entry->GetLength();
// When we have some semantics on the element we just read, and if we
* gets the VR, gets the length, gets the offset value)
* @return On succes the newly created DocEntry, NULL on failure.
*/
-DocEntry* Document::ReadNextDocEntry()
+DocEntry *Document::ReadNextDocEntry()
{
uint16_t group;
uint16_t elem;
// lengths, but we won't bother with such fuses for the time being.
if ( itemLength != 0 )
{
- char* basicOffsetTableItemValue = new char[itemLength + 1];
+ char *basicOffsetTableItemValue = new char[itemLength + 1];
Fp->read(basicOffsetTableItemValue, itemLength);
#ifdef GDCM_DEBUG
SkipBytes(rleSegmentLength[nbRleSegments]);
// Store the collected info
- RLEFrame* newFrameInfo = new RLEFrame;
+ RLEFrame *newFrameInfo = new RLEFrame;
newFrameInfo->NumberFragments = nbRleSegments;
for( unsigned int uk = 1; uk <= nbRleSegments; uk++ )
{
long fragmentOffset = Fp->tellg();
// Store the collected info
- JPEGFragment* newFragment = new JPEGFragment;
+ JPEGFragment *newFragment = new JPEGFragment;
newFragment->Offset = fragmentOffset;
newFragment->Length = fragmentLength;
JPEGInfo->Fragments.push_back( newFragment );
* when recursively walking the given set.
* @param set The structure to be traversed (recursively).
*/
-void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT,
- DocEntrySet* set )
+void Document::BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
+ DocEntrySet *set )
{
- if (ElementSet* elementSet = dynamic_cast< ElementSet* > ( set ) )
+ if (ElementSet *elementSet = dynamic_cast< ElementSet* > ( set ) )
{
- TagDocEntryHT const & currentHT = elementSet->GetTagHT();
+ 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) )
+ DocEntry *entry = i->second;
+ if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
const ListSQItem& items = seqEntry->GetSQItems();
for( ListSQItem::const_iterator item = items.begin();
return;
}
- if (SQItem* SQItemSet = dynamic_cast< SQItem* > ( set ) )
+ 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) )
+ DocEntry *entry = *i;
+ if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
const ListSQItem& items = seqEntry->GetSQItems();
for( ListSQItem::const_iterator item = items.begin();
* \ref BuildFlatHashTable again...
* @return The flat std::map<> we juste build.
*/
-TagDocEntryHT* Document::BuildFlatHashTable()
+TagDocEntryHT *Document::BuildFlatHashTable()
{
- TagDocEntryHT* FlatHT = new TagDocEntryHT;
+ TagDocEntryHT *FlatHT = new TagDocEntryHT;
BuildFlatHashTableRecurse( *FlatHT, this );
return FlatHT;
}
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/01/06 17:16:16 $
- Version: $Revision: 1.74 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.75 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool IsEncapsulate();
bool IsDicomV3();
- RLEFramesInfo* GetRLEInfo() { return RLEInfo; }
- JPEGFragmentsInfo* GetJPEGInfo() { return JPEGInfo; }
+ RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
+ JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
// Dictionnaries
virtual void PrintPubDict (std::ostream &os = std::cout);
Dict* GetPubDict();
Dict* GetShaDict();
bool SetShaDict(Dict* dict);
- bool SetShaDict(DictKey const & dictName);
+ bool SetShaDict(DictKey const &dictName);
// Swap code
/// 'Swap code' accessor (see \ref SwapCode )
/// Accessor to \ref Filename
const std::string &GetFileName() const { return Filename; }
/// Accessor to \ref Filename
- void SetFileName(std::string const & fileName) { Filename = fileName; }
+ void SetFileName(std::string const &fileName) { Filename = fileName; }
- std::ifstream* OpenFile();
+ std::ifstream *OpenFile();
bool CloseFile();
- void WriteContent( std::ofstream* fp, FileType type );
+ void WriteContent( std::ofstream *fp, FileType type );
// Content entries
- virtual bool SetEntryByName (std::string const & content,
- TagName const & tagName );
- virtual bool SetEntryByNumber(std::string const & content,
+ virtual bool SetEntryByName (std::string const &content,
+ TagName const &tagName );
+ virtual bool SetEntryByNumber(std::string const &content,
uint16_t group, uint16_t element);
- virtual bool SetEntryByNumber(uint8_t* content, int lgth,
+ virtual bool SetEntryByNumber(uint8_t *content, int lgth,
uint16_t group, uint16_t element);
- virtual bool SetEntry(std::string const & content,ValEntry* entry);
- virtual bool SetEntry(uint8_t* content, int lgth,BinEntry* entry);
+ virtual bool SetEntry(std::string const &content,ValEntry *entry);
+ virtual bool SetEntry(uint8_t *content, int lgth,BinEntry *entry);
- virtual void* GetEntryBinAreaByNumber(uint16_t group, uint16_t elem);
+ virtual void *GetEntryBinAreaByNumber(uint16_t group, uint16_t elem);
- virtual std::string GetEntryByName (TagName const & tagName);
- virtual std::string GetEntryVRByName (TagName const & tagName);
+ virtual std::string GetEntryByName (TagName const &tagName);
+ virtual std::string GetEntryVRByName (TagName const &tagName);
virtual std::string GetEntryByNumber (uint16_t group, uint16_t elem);
virtual std::string GetEntryVRByNumber(uint16_t group, uint16_t elem);
virtual int GetEntryLengthByNumber(uint16_t group, uint16_t elem);
- DocEntry* GetDocEntryByNumber(uint16_t group, uint16_t element);
- DocEntry* GetDocEntryByName (TagName const & tagName);
- ValEntry* GetValEntryByNumber(uint16_t group, uint16_t element);
- BinEntry* GetBinEntryByNumber(uint16_t group, uint16_t element);
+ DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
+ DocEntry *GetDocEntryByName (TagName const &tagName);
+ ValEntry *GetValEntryByNumber(uint16_t group, uint16_t element);
+ BinEntry *GetBinEntryByNumber(uint16_t group, uint16_t element);
- ValEntry* ReplaceOrCreateByNumber(std::string const & value,
+ ValEntry *ReplaceOrCreateByNumber(std::string const &value,
uint16_t group, uint16_t elem,
- TagName const & vr = GDCM_UNKNOWN);
- BinEntry* ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
+ TagName const &vr = GDCM_UNKNOWN);
+ BinEntry *ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
uint16_t group, uint16_t elem,
- TagName const & vr = GDCM_UNKNOWN);
- SeqEntry* ReplaceOrCreateByNumber(uint16_t group, uint16_t elem);
+ TagName const &vr = GDCM_UNKNOWN);
+ SeqEntry *ReplaceOrCreateByNumber(uint16_t group, uint16_t elem);
- bool ReplaceIfExistByNumber ( std::string const & value,
+ bool ReplaceIfExistByNumber ( std::string const &value,
uint16_t group, uint16_t elem );
virtual void LoadEntryBinArea(uint16_t group, uint16_t elem);
- virtual void LoadEntryBinArea(BinEntry* entry);
+ virtual void LoadEntryBinArea(BinEntry *entry);
- void LoadDocEntrySafe(DocEntry* entry);
- TagDocEntryHT* BuildFlatHashTable();
+ void LoadDocEntrySafe(DocEntry *entry);
+ TagDocEntryHT *BuildFlatHashTable();
// Divers
static std::string GetTransferSyntaxValue(TransferSyntaxType type);
// to instanciate from this class Document (only Header and
// DicomDir are meaningfull).
Document();
- Document( std::string const & filename );
+ Document( std::string const &filename );
virtual ~Document();
void ReadAndSkipEncapsulatedBasicOffsetTable();
int SwapCode;
/// File Pointer, opened during Header parsing.
- std::ifstream* Fp;
+ std::ifstream *Fp;
/// ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown
FileType Filetype;
static const unsigned int MAX_SIZE_PRINT_ELEMENT_VALUE;
/// Store the RLE frames info obtained during parsing of pixels.
- RLEFramesInfo* RLEInfo;
+ RLEFramesInfo *RLEInfo;
/// Store the JPEG fragments info obtained during parsing of pixels.
- JPEGFragmentsInfo* JPEGInfo;
+ JPEGFragmentsInfo *JPEGInfo;
private:
// Methods
void ParseDES(DocEntrySet *set,long offset, long l_max, bool delim_mode);
void ParseSQ (SeqEntry *seq, long offset, long l_max, bool delim_mode);
- void LoadDocEntry (DocEntry *);
- void FindDocEntryLength (DocEntry *) throw ( FormatError );
+ void LoadDocEntry (DocEntry *e);
+ void FindDocEntryLength (DocEntry *e) throw ( FormatError );
std::string FindDocEntryVR();
- bool CheckDocEntryVR (VRKey);
+ bool CheckDocEntryVR (VRKey k);
- std::string GetDocEntryValue (DocEntry *);
- std::string GetDocEntryUnvalue(DocEntry *);
+ std::string GetDocEntryValue (DocEntry *e);
+ std::string GetDocEntryUnvalue(DocEntry *e);
- void SkipDocEntry (DocEntry *);
+
+ void SkipDocEntry (DocEntry *e);
void SkipToNextDocEntry (long offset,long readLgth);
- void FixDocEntryFoundLength(DocEntry *, uint32_t);
- bool IsDocEntryAnInteger (DocEntry *);
+ void FixDocEntryFoundLength(DocEntry *e, uint32_t l);
+ bool IsDocEntryAnInteger (DocEntry *e);
uint32_t FindDocEntryLengthOB() throw( FormatUnexpected );
void SetMaxSizePrintEntry(long);
// DocEntry related utilities
- DocEntry* ReadNextDocEntry();
+ DocEntry *ReadNextDocEntry();
uint32_t GenerateFreeTagKeyInGroup(uint16_t group);
- void BuildFlatHashTableRecurse( TagDocEntryHT& builtHT,
+ void BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
DocEntrySet* set );
void HandleBrokenEndian(uint16_t group, uint16_t elem);
// Variables
/// Public dictionary used to parse this header
- Dict* RefPubDict;
+ Dict *RefPubDict;
/// \brief Optional "shadow dictionary" (private elements) used to parse
/// this header
- Dict* RefShaDict;
+ Dict *RefShaDict;
/// \brief Size threshold above which an element value will NOT be loaded
/// in memory (to avoid loading the image/volume itself). By default,
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
* from the H Table
* @return
*/
-void ElementSet::Print(std::ostream& os)
+void ElementSet::Print(std::ostream &os)
{
for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
{
entry->SetPrintLevel(PrintLevel);
entry->Print(os);
- if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
+ if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
(void)seqEntry;
// Avoid the newline for a sequence:
* from the H Table
* @return
*/
-void ElementSet::WriteContent(std::ofstream* fp, FileType filetype)
+void ElementSet::WriteContent(std::ofstream *fp, FileType filetype)
{
for (TagDocEntryHT::const_iterator i = TagHT.begin();
i != TagHT.end();
* \brief add a new Dicom Element pointer to the H Table
* @param newEntry entry to add
*/
-bool ElementSet::AddEntry(DocEntry* newEntry)
+bool ElementSet::AddEntry(DocEntry *newEntry)
{
- const TagKey& key = newEntry->GetKey();
+ const TagKey &key = newEntry->GetKey();
if( TagHT.count(key) == 1 )
{
* \warning Some problems when using under Windows... prefer the use of
* Initialize / GetNext methods
*/
-bool ElementSet::RemoveEntry( DocEntry* entryToRemove)
+bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
{
- const TagKey& key = entryToRemove->GetKey();
+ const TagKey &key = entryToRemove->GetKey();
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
* \brief Clear the hash table from given entry BUT keep the entry.
* @param entryToRemove Entry to remove.
*/
-bool ElementSet::RemoveEntryNoDestroy(DocEntry* entryToRemove)
+bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove)
{
- const TagKey& key = entryToRemove->GetKey();
+ const TagKey &key = entryToRemove->GetKey();
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:03 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.28 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Accessor to \ref TagHT
// Do not expose this to user (public API) !
// A test is using it thus put it in public (matt)
- TagDocEntryHT const & GetTagHT() const { return TagHT; };
+ TagDocEntryHT const &GetTagHT() const { return TagHT; };
void Initialize();
DocEntry *GetNextEntry();
Program: gdcm
Module: $RCSfile: gdcmException.cxx,v $
Language: C++
- Date: $Date: 2004/11/04 18:14:34 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param f
* @param msg
*/
-Exception::Exception(const std::string &f, const std::string& msg) throw()
+Exception::Exception(const std::string &f, const std::string &msg) throw()
#ifdef __GNUC__
try
#endif
Program: gdcm
Module: $RCSfile: gdcmException.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ 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
/// returns exception name string
operator const char *() const throw();
- friend std::ostream& operator<<(std::ostream &os, const Exception &e);
+ friend std::ostream &operator<<(std::ostream &os, const Exception &e);
protected:
/// error message part 1
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.182 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.183 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @return Pointer to newly allocated pixel data.
* NULL if alloc fails
*/
-uint8_t* File::GetImageData()
+uint8_t *File::GetImageData()
{
if ( PixelWriteConverter->GetUserData() )
{
* @return Pointer to newly allocated pixel data.
* \ NULL if alloc fails
*/
-uint8_t* File::GetImageDataRaw ()
+uint8_t *File::GetImageDataRaw ()
{
return GetRaw();
}
* @return On success, the number of bytes actually copied. Zero on
* failure e.g. MaxSize is lower than necessary.
*/
-size_t File::GetImageDataIntoVector (void* destination, size_t maxSize)
+size_t File::GetImageDataIntoVector (void *destination, size_t maxSize)
{
if ( ! GetRaw() )
{
*
* @return boolean
*/
-void File::SetImageData(uint8_t* inData, size_t expectedSize)
+void File::SetImageData(uint8_t *inData, size_t expectedSize)
{
SetUserData(inData,expectedSize);
}
* \brief Set the image datas defined by the user
* \warning When writting the file, this datas are get as default datas to write
*/
-void File::SetUserData(uint8_t* data, size_t expectedSize)
+void File::SetUserData(uint8_t *data, size_t expectedSize)
{
PixelWriteConverter->SetUserData(data,expectedSize);
}
/**
* \brief Get the image datas defined by the user
- * \warning When writting the file, this datas are get as default datas to write
+ * \warning When writting the file, this datas are get as default data to write
*/
-uint8_t* File::GetUserData()
+uint8_t *File::GetUserData()
{
return PixelWriteConverter->GetUserData();
}
/**
* \brief Get the image data size defined by the user
- * \warning When writting the file, this datas are get as default datas to write
+ * \warning When writting the file, this datas are get as default data to write
*/
size_t File::GetUserDataSize()
{
/**
* \brief Get the image datas from the file.
- * If a LUT is found, the datas are expanded to be RGB
+ * If a LUT is found, the data are expanded to be RGB
*/
-uint8_t* File::GetRGBData()
+uint8_t *File::GetRGBData()
{
return PixelReadConverter->GetRGB();
}
/**
* \brief Get the image data size from the file.
- * If a LUT is found, the datas are expanded to be RGB
+ * If a LUT is found, the data are expanded to be RGB
*/
size_t File::GetRGBDataSize()
{
* \brief Get the image datas from the file.
* If a LUT is found, the datas are not expanded !
*/
-uint8_t* File::GetRawData()
+uint8_t *File::GetRawData()
{
return PixelReadConverter->GetRaw();
}
/**
* \brief Get the image data size from the file.
- * If a LUT is found, the datas are not expanded !
+ * If a LUT is found, the data are not expanded !
*/
size_t File::GetRawDataSize()
{
* @return false if write fails
*/
-bool File::WriteRawData(std::string const & fileName)
+bool File::WriteRawData(std::string const &fileName)
{
std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
if (!fp1)
* @return false if write fails
*/
-bool File::WriteDcmImplVR (std::string const & fileName)
+bool File::WriteDcmImplVR (std::string const &fileName)
{
SetWriteTypeToDcmImplVR();
return Write(fileName);
* @return false if write fails
*/
-bool File::WriteDcmExplVR (std::string const & fileName)
+bool File::WriteDcmExplVR (std::string const &fileName)
{
SetWriteTypeToDcmExplVR();
return Write(fileName);
* @return false if write fails
*/
-bool File::WriteAcr (std::string const & fileName)
+bool File::WriteAcr (std::string const &fileName)
{
SetWriteTypeToAcr();
return Write(fileName);
* (any already existing file is overwritten)
* @return false if write fails
*/
-bool File::Write(std::string const& fileName)
+bool File::Write(std::string const &fileName)
{
switch(WriteType)
{
* @param group group number of the Dicom Element to modify
* @param element element number of the Dicom Element to modify
*/
-bool File::SetEntryByNumber(std::string const& content,
+bool File::SetEntryByNumber(std::string const &content,
uint16_t group, uint16_t element)
{
return HeaderInternal->SetEntryByNumber(content,group,element);
* @param group group number of the Dicom Element to modify
* @param element element number of the Dicom Element to modify
*/
-bool File::SetEntryByNumber(uint8_t* content, int lgth,
+bool File::SetEntryByNumber(uint8_t *content, int lgth,
uint16_t group, uint16_t element)
{
return HeaderInternal->SetEntryByNumber(content,lgth,group,element);
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-bool File::ReplaceOrCreateByNumber(std::string const& content,
+bool File::ReplaceOrCreateByNumber(std::string const &content,
uint16_t group, uint16_t element)
{
return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL;
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
-bool File::ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
+bool File::ReplaceOrCreateByNumber(uint8_t *binArea, int lgth,
uint16_t group, uint16_t element)
{
return HeaderInternal->ReplaceOrCreateByNumber(binArea,lgth,group,element) != NULL;
}
else
{
- ValEntry* photInt = CopyValEntry(0x0028,0x0004);
+ ValEntry *photInt = CopyValEntry(0x0028,0x0004);
if(HeaderInternal->HasLUT())
{
photInt->SetValue("PALETTE COLOR ");
PixelWriteConverter->SetReadData(PixelReadConverter->GetRaw(),
PixelReadConverter->GetRawSize());
- BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+ BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
pixel->SetValue(GDCM_BINLOADED);
pixel->SetBinArea(PixelWriteConverter->GetData(),false);
pixel->SetLength(PixelWriteConverter->GetDataSize());
{
PixelReadConverter->BuildRGBImage();
- ValEntry* spp = CopyValEntry(0x0028,0x0002);
+ ValEntry *spp = CopyValEntry(0x0028,0x0002);
spp->SetValue("3 ");
- ValEntry* planConfig = CopyValEntry(0x0028,0x0006);
+ ValEntry *planConfig = CopyValEntry(0x0028,0x0006);
planConfig->SetValue("0 ");
- ValEntry* photInt = CopyValEntry(0x0028,0x0004);
+ ValEntry *photInt = CopyValEntry(0x0028,0x0004);
photInt->SetValue("RGB ");
if(PixelReadConverter->GetRGB())
PixelReadConverter->GetRawSize());
}
- BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+ BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
pixel->SetValue(GDCM_BINLOADED);
pixel->SetBinArea(PixelWriteConverter->GetData(),false);
pixel->SetLength(PixelWriteConverter->GetDataSize());
// samples per pixels = 1 (in the read file)
if(HeaderInternal->GetBitsAllocated()==24)
{
- ValEntry* bitsAlloc = CopyValEntry(0x0028,0x0100);
+ ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100);
bitsAlloc->SetValue("8 ");
- ValEntry* bitsStored = CopyValEntry(0x0028,0x0101);
+ ValEntry *bitsStored = CopyValEntry(0x0028,0x0101);
bitsStored->SetValue("8 ");
- ValEntry* highBit = CopyValEntry(0x0028,0x0102);
+ ValEntry *highBit = CopyValEntry(0x0028,0x0102);
highBit->SetValue("7 ");
Archive->Push(bitsAlloc);
std::string ts = Util::DicomString(
Document::GetTransferSyntaxValue(ExplicitVRLittleEndian).c_str() );
- ValEntry* tss = CopyValEntry(0x0002,0x0010);
+ ValEntry *tss = CopyValEntry(0x0002,0x0010);
tss->SetValue(ts);
Archive->Push(tss);
std::string ts = Util::DicomString(
Document::GetTransferSyntaxValue(ImplicitVRLittleEndian).c_str() );
- ValEntry* tss = CopyValEntry(0x0002,0x0010);
+ ValEntry *tss = CopyValEntry(0x0002,0x0010);
tss->SetValue(ts);
Archive->Push(tss);
Archive->Restore(0x0008,0x0010);
}
-ValEntry* File::CopyValEntry(uint16_t group,uint16_t element)
+ValEntry *File::CopyValEntry(uint16_t group,uint16_t element)
{
- DocEntry* oldE = HeaderInternal->GetDocEntryByNumber(group, element);
- ValEntry* newE;
+ DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element);
+ ValEntry *newE;
if(oldE)
{
return(newE);
}
-BinEntry* File::CopyBinEntry(uint16_t group,uint16_t element)
+BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element)
{
- DocEntry* oldE = HeaderInternal->GetDocEntryByNumber(group, element);
- BinEntry* newE;
+ DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element);
+ BinEntry *newE;
if(oldE)
{
}
}
-uint8_t* File::GetRaw()
+uint8_t *File::GetRaw()
{
- uint8_t* raw = PixelReadConverter->GetRaw();
+ uint8_t *raw = PixelReadConverter->GetRaw();
if ( ! raw )
{
// The Raw image migth not be loaded yet:
- std::ifstream* fp = HeaderInternal->OpenFile();
+ std::ifstream *fp = HeaderInternal->OpenFile();
PixelReadConverter->ReadAndDecompressPixelData( fp );
if(fp)
HeaderInternal->CloseFile();
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2005/01/06 08:46:21 $
- Version: $Revision: 1.90 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.91 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
File( );
- File( Header* header );
- File( std::string const& filename );
+ File( Header *header );
+ File( std::string const &filename );
virtual ~File();
void Print(std::ostream &os = std::cout);
/// Accessor to \ref Header
- Header* GetHeader() { return HeaderInternal; }
+ Header *GetHeader() { return HeaderInternal; }
size_t GetImageDataSize();
size_t GetImageDataRawSize();
- uint8_t* GetImageData();
- uint8_t* GetImageDataRaw();
- size_t GetImageDataIntoVector(void* destination, size_t maxSize);
+ uint8_t *GetImageData();
+ uint8_t *GetImageDataRaw();
+ size_t GetImageDataIntoVector(void *destination, size_t maxSize);
- void SetImageData(uint8_t* data, size_t expectedSize);
+ void SetImageData(uint8_t *data, size_t expectedSize);
// User datas
- void SetUserData(uint8_t* data, size_t expectedSize);
+ void SetUserData(uint8_t *data, size_t expectedSize);
uint8_t* GetUserData();
size_t GetUserDataSize();
// RBG datas (from file
// Write pixels of ONE image on hard drive
// No test is made on processor "endianity"
// The user must call his reader correctly
- bool WriteRawData (std::string const& fileName);
- bool WriteDcmImplVR(std::string const& fileName);
- bool WriteDcmExplVR(std::string const& fileName);
- bool WriteAcr (std::string const& fileName);
- bool Write(std::string const& fileName);
+ bool WriteRawData (std::string const &fileName);
+ bool WriteDcmImplVR(std::string const &fileName);
+ bool WriteDcmExplVR(std::string const &fileName);
+ bool WriteAcr (std::string const &fileName);
+ bool Write (std::string const &fileName);
- bool SetEntryByNumber(std::string const& content,
+ bool SetEntryByNumber(std::string const &content,
uint16_t group, uint16_t element);
- bool SetEntryByNumber(uint8_t* content, int lgth,
+ bool SetEntryByNumber(uint8_t *content, int lgth,
uint16_t group, uint16_t element);
- bool ReplaceOrCreateByNumber(std::string const& content,
+ bool ReplaceOrCreateByNumber(std::string const &content,
uint16_t group, uint16_t element);
- bool ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
+ bool ReplaceOrCreateByNumber(uint8_t *binArea, int lgth,
uint16_t group, uint16_t element);
uint8_t* GetLutRGBA();
void SetWriteToNoLibido();
void RestoreWriteOfLibido();
- ValEntry* CopyValEntry(uint16_t group,uint16_t element);
- BinEntry* CopyBinEntry(uint16_t group,uint16_t element);
+ ValEntry *CopyValEntry(uint16_t group,uint16_t element);
+ BinEntry *CopyBinEntry(uint16_t group,uint16_t element);
private:
void Initialise();
- uint8_t* GetRaw();
+ uint8_t *GetRaw();
// members variables:
/// Header to use to load the file
bool Parsed;
/// Utility pixel converter
- PixelReadConvert* PixelReadConverter;
- PixelWriteConvert* PixelWriteConverter;
+ PixelReadConvert *PixelReadConverter;
+ PixelWriteConvert *PixelWriteConverter;
// Utility header archive
DocEntryArchive *Archive;
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 16:05:06 $
- Version: $Revision: 1.221 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.222 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor
* @param filename name of the file whose header we want to analyze
*/
-Header::Header( std::string const & filename ):
+Header::Header( std::string const &filename ):
Document( filename )
{
// for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010
// Let's create a VirtualDictEntry to allow a further VR modification
// and force VR to match with BitsAllocated.
- DocEntry* entry = GetDocEntryByNumber(GrPixel, NumPixel);
+ DocEntry *entry = GetDocEntryByNumber(GrPixel, NumPixel);
if ( entry != 0 )
{
*/
bool Header::Write(std::string fileName, FileType filetype)
{
- std::ofstream* fp = new std::ofstream(fileName.c_str(),
+ std::ofstream *fp = new std::ofstream(fileName.c_str(),
std::ios::out | std::ios::binary);
if (*fp == NULL)
{
// Drop 0028|1101, 0028|1102, 0028|1103
// Drop 0028|1201, 0028|1202, 0028|1203
- DocEntry* e = GetDocEntryByNumber(0x0028,0x01101);
+ DocEntry *e = GetDocEntryByNumber(0x0028,0x01101);
if (e)
{
RemoveEntryNoDestroy(e);
Program: gdcm
Module: $RCSfile: gdcmHeader.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.96 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.97 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
Header();
- Header( std::string const & filename );
+ Header( std::string const &filename );
~Header();
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 13:35:38 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define JOCTET uint8_t
// For JPEG 8 Bits, body in file gdcmJpeg8.cxx
-bool gdcm_read_JPEG_file8 (std::ifstream* fp, void* image_buffer);
-bool gdcm_read_JPEG_memory8 (const JOCTET* buffer, const size_t buflen,
- void* image_buffer,
+bool gdcm_read_JPEG_file8 (std::ifstream *fp, void *image_buffer);
+bool gdcm_read_JPEG_memory8 (const JOCTET *buffer, const size_t buflen,
+ void *image_buffer,
size_t *howManyRead, size_t *howManyWritten);
//
// For JPEG 12 Bits, body in file gdcmJpeg12.cxx
-bool gdcm_read_JPEG_file12 (std::ifstream* fp, void* image_buffer);
+bool gdcm_read_JPEG_file12 (std::ifstream *fp, void *image_buffer);
bool gdcm_read_JPEG_memory12 (const JOCTET *buffer, const size_t buflen,
- void* image_buffer,
+ void *image_buffer,
size_t *howManyRead, size_t *howManyWritten);
// For JPEG 16 Bits, body in file gdcmJpeg16.cxx
// Beware this is misleading there is no 16bits DCT algorithm, only
// jpeg lossless compression exist in 16bits.
-bool gdcm_read_JPEG_file16 (std::ifstream* fp, void* image_buffer);
+bool gdcm_read_JPEG_file16 (std::ifstream *fp, void *image_buffer);
bool gdcm_read_JPEG_memory16 (const JOCTET *buffer, const size_t buflen,
void* image_buffer,
size_t *howManyRead, size_t *howManyWritten);
* \brief Read from file a 12 bits per pixel image and decompress it
* into a 16 bits per pixel image.
*/
-void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream* fp )
+void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream *fp )
throw ( FormatError )
{
int nbPixels = XSize * YSize;
* @param fp File Pointer: on entry the position should be the one of
* the fragment to be decoded.
*/
-bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t* subRaw,
+bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t *subRaw,
long fragmentSize,
long RawSegmentSize,
- std::ifstream* fp )
+ std::ifstream *fp )
{
int8_t count;
long numberOfOutputBytes = 0;
* at which the pixel data should be copied
* @return Boolean
*/
-bool PixelReadConvert::ReadAndDecompressRLEFile( std::ifstream* fp )
+bool PixelReadConvert::ReadAndDecompressRLEFile( std::ifstream *fp )
{
- uint8_t* subRaw = Raw;
+ uint8_t *subRaw = Raw;
long RawSegmentSize = XSize * YSize;
// Loop on the frame[s]
if( BitsAllocated == 16 )
{
- uint16_t* im16 = (uint16_t*)Raw;
+ uint16_t *im16 = (uint16_t*)Raw;
switch( SwapCode )
{
case 0:
* @param fp File Pointer
* @return Boolean
*/
-bool PixelReadConvert::ReadAndDecompressJPEGFramesFromFile( std::ifstream* fp )
+bool PixelReadConvert::ReadAndDecompressJPEGFramesFromFile( std::ifstream *fp )
{
- uint8_t* localRaw = Raw;
+ uint8_t *localRaw = Raw;
// Loop on the fragment[s]
for( JPEGFragmentsInfo::JPEGFragmentsList::iterator
it = JPEGInfo->Fragments.begin();
* @return Boolean
*/
bool PixelReadConvert::
-ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream* fp )
+ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream *fp )
{
// Loop on the fragment[s] to get total length
size_t totalLength = 0;
* @return Boolean
*/
bool PixelReadConvert::
-ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream* fp )
+ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream *fp )
{
// Loop on the fragment[s] to get total length
size_t totalLength = 0;
* @param fp File Pointer
* @return Boolean
*/
-bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream* fp )
+bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
{
if ( IsJPEG2000 )
{
*/
void PixelReadConvert::ConvertYcBcRPlanesToRGBPixels()
{
- uint8_t* localRaw = Raw;
- uint8_t* copyRaw = new uint8_t[ RawSize ];
+ uint8_t *localRaw = Raw;
+ uint8_t *copyRaw = new uint8_t[ RawSize ];
memmove( copyRaw, localRaw, RawSize );
// to see the tricks about YBR_FULL, YBR_FULL_422,
int l = XSize * YSize;
int nbFrames = ZSize;
- uint8_t* a = copyRaw;
- uint8_t* b = copyRaw + l;
- uint8_t* c = copyRaw + l + l;
+ uint8_t *a = copyRaw;
+ uint8_t *b = copyRaw + l;
+ uint8_t *c = copyRaw + l + l;
double R, G, B;
/// \todo : Replace by the 'well known' integer computation
*/
void PixelReadConvert::ConvertRGBPlanesToRGBPixels()
{
- uint8_t* localRaw = Raw;
- uint8_t* copyRaw = new uint8_t[ RawSize ];
+ uint8_t *localRaw = Raw;
+ uint8_t *copyRaw = new uint8_t[ RawSize ];
memmove( copyRaw, localRaw, RawSize );
int l = XSize * YSize * ZSize;
delete[] copyRaw;
}
-bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream* fp )
+bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp )
{
// ComputeRawAndRGBSizes is already made by
// ::GrabInformationsFromHeader. So, the structure sizes are
}
}
-void PixelReadConvert::GrabInformationsFromHeader( Header* header )
+void PixelReadConvert::GrabInformationsFromHeader( Header *header )
{
// Number of Bits Allocated for storing a Pixel is defaulted to 16
// when absent from the header.
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.h,v $
Language: C++
- Date: $Date: 2005/01/06 16:07:34 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
void Print( std::string indent = "", std::ostream &os = std::cout );
// In progress
- void GrabInformationsFromHeader( Header* header );
- bool ReadAndDecompressPixelData( std::ifstream* fp );
+ void GrabInformationsFromHeader( Header *header );
+ bool ReadAndDecompressPixelData( std::ifstream *fp );
void Squeeze();
bool BuildRGBImage();
private:
// Use the fp:
bool ReadAndDecompressRLEFragment(
- uint8_t* subDecompressed,
+ uint8_t *subDecompressed,
long fragmentSize,
long decompressedSegmentSize,
- std::ifstream* fp );
- void ReadAndDecompress12BitsTo16Bits( std::ifstream* fp ) throw ( FormatError );
- bool ReadAndDecompressRLEFile( std::ifstream* fp );
- bool ReadAndDecompressJPEGFile( std::ifstream* fp );
- bool ReadAndDecompressJPEGFramesFromFile( std::ifstream* fp );
- bool ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream* fp );
- bool ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream* fp );
+ std::ifstream *fp );
+ void ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) throw ( FormatError );
+ bool ReadAndDecompressRLEFile( std::ifstream *fp );
+ bool ReadAndDecompressJPEGFile( std::ifstream *fp );
+ bool ReadAndDecompressJPEGFramesFromFile( std::ifstream *fp );
+ bool ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream *fp );
+ bool ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream *fp );
- void BuildLUTRGBA( std::ifstream* fp );
+ void BuildLUTRGBA( std::ifstream *fp );
// In place (within Decompressed and with no fp access) decompression
// or convertion:
// Variables
/// Pixel data represented as RGB after LUT color interpretation.
- uint8_t* RGB;
+ uint8_t *RGB;
/// Size of RGB image.
size_t RGBSize;
/// Pixel data after decompression and bit/byte rearrangement.
- uint8_t* Raw;
+ uint8_t *Raw;
/// Size of Decompressed image.
size_t RawSize;
/// \brief Red/Green/Blue/Alpha LookUpTable build out of the
/// Red/Green/Blue LUT descriptors (see \ref BuildLUTRGBA ).
- uint8_t* LutRGBA;
+ uint8_t *LutRGBA;
size_t PixelOffset;
size_t PixelDataLength;
bool IsJPEGLossless;
bool IsRLELossless;
- RLEFramesInfo* RLEInfo;
- JPEGFragmentsInfo* JPEGInfo;
+ RLEFramesInfo *RLEInfo;
+ JPEGFragmentsInfo *JPEGInfo;
// For handling color stage
int PlanarConfiguration;
std::string LutRedDescriptor;
std::string LutGreenDescriptor;
std::string LutBlueDescriptor;
- uint8_t* LutRedData;
- uint8_t* LutGreenData;
- uint8_t* LutBlueData;
+ uint8_t *LutRedData;
+ uint8_t *LutGreenData;
+ uint8_t *LutBlueData;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $
Language: C++
- Date: $Date: 2004/12/07 09:32:24 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Public
-void PixelWriteConvert::SetReadData(uint8_t* data,size_t size)
+void PixelWriteConvert::SetReadData(uint8_t *data,size_t size)
{
ReadData = data;
ReadDataSize = size;
}
-void PixelWriteConvert::SetUserData(uint8_t* data,size_t size)
+void PixelWriteConvert::SetUserData(uint8_t *data,size_t size)
{
UserData = data;
UserDataSize = size;
}
-uint8_t* PixelWriteConvert::GetData()
+uint8_t *PixelWriteConvert::GetData()
{
if(UserData)
{
Program: gdcm
Module: $RCSfile: gdcmPixelWriteConvert.h,v $
Language: C++
- Date: $Date: 2005/01/06 16:07:34 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
virtual ~PixelWriteConvert();
// Set/Get of images and their size
- void SetReadData(uint8_t* data,size_t size);
- uint8_t* GetReadData() { return ReadData; }
+ void SetReadData(uint8_t *data,size_t size);
+ uint8_t *GetReadData() { return ReadData; }
size_t GetReadDataSize() { return ReadDataSize; }
- void SetUserData(uint8_t* data,size_t size);
- uint8_t* GetUserData() { return UserData; }
+ void SetUserData(uint8_t *data,size_t size);
+ uint8_t *GetUserData() { return UserData; }
size_t GetUserDataSize() { return UserDataSize; }
// Get the used image and its size
- uint8_t* GetData();
+ uint8_t *GetData();
size_t GetDataSize();
private:
// Variables
/// Pixel data represented as RGB after LUT color interpretation.
- uint8_t* ReadData;
+ uint8_t *ReadData;
/// Size of RGB image.
size_t ReadDataSize;
/// User pixel data
- uint8_t* UserData;
+ uint8_t *UserData;
/// Size of User image.
size_t UserDataSize;
};
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/05 15:38:28 $
- Version: $Revision: 1.44 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.45 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief canonical Printer
*/
-void SQItem::Print(std::ostream& os)
+void SQItem::Print(std::ostream &os)
{
std::ostringstream s;
i != DocEntries.end();
++i)
{
- DocEntry* Entry = *i;
+ DocEntry *Entry = *i;
bool PrintEndLine = true;
os << s.str();
Entry->SetPrintLevel(PrintLevel);
Entry->Print(os);
- if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(Entry) )
+ if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(Entry) )
{
(void)seqEntry; //not used
PrintEndLine = false;
* \ingroup SQItem
* \brief canonical Writer
*/
-void SQItem::WriteContent(std::ofstream* fp, FileType filetype)
+void SQItem::WriteContent(std::ofstream *fp, FileType filetype)
{
int j;
uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
/**
* \brief adds any Entry (Dicom Element) to the Sequence Item
*/
-bool SQItem::AddEntry(DocEntry* entry)
+bool SQItem::AddEntry(DocEntry *entry)
{
DocEntries.push_back(entry);
//TODO : check if it worked
* @return true if element was found or created successfully
*/
-bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group,
+bool SQItem::SetEntryByNumber(std::string const &val, uint16_t group,
uint16_t element)
{
for(ListDocEntry::iterator i = DocEntries.begin();
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:03 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.28 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void WriteContent(std::ofstream *fp, FileType filetype);
/// \brief returns the DocEntry chained List for this SQ Item.
- ListDocEntry const & GetDocEntries() const { return DocEntries; };
+ ListDocEntry const &GetDocEntries() const { return DocEntries; };
/// \brief adds the passed DocEntry to the DocEntry chained List for
/// this SQ Item.
DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
// FIXME method to write
- //DocEntry *GetDocEntryByName (std::string Name);
+ //DocEntry *GetDocEntryByName(std::string Name);
- bool SetEntryByNumber(std::string const & val, uint16_t group,
- uint16_t element);
+ bool SetEntryByNumber(std::string const &val, uint16_t group,
+ uint16_t element);
std::string GetEntryByNumber(uint16_t group, uint16_t element);
void SetDepthLevel(int depth) { SQDepthLevel = depth; }
/// Accessor on \ref BaseTagKey.
- void SetBaseTagKey( BaseTagKey const & key ) { BaseTagKeyNested = key; }
+ void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; }
/// Accessor on \ref BaseTagKey.
- BaseTagKey const & GetBaseTagKey() const { return BaseTagKeyNested; }
+ BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; }
void Initialize();
DocEntry *GetNextEntry();
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:37 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \ingroup SeqEntry
* \brief Constructor from a given SeqEntry
*/
-SeqEntry::SeqEntry( DictEntry* e )
+SeqEntry::SeqEntry( DictEntry *e )
: DocEntry(e)
{
UsableLength = 0;
* @param e Pointer to existing Doc entry
* @param depth depth level of the current Seq entry
*/
-SeqEntry::SeqEntry( DocEntry* e, int depth )
+SeqEntry::SeqEntry( DocEntry *e, int depth )
: DocEntry( e->GetDictEntry() )
{
UsableLength = 0;
/*
* \brief canonical Writer
*/
-void SeqEntry::WriteContent(std::ofstream* fp, FileType filetype)
+void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
uint16_t seq_term_gr = 0xfffe;
uint16_t seq_term_el = 0xe0dd;
* Returns the last item when argument is bigget than the total
* item number.
*/
-SQItem* SeqEntry::GetSQItemByOrdinalNumber(int nb)
+SQItem *SeqEntry::GetSQItemByOrdinalNumber(int nb)
{
if (nb<0)
{
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
class GDCM_EXPORT SeqEntry : public DocEntry
{
public:
- SeqEntry( DictEntry* );
- SeqEntry( DocEntry* d, int depth );
+ SeqEntry( DictEntry *e);
+ SeqEntry( DocEntry *d, int depth );
~SeqEntry();
void Print(std::ostream &os = std::cout);
void WriteContent(std::ofstream *fp, FileType filetype);
/// returns the SQITEM chained List for this SeQuence.
- ListSQItem const & GetSQItems() const { return Items; }
+ ListSQItem const &GetSQItems() const { return Items; }
/// Sets the delimitor mode
void SetDelimitorMode(bool dm) { DelimitorMode = dm; }
/// Sets the Sequence Delimitation Item
- void SetSequenceDelimitationItem(DocEntry * e) { SeqTerm = e;}
+ void SetSequenceDelimitationItem(DocEntry *e) { SeqTerm = e;}
void AddEntry(SQItem *it, int itemNumber);
SQItem *GetSQItemByOrdinalNumber(int itemNumber);
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.cxx,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief add a File to the list based on file name
* @param filename Name of the file to deal with
*/
-void SerieHeader::AddFileName(std::string const & filename)
+void SerieHeader::AddFileName(std::string const &filename)
{
Header *header = new Header( filename );
CoherentGdcmFileList.push_back( header );
* \brief Sets the Directory
* @param dir Name of the directory to deal with
*/
-void SerieHeader::SetDirectory(std::string const & dir)
+void SerieHeader::SetDirectory(std::string const &dir)
{
DirList filenames_list(dir); //OS specific
Program: gdcm
Module: $RCSfile: gdcmSerieHeader.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
~SerieHeader();
/// \todo should return bool or throw error ?
- void AddFileName(std::string const & filename);
+ void AddFileName(std::string const &filename);
void AddGdcmFile(Header *file);
- void SetDirectory(std::string const & dir);
+ void SetDirectory(std::string const &dir);
void OrderGdcmFileList();
/// \warning Assumes all elements in the list have the same global infos.
/// Assumes the list is not empty.
- Header* GetGdcmHeader() { return CoherentGdcmFileList.front(); }
+ Header *GetGdcmHeader() { return CoherentGdcmFileList.front(); }
typedef std::list<Header* > GdcmHeaderList;
/// \brief Gets the *coherent* File List
/// @return the *coherent* File List
- const GdcmHeaderList& GetGdcmFileList() { return CoherentGdcmFileList; }
+ const GdcmHeaderList &GetGdcmFileList() { return CoherentGdcmFileList; }
private:
bool ImagePositionPatientOrdering();
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 15:41:28 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-void FillDefaultTSDict(TSHT & ts);
+void FillDefaultTSDict(TSHT &ts);
//-----------------------------------------------------------------------------
// Constructor / Destructor
TS::TS()
//-----------------------------------------------------------------------------
// Public
-int TS::Count(TSKey const & key)
+int TS::Count(TSKey const &key)
{
return TsMap.count(key);
}
-TSAtr const & TS::GetValue(TSKey const & key)
+TSAtr const & TS::GetValue(TSKey const &key)
{
TSHT::const_iterator it = TsMap.find(key);
if (it == TsMap.end())
Program: gdcm
Module: $RCSfile: gdcmTS.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
void Print(std::ostream &os = std::cout);
- int Count(TSKey const & key);
- TSAtr const & GetValue(TSKey const & key);
+ int Count(TSKey const &key);
+ TSAtr const &GetValue(TSKey const &key);
private:
TSHT TsMap;
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 19:39:24 $
- Version: $Revision: 1.76 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.77 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* buf.str();
*/
-std::string Util::Format(const char* format, ...)
+std::string Util::Format(const char *format, ...)
{
char buffer[2048];
va_list args;
* \ingroup Globals
* \brief Because not available in C++ (?)
*/
-void Util::Tokenize (const std::string& str,
- std::vector<std::string>& tokens,
+void Util::Tokenize (const std::string &str,
+ std::vector<std::string> &tokens,
const std::string& delimiters)
{
std::string::size_type lastPos = str.find_first_not_of(delimiters,0);
* Counts the number of occurences of a substring within a string
*/
-int Util::CountSubstring (const std::string& str,
- const std::string& subStr)
+int Util::CountSubstring (const std::string &str,
+ const std::string &subStr)
{
int count = 0; // counts how many times it appears
std::string::size_type x = 0; // The index position in the string
* to avoid corrupting the terminal of invocation when printing)
* @param s string to remove non printable characters from
*/
-std::string Util::CreateCleanString(std::string const & s)
+std::string Util::CreateCleanString(std::string const &s)
{
std::string str = s;
* \brief Add a SEPARATOR to the end of the name is necessary
* @param pathname file/directory name to normalize
*/
-std::string Util::NormalizePath(std::string const & pathname)
+std::string Util::NormalizePath(std::string const &pathname)
{
const char SEPARATOR_X = '/';
const char SEPARATOR_WIN = '\\';
* \brief Get the (directory) path from a full path file name
* @param fullName file/directory name to extract Path from
*/
-std::string Util::GetPath(std::string const & fullName)
+std::string Util::GetPath(std::string const &fullName)
{
std::string res = fullName;
int pos1 = res.rfind("/");
* \brief Get the (last) name of a full path file name
* @param fullName file/directory name to extract end name from
*/
-std::string Util::GetName(std::string const & fullName)
+std::string Util::GetName(std::string const &fullName)
{
std::string filename = fullName;
* that needed to be escaped with an extra backslash for doxygen) \\0
* as you want.
*/
-std::string Util::DicomString(const char* s, size_t l)
+std::string Util::DicomString(const char *s, size_t l)
{
std::string r(s, s+l);
assert( !(r.size() % 2) ); // == basically 'l' is even
* except it doesn't take a lenght.
* It only pad with a null character if length is odd
*/
-std::string Util::DicomString(const char* s)
+std::string Util::DicomString(const char *s)
{
size_t l = strlen(s);
if( l%2 )
* - We allow padding of even lenght string by either a null
* character of a space
*/
-bool Util::DicomStringEqual(const std::string& s1, const char *s2)
+bool Util::DicomStringEqual(const std::string &s1, const char *s2)
{
// s2 is the string from the DICOM reference: 'MONOCHROME1'
std::string s1_even = s1; //Never change input parameter
if( r == 0 )
{
// Get host adresses
- struct hostent * pHost = gethostbyname(szHostName);
+ struct hostent *pHost = gethostbyname(szHostName);
for( int i = 0; pHost!= NULL && pHost->h_addr_list[i]!= NULL; i++ )
{
* each time a DICOM image is create it should have
* a unique identifier (URI)
*/
-std::string Util::CreateUniqueUID(const std::string& root)
+std::string Util::CreateUniqueUID(const std::string &root)
{
// The code works as follow:
// echo "gdcm" | od -b
}
template <class T>
-std::ostream& binary_write(std::ostream& os, const T& val)
+std::ostream &binary_write(std::ostream &os, const T &val)
{
return os.write(reinterpret_cast<const char*>(&val), sizeof val);
}
-std::ostream& binary_write(std::ostream& os, const uint16_t& val)
+std::ostream &binary_write(std::ostream &os, const uint16_t &val)
{
#ifdef GDCM_WORDS_BIGENDIAN
uint16_t swap;
#endif //GDCM_WORDS_BIGENDIAN
}
-std::ostream& binary_write(std::ostream& os, const uint32_t& val)
+std::ostream &binary_write(std::ostream &os, const uint32_t &val)
{
#ifdef GDCM_WORDS_BIGENDIAN
uint32_t swap;
#endif //GDCM_WORDS_BIGENDIAN
}
-std::ostream& binary_write(std::ostream& os, const char* val)
+std::ostream &binary_write(std::ostream &os, const char *val)
{
return os.write(val, strlen(val));
}
-std::ostream& binary_write(std::ostream& os, std::string const & val)
+std::ostream &binary_write(std::ostream &os, std::string const &val)
{
return os.write(val.c_str(), val.size());
}
Program: gdcm
Module: $RCSfile: gdcmUtil.h,v $
Language: C++
- Date: $Date: 2005/01/06 19:10:07 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT Util
{
public:
- static std::string Format(const char* format, ...);
- static void Tokenize (const std::string& str,
- std::vector<std::string>& tokens,
- const std::string& delimiters = " ");
- static int CountSubstring (const std::string& str,
- const std::string& subStr);
+ static std::string Format(const char *format, ...);
+ static void Tokenize (const std::string &str,
+ std::vector<std::string> &tokens,
+ const std::string &delimiters = " ");
+ static int CountSubstring (const std::string &str,
+ const std::string &subStr);
- static std::string CreateCleanString(std::string const & s);
- static std::string NormalizePath(std::string const & name);
+ static std::string CreateCleanString(std::string const &s);
+ static std::string NormalizePath(std::string const &name);
static std::string GetPath(std::string const &fullName);
static std::string GetName(std::string const &fullName);
static std::string GetCurrentDate();
static std::string GetCurrentTime();
- static std::string DicomString(const char* s, size_t l);
- static std::string DicomString(const char* s);
- static bool DicomStringEqual(const std::string& s1, const char *s2);
- static std::string CreateUniqueUID(const std::string& root = "");
+ static std::string DicomString(const char *s, size_t l);
+ static std::string DicomString(const char *s);
+ static bool DicomStringEqual(const std::string &s1, const char *s2);
+ static std::string CreateUniqueUID(const std::string &root = "");
static bool IsCurrentProcessorBigEndian();
static std::string GetMACAddress();
};
template <class T>
- GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const T& val);
- GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint16_t& val);
- GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint32_t& val);
- GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const char* val);
- GDCM_EXPORT std::ostream& binary_write(std::ostream& os, std::string const & val);
+ GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const T &val);
+ GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint16_t &val);
+ GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint32_t &val);
+ GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const char *val);
+ GDCM_EXPORT std::ostream &binary_write(std::ostream &os, std::string const & val);
} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/06 17:16:16 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
{
-void FillDefaultVRDict(VRHT & vr);
+void FillDefaultVRDict(VRHT &vr);
//-----------------------------------------------------------------------------
/**
* \brief Constructor
* \brief Get the count for an element
* @param key key to count
*/
-int VR::Count(VRKey const & key)
+int VR::Count(VRKey const &key)
{
return vr.count(key);
}
/**
* \brief Simple predicate that checks wether the given argument
* corresponds to the Value Representation of a \ref BinEntry .
- * This predicate is the negation of
- * \ref VR::IsVROfGdcmStringRepresentable .
* @param tested value representation to check for.
*/
-bool VR::IsVROfBinaryRepresentable(VRKey const & tested)
+bool VR::IsVROfBinaryRepresentable(VRKey const &tested)
{
//std::cout << "VR::IsVROfGdcmBinaryRepresentable===================="
// << tested << std::endl;
* but NOT a \ref BinEntry.
* @param tested value representation to check for.
*/
-bool VR::IsVROfStringRepresentable(VRKey const & tested)
+bool VR::IsVROfStringRepresentable(VRKey const &tested)
{
return tested == "AE" ||
tested == "AS" ||
* corresponds to the Value Representation of a \ref SeqEntry
* @param tested value representation to check for.
*/
-bool VR::IsVROfSequence(VRKey const & tested)
+bool VR::IsVROfSequence(VRKey const &tested)
{
return tested == "SQ";
}
-bool VR::IsValidVR(VRKey const & key)
+bool VR::IsValidVR(VRKey const &key)
{
return(vr.find(key)!=vr.end());
}
Program: gdcm
Module: $RCSfile: gdcmVR.h,v $
Language: C++
- Date: $Date: 2005/01/06 17:16:16 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
~VR();
void Print(std::ostream &os = std::cout);
- int Count(VRKey const & key);
- bool IsVROfBinaryRepresentable(VRKey const & tested);
- bool IsVROfStringRepresentable(VRKey const & tested);
- bool IsVROfSequence(VRKey const & tested);
- bool IsValidVR(VRKey const & key);
+ int Count(VRKey const &key);
+ bool IsVROfBinaryRepresentable(VRKey const &tested);
+ bool IsVROfStringRepresentable(VRKey const &tested);
+ bool IsVROfSequence(VRKey const &tested);
+
+ bool IsValidVR(VRKey const &key);
private:
VRHT vr;
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 13:46:38 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Constructor from a given DictEntry
* @param e Pointer to existing dictionary entry
*/
-ValEntry::ValEntry(DictEntry* e) : DocEntry(e)
+ValEntry::ValEntry(DictEntry *e) : DocEntry(e)
{
}
* \brief Constructor from a given DocEntry
* @param e Pointer to existing Doc entry
*/
-ValEntry::ValEntry(DocEntry* e)
+ValEntry::ValEntry(DocEntry *e)
: DocEntry(e->GetDictEntry())
{
UsableLength = e->GetLength();
/**
* \brief canonical Printer
*/
-void ValEntry::Print(std::ostream & os)
+void ValEntry::Print(std::ostream &os)
{
uint16_t g = GetGroup();
uint16_t e = GetElement();
//-----------------------------------------------------------------------------
// Public
-void ValEntry::SetValue(std::string const & val)
+void ValEntry::SetValue(std::string const &val)
{
// Integers have a special treatement for their length:
int l = val.length();
/*
* \brief canonical Writer
*/
-void ValEntry::WriteContent(std::ofstream* fp, FileType filetype)
+void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
{
DocEntry::WriteContent(fp, filetype);
Program: gdcm
Module: $RCSfile: gdcmValEntry.h,v $
Language: C++
- Date: $Date: 2004/12/07 13:39:33 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2005/01/06 20:03:28 $
+ 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
class GDCM_EXPORT ValEntry : public DocEntry
{
public:
- ValEntry(DictEntry* e);
- ValEntry(DocEntry* d);
+ ValEntry(DictEntry *e);
+ ValEntry(DocEntry *d);
~ValEntry();
/// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
/// 'string', event if it's stored as an integer in the header of the
/// current Dicom Document Entry
- std::string const & GetValue() const { return Value; };
+ std::string const &GetValue() const { return Value; };
/// Sets the value (string) of the current Dicom Document Entry.
/// The size is updated
- virtual void SetValue(std::string const & val);
+ virtual void SetValue(std::string const &val);
virtual void Print(std::ostream &os = std::cout);
protected:
/// Sets the value (string) of the current Dicom Document Entry
- void SetValueOnly(std::string const & val) { Value = val; };
+ void SetValueOnly(std::string const &val) { Value = val; };
private:
// Members :