Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
public:
DocEntry(DictEntry*);
+ /// \brief Canonical Destructor
virtual ~DocEntry() {};
virtual void Print (std::ostream &os = std::cout, std::string const &indent = "");
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.52 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ Version: $Revision: 1.53 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
TagName const &vr )
{
ValEntry *valEntry = 0;
- DocEntry *currentEntry = GetDocEntry( group, elem);
+ DocEntry *currentEntry = GetDocEntry( group, elem );
if (currentEntry)
{
// Create a new valEntry if necessary
if( !valEntry )
{
- valEntry = NewValEntry(group, elem, vr);
+ valEntry = NewValEntry( group, elem, vr );
if ( !AddEntry(valEntry) )
{
return valEntry;
}
-/*
+/**
* \brief Modifies the value of a given Header Entry (Dicom Element)
* when it exists. Create it with the given value when unexistant.
* A copy of the binArea is made to be kept in the Document.
* @param binArea (binary) value to be set
+ * @param lgth length of the Bin Area we want to set
* @param group Group number of the Entry
* @param elem Element number of the Entry
* @param vr V(alue) R(epresentation) of the Entry -if private Entry-
TagName const &vr )
{
BinEntry *binEntry = 0;
- DocEntry *currentEntry = GetDocEntry( group, elem);
+ DocEntry *currentEntry = GetDocEntry( group, elem );
// Verify the currentEntry
if (currentEntry)
return binEntry;
}
-/*
+/**
* \brief Modifies the value of a given Header Entry (Dicom Element)
* when it exists. Creates it when unexistant.
* @param group Group number of the Entry
* @param vr VR of the new Entry
*/
ValEntry *DocEntrySet::NewValEntry(uint16_t group,uint16_t elem,
- TagName const & vr)
+ TagName const &vr)
{
DictEntry *dictEntry = GetDictEntry(group, elem, vr);
gdcmAssertMacro(dictEntry);
* @param vm VM (Value Multiplicity) of the underlying DictEntry
* @param name english name
*/
-DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group,uint16_t elem,
- TagName const & vr,
- TagName const & vm,
- TagName const & name )
+DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group, uint16_t elem,
+ TagName const &vr,
+ TagName const &vm,
+ TagName const &name )
{
return Global::GetDicts()->NewVirtualDictEntry(group,elem,vr,vm,name);
}
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ 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 DocEntrySet : public Base
{
public:
+ /// Canonical Constructor
DocEntrySet() {};
+ /// Canonical Destructor
virtual ~DocEntrySet() {};
/// \brief write any type of entry to the entry set
virtual bool RemoveEntry(DocEntry *EntryToRemove) = 0;
/// \brief Removes any type of entry out of the entry set, DOESN'T destroy it
virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove) = 0;
-
+ /// Gets the first entry of any type of set
virtual DocEntry *GetFirstEntry()=0;
+ /// Gets the next entry of any type of set
virtual DocEntry *GetNextEntry()=0;
-
+ /// Gets the first ValEntry of set (for Python users)
+ virtual ValEntry *GetFirstValEntry()=0;
+ /// Gets the next ValEntry of set (for Python users)
+ virtual ValEntry *GetNextValEntry()=0;
virtual std::string GetEntryValue(uint16_t group, uint16_t elem);
virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);
virtual int GetEntryLength(uint16_t group, uint16_t elem);
uint16_t group, uint16_t elem,
TagName const &vr = GDCM_UNKNOWN);
virtual SeqEntry *InsertSeqEntry(uint16_t group, uint16_t elem);
-
+ /// tells us if the set contains no entry
virtual bool IsEmpty() = 0;
virtual bool CheckIfEntryExist(uint16_t group, uint16_t elem);
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ 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 Get the first entry while visiting the DocEntrySet
+ * \brief Get the first entry while visiting *the* 'zero level' DocEntrySet
+ * (DocEntries out of any Sequence)
* \return The first DocEntry if found, otherwhise NULL
*/
DocEntry *ElementSet::GetFirstEntry()
}
/**
- * \brief Get the next entry while visiting the Hash table (TagHT)
+ * \brief Get the next entry while visiting *the* 'zero level' DocEntrySet
+ * (DocEntries out of any Sequence)
* \note : meaningfull only if GetFirstEntry already called
* \return The next DocEntry if found, otherwhise NULL
*/
return NULL;
}
+/**
+ * \brief Get the first ValEntry while visiting *the* 'zero level' DocEntrySet
+ * (DocEntries out of any Sequence)
+ * This method is designed for Python users
+ * \return The first ValEntry if found, otherwhise NULL
+ */
+ValEntry *ElementSet::GetFirstValEntry()
+{
+ gdcm::ValEntry *valEntry;
+ gdcm::DocEntry *d = GetFirstEntry();
+ // an other iterator is needed to allow user iterate
+ // at the same time both on DocEntries and ValEntries
+ ItValEntryTagHT = ItTagHT;
+ if ( valEntry = dynamic_cast<gdcm::ValEntry*>(d))
+ return valEntry;
+ return GetNextValEntry();
+}
+
+/**
+ * \brief Get the next ValEntry while visiting *the* 'zero level' DocEntrySet
+ * (DocEntries out of any Sequence)
+ * \note : meaningfull only if GetFirstValEntry already called
+ * \return The next ValEntry if found, otherwhise NULL
+ */
+ValEntry *ElementSet::GetNextValEntry()
+{
+ gdcm::ValEntry *valEntry;
+ gdcm::DocEntry *d = ItValEntryTagHT->second;
+ ++ItValEntryTagHT;
+ while( d )
+ {
+ if ( valEntry = dynamic_cast<gdcm::ValEntry*>(d))
+ return valEntry;
+ else
+ return GetNextValEntry();
+ }
+ return 0;
+}
+
/**
* \brief retrieves a Dicom Element using (group, element)
* @param group Group number of the searched Dicom Element
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ 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
DocEntry *GetFirstEntry();
DocEntry *GetNextEntry();
-
+ ValEntry *GetFirstValEntry();
+ ValEntry *GetNextValEntry();
DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
-
+ /// Tells us if the ElementSet contains no entry
bool IsEmpty() { return TagHT.empty(); };
protected:
// Variables
/// Hash Table (map), to provide fast access
TagDocEntryHT TagHT;
- /// Hash Table (map) iterator, used to visit the TagHT variable
- TagDocEntryHT::iterator ItTagHT;
+ /// iterator, used to visit the TagHT variable
+ TagDocEntryHT::iterator ItTagHT;
+ /// iterator, used to visit the TagHT variable, seeking only for ValEntries
+ TagDocEntryHT::iterator ItValEntryTagHT;
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param elem element number of the Dicom Element to modify
*/
bool FileHelper::SetValEntry(std::string const &content,
- uint16_t group, uint16_t elem)
+ uint16_t group, uint16_t elem)
{
return FileInternal->SetValEntry(content,group,elem);
}
* @param elem element number of the Dicom Element to modify
*/
bool FileHelper::SetBinEntry(uint8_t *content, int lgth,
- uint16_t group, uint16_t elem)
+ uint16_t group, uint16_t elem)
{
return FileInternal->SetBinEntry(content,lgth,group,elem);
}
* failed).
*/
ValEntry *FileHelper::InsertValEntry(std::string const &content,
- uint16_t group, uint16_t elem)
+ uint16_t group, uint16_t elem)
{
return FileInternal->InsertValEntry(content,group,elem);
}
-/*
+/**
* \brief Modifies the value of a given DocEntry (Dicom entry)
* when it exists. Create it with the given value when unexistant.
* A copy of the binArea is made to be kept in the Document.
* @param binArea (binary) value to be set
+ * @param lgth new value length
* @param group Group number of the Entry
* @param elem Element number of the Entry
* \return pointer to the modified/created Dicom entry (NULL when creation
* failed).
*/
BinEntry *FileHelper::InsertBinEntry(uint8_t *binArea, int lgth,
- uint16_t group, uint16_t elem)
+ uint16_t group, uint16_t elem)
{
return FileInternal->InsertBinEntry(binArea,lgth,group,elem);
}
-/*
+/**
* \brief Modifies the value of a given DocEntry (Dicom entry)
* when it exists. Create it with the given value when unexistant.
* A copy of the binArea is made to be kept in the Document.
}
/**
- * \brief - Allocates necessary memory,
+ * \brief - Allocates necessary memory,
* - Reads the pixels from disk (uncompress if necessary),
- * - Transforms YBR pixels, if any, into RGB pixels
+ * - Transforms YBR pixels, if any, into RGB pixels,
* - Transforms 3 planes R, G, B, if any, into a single RGB Plane
* - Transforms single Grey plane + 3 Palettes into a RGB Plane
* - Copies the pixel data (image[s]/volume[s]) to newly allocated zone.
* 'volume'Pixels are presented as C-like 3D arrays : plane per plane
* \warning Since the pixels are not copied, it is the caller's responsability
* not to deallocate its data before gdcm uses them (e.g. with
- * the Write() method.
- * @param inData user supplied pixel area
- * @param expectedSize total image size, in Bytes
+ * the Write() method )
+ * @param inData user supplied pixel area (uint8_t* is just for the compiler.
+ * user is allowed to pass any kind of pixelsn since the size is
+ * given in bytes)
+ * @param expectedSize total image size, *in Bytes*
*
* @return boolean
*/
/**
* \brief Set the image data defined by the user
* \warning When writting the file, this data are get as default data to write
+ * @param inData user supplied pixel area (uint8_t* is just for the compiler.
+ * user is allowed to pass any kind of pixelsn since the size is
+ * given in bytes)
+ * @param expectedSize total image size, *in Bytes*
+
*/
-void FileHelper::SetUserData(uint8_t *data, size_t expectedSize)
+void FileHelper::SetUserData(uint8_t *inData, size_t expectedSize)
{
- PixelWriteConverter->SetUserData(data,expectedSize);
+ PixelWriteConverter->SetUserData(inData,expectedSize);
}
/**
Program: gdcm
Module: $RCSfile: gdcmFileHelper.h,v $
Language: C++
- Date: $Date: 2005/02/03 10:03:07 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ 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
uint8_t* GetLutRGBA();
// Write mode
- void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); };
+
+ /// \brief Tells the writer we want to write a Raw File (no header)
+ void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); };
+ /// \brief Tells the writer we want to write RGB image when possible
+ /// (as opposite to 'Grey pixels + Palettes color')
void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); };
+ /// \brief Sets the Write Mode ( )
void SetWriteMode(FileMode mode) { WriteMode = mode; };
+ /// \brief Gets the Write Mode ( )
FileMode GetWriteMode() { return WriteMode; };
// Write format
+
+ /// \brief Tells the writer we want to write as Implicit VR
void SetWriteTypeToDcmImplVR() { SetWriteType(ImplicitVR); };
+ /// \brief Tells the writer we want to write as Explicit VR
void SetWriteTypeToDcmExplVR() { SetWriteType(ExplicitVR); };
+ /// \brief Tells the writer we want to write as ACR-NEMA
void SetWriteTypeToAcr() { SetWriteType(ACR); };
+ /// \brief Tells the writer we want to write as LibIDO
void SetWriteTypeToAcrLibido() { SetWriteType(ACR_LIBIDO); };
+ /// \brief Tells the writer which format want to write
+ /// (ImplicitVR, ExplicitVR, ACR, ACR_LIBIDO)
void SetWriteType(FileType format) { WriteType = format; };
+ /// \brief Gets the format we want to write
+ /// (ImplicitVR, ExplicitVR, ACR, ACR_LIBIDO)
FileType GetWriteType() { return WriteType; };
// Write pixels of ONE image on hard drive
/// Wether already parsed or not
bool Parsed;
- /// Utility pixel converter
+ // Utility pixel converter
+ /// \brief Pointer to the PixelReadConverter
PixelReadConvert *PixelReadConverter;
+ /// \brief Pointer to the PixelWriteConverter
PixelWriteConvert *PixelWriteConverter;
// Utility header archive
+ /// \brief Pointer to the DocEntryArchive (used while writting process)
DocEntryArchive *Archive;
// Write variables
+ /// \brief (WMODE_RAW, WMODE_RGB)
FileMode WriteMode;
+ /// \brief (ImplicitVR, ExplicitVR, ACR, ACR_LIBIDO)
FileType WriteType;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:48 $
- Version: $Revision: 1.66 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ Version: $Revision: 1.67 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
/**
- * \brief Get the next Dicom entry while visiting the chained list
+ * \brief Get the next Dicom entry while visiting the SQItem
* \return The next DocEntry if found, otherwhise NULL
*/
DocEntry *SQItem::GetNextEntry()
return NULL;
}
+/**
+ * \brief Get the first ValEntry while visiting theSQItem
+ * This method is designed for Python users
+ * \return The first ValEntry if found, otherwhise NULL
+ */
+ValEntry *SQItem::GetFirstValEntry()
+{
+ gdcm::ValEntry *valEntry;
+ gdcm::DocEntry *d = GetFirstEntry();
+ // an other iterator is needed to allow user iterate
+ // at the same time both on DocEntries and ValEntries
+ ItValEntries = ItDocEntries;
+ if ( valEntry = dynamic_cast<gdcm::ValEntry*>(d))
+ return valEntry;
+ return GetNextValEntry();
+}
+
+/**
+ * \brief Get the next ValEntry while visiting the SQItem
+ * \return The next ValEntry if found, otherwhise NULL
+ */
+ValEntry *SQItem::GetNextValEntry()
+{
+ gdcm::ValEntry *valEntry;
+ gdcm::DocEntry *d = *ItValEntries;
+ ++ItValEntries;
+ while( d )
+ {
+ if ( valEntry = dynamic_cast<gdcm::ValEntry*>(d))
+ return valEntry;
+ else
+ return GetNextValEntry();
+ }
+ return 0;
+}
+
/**
* \brief Gets a Dicom Element inside a SQ Item Entry
* @param group Group number of the Entry
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:49 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
SQItem(int depthLevel);
~SQItem();
- virtual void Print(std::ostream &os = std::cout, std::string const & indent = "" );
+ virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" );
void WriteContent(std::ofstream *fp, FileType filetype);
bool AddEntry(DocEntry *Entry); // add to the List
DocEntry *GetFirstEntry();
DocEntry *GetNextEntry();
+ ValEntry *GetFirstValEntry();
+ ValEntry *GetNextValEntry();
+
DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
bool IsEmpty() { return DocEntries.empty(); };
BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; }
protected:
-// Variables that need to be access in subclasses
- /// \brief Chained list of (Elementary) Doc Entries
+// Variables that need to be accessed in subclasses
+ /// \brief Chained list of Doc Entries
ListDocEntry DocEntries;
- /// Chained list iterator, used to visit the TagHT variable
+ /// Iterator, used to visit the entries
ListDocEntry::iterator ItDocEntries;
-
+ /// Iterator, used to visit the Val Entries (for Python users)
+ ListDocEntry::iterator ItValEntries;
+
private:
/// \brief Sequences can be nested. This \ref SQDepthLevel represents
/// the level of the nesting of instances of this class.
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2005/02/02 16:18:49 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/02/04 14:49:01 $
+ 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
SeqEntry( DocEntry *d, int depth );
~SeqEntry();
- void Print(std::ostream &os = std::cout, std::string const & indent = "" );
+ void Print(std::ostream &os = std::cout, std::string const &indent = "" );
void WriteContent(std::ofstream *fp, FileType filetype);
void AddSQItem(SQItem *it, int itemNumber);
void SetDelimitorMode(bool dm) { DelimitorMode = dm; }
/// Sets the Sequence Delimitation Item
- void SetDelimitationItem(DocEntry *e) { SeqTerm = e;}
+ void SetDelimitationItem(DocEntry *e) { SeqTerm = e; }
+ /// Gets the Sequence Delimitation Item
DocEntry *GetDelimitationItem() { return SeqTerm;}
/// Gets the depth level