Program: gdcm
Module: $RCSfile: TestPapyrus.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:22 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/26 09:49:53 $
+ 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
// inside the loop
// Get caracteristics of the first image
-
SamplesPerPixel = sqi->GetEntryValue(0x0028,0x0002);
Rows = sqi->GetEntryValue(0x0028,0x0010);
Columns = sqi->GetEntryValue(0x0028,0x0011);
int lgrImage = iRows*iColumns * iSamplesPerPixel * (iBitsAllocated/8);
// compute number of images
-
int nbImages = seqPapyrus->GetNumberOfSQItems();
-/*
- int nbImages = 0;
- while (sqi)
- {
- nbImages++;
- sqi = seqPapyrus->GetNextSQItem();
- }
-*/
std::cout <<"Number of frames :" << nbImages << std::endl;
// allocate enough room to get the pixels of all images.
-
uint8_t *PixelArea = new uint8_t[lgrImage*nbImages];
uint8_t *currentPosition = PixelArea;
gdcm::BinEntry *pixels;
n->InsertValEntry(MediaStSOPinstUID, 0x0002,0x0002);
// Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian)
// since using Papyrus one (Implicit VR Little Endian) is a mess
- //n->Insert(TransferSyntax, 0x0002,0x0010);
+ //n->InsertValEntry(TransferSyntax, 0x0002,0x0010);
n->InsertValEntry(StudyDate, 0x0008,0x0020);
n->InsertValEntry(StudyTime, 0x0008,0x0030);
n->InsertValEntry(Modality, 0x0008,0x0060);
Program: gdcm
Module: $RCSfile: gdcmContentEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 16:32:45 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/01/26 09:49:53 $
+ 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
namespace gdcm
{
-// CLEAN ME
-#define MAX_SIZE_PRINT_ELEMENT_VALUE 128
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
- * \brief Constructor from a given DictEntry
+ * \brief Constructor for a given DictEntry
* @param e Pointer to existing dictionary entry
*/
ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e)
}
/**
- * \brief Constructor from a given DocEntry
+ * \brief Constructor for a given DocEntry
* @param e Pointer to existing Doc entry
*/
ContentEntry::ContentEntry(DocEntry *e)
// Public
/**
- * \brief Writes the std::string representable' value of a ContentEntry
+ * \brief Writes the 'std::string representable' value of a ContentEntry
* @param fp already open ofstream pointer
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:23 $
- Version: $Revision: 1.118 $
+ Date: $Date: 2005/01/26 09:49:53 $
+ Version: $Revision: 1.119 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// to be able to remove any direct reference to TagHT
DocEntry *entry = GetFirstEntry();
if( entry )
- //if ( TagHT.begin() != TagHT.end() ) // after Document Parsing
{
MetaElems = new DicomDirMeta(true);
entry = GetFirstEntry();
}
- /*TagDocEntryHT::iterator lastOneButSequence = TagHT.end();
- lastOneButSequence --;
- // ALL the 'out of Sequence' Tags belong to Meta Elems
- // (we skip 0004|1220 [Directory record sequence] )
- for ( TagDocEntryHT::iterator cc = TagHT.begin();
- cc != lastOneButSequence;
- ++cc)
- {
- MetaElems->AddEntry( cc->second );
- }*/
}
else // after root directory parsing
{
// neither an 'IMAGE' SQItem. Skip to next item.
continue;
}
-
- //if( si )
- //MoveSQItem(si,tmpSI);
tmpSI=s->GetNextSQItem();
}
// friend hunting : this one will be difficult to remove !
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2005/01/24 14:14:11 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/01/26 09:49:53 $
+ 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 internal structure, not end user intended
+ * shouln't appear here
+ */
GDCM_EXPORT typedef struct
{
/// DicomGroup number
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDirElement
* \brief Represents elements contained in a DicomDir
* class for the chained lists from the file 'Dicts/DicomDir.dic'
*/
{ return DicomDirMetaList; };
/**
- * \ingroup DicomDirElement
* \brief returns a reference to the chained List
* related to the PATIENT Elements of a DICOMDIR.
*/
{ return DicomDirPatientList; };
/**
- * \ingroup DicomDirElement
* \brief returns a reference to the chained List
* related to the STUDY Elements of a DICOMDIR.
*/
{ return DicomDirStudyList; };
/**
- * \ingroup DicomDirElement
* \brief returns a reference to the chained List
* related to the SERIE Elements of a DICOMDIR.
*/
{ return DicomDirSerieList; };
/**
- * \ingroup DicomDirElement
* \brief returns a reference to the chained List
* related to the IMAGE Elements of a DICOMDIR.
*/
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2005/01/26 09:49:53 $
+ Version: $Revision: 1.47 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Hence we skip writing the VR.
// In order to avoid further troubles, we choose to write them
// as 'no-length' Item Delimitors (we pad by writing 0xffffffff)
- // The end of a given Item will be found when :
- // - a new Item Delimitor Item is encountered (the Seq goes on)
- // - a Sequence Delimitor Item is encountered (the Seq just ended)
-
- // TODO : verify if the Sequence Delimitor Item was forced during Parsing
+ // We shall force the end of a given Item by writting
+ // a Item Delimitation Item (fffe, e00d)
uint32_t ff = 0xffffffff;
binary_write(*fp, ff);
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 16:32:45 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2005/01/26 09:49:54 $
+ Version: $Revision: 1.47 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Public
/**
- * \brief Get the (std::string representable) value of the Dicom entry
+ * \brief Get the "std::string representable" value of the Dicom entry
* @param group Group number of the searched tag.
* @param elem Element number of the searched tag.
* @return Corresponding element value when it exists,
/**
* \brief Gets (from Header) a 'non string' element value
- * (LoadElementValues has already be executed)
* @param group group number of the Entry
* @param elem element number of the Entry
* @return Pointer to the 'non string' area
/**
* \brief Searches within Header Entries (Dicom Elements) parsed with
- * the public and private dictionaries
+ * the public [and private dictionaries]
* for the element value representation of a given tag..
* Obtaining the VR (Value Representation) might be needed by caller
* to convert the string typed content to caller's native type
* \brief Same as \ref Document::GetDocEntry except it only
* returns a result when the corresponding entry is of type
* BinEntry.
- * @param group Group number of the searched Dicom Element
- * @param elem Element number of the searched Dicom Element
+ * @param group Group number of the searched Dicom Element
+ * @param elem Element number of the searched Dicom Element
* @return When present, the corresponding BinEntry.
*/
BinEntry *DocEntrySet::GetBinEntry(uint16_t group, uint16_t elem)
{
DocEntry *currentEntry = GetDocEntry(group, elem);
if ( !currentEntry )
+ {
+ gdcmVerboseMacro( "No corresponding BinEntry " << std::hex << group <<
+ "," << elem);
return NULL;
+ }
return dynamic_cast<BinEntry*>(currentEntry);
}
{
DocEntry *currentEntry = GetDocEntry(group, elem);
if ( !currentEntry )
+ {
+ gdcmVerboseMacro( "No corresponding SeqEntry " << std::hex << group <<
+ "," << elem);
return NULL;
+ }
return dynamic_cast<SeqEntry*>(currentEntry);
}
ValEntry *entry = GetValEntry(group, elem);
if (!entry )
{
- gdcmVerboseMacro( "No corresponding ValEntry (try promotion first).");
+ gdcmVerboseMacro( "No corresponding ValEntry " << std::hex << group <<
+ "," << elem << " element (try promotion first).");
return false;
}
return SetValEntry(content,entry);
* @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
-bool DocEntrySet::SetBinEntry(uint8_t*content, int lgth,
+bool DocEntrySet::SetBinEntry(uint8_t *content, int lgth,
uint16_t group, uint16_t elem)
{
BinEntry *entry = GetBinEntry(group, elem);
if (!entry )
{
- gdcmVerboseMacro( "No corresponding ValEntry (try promotion first).");
+ gdcmVerboseMacro( "No corresponding ValEntry " << std::hex << group <<
+ "," << elem << " element (try promotion first).");
return false;
}
/**
- * \brief Searches both the public and the shadow dictionary (when they
- * exist) for the presence of the DictEntry with given
+ * \brief Searches [both] the public [and the shadow dictionary (when they
+ * exist)] for the presence of the DictEntry with given
* group and element, and create a new virtual DictEntry if necessary
* @param group group number of the searched DictEntry
* @param elem element number of the searched DictEntry
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:23 $
- Version: $Revision: 1.210 $
+ Date: $Date: 2005/01/26 09:49:54 $
+ Version: $Revision: 1.211 $
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 Dict Entries of THE public Dicom Dictionary
+ * @param os ostream to print to
* @return
*/
void Document::PrintPubDict(std::ostream &os)
/**
* \brief Prints The Dict Entries of THE shadow Dicom Dictionary
+ * @param os ostream to print to
* @return
*/
void Document::PrintShaDict(std::ostream &os)
delete Fp;
Fp = 0;
}
-
return true; //FIXME how do we detect a non-closed ifstream ?
}
* @param fp file pointer on an already open file (actually: Output File Stream)
* @param filetype Type of the File to be written
* (ACR-NEMA, ExplicitVR, ImplicitVR)
- * \return Always true.
+ * @return Always true.
*/
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
- /// (necessary if user wants to write a DICOM V3 file
- /// starting from an ACR-NEMA (V2) Header
+ // \TODO move the following lines (and a lot of others, to be written)
+ // to a future function CheckAndCorrectHeader
+
+ // (necessary if user wants to write a DICOM V3 file
+ // starting from an ACR-NEMA (V2) Header
if ( filetype == ImplicitVR || filetype == ExplicitVR )
{
fp->write("DICM", 4);
}
-/**
+/*
* \todo rewrite later, if really usefull
* - 'Group Length' element is optional in DICOM
* - but un-updated odd groups lengthes can causes pb
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:24 $
- Version: $Revision: 1.200 $
+ Date: $Date: 2005/01/26 09:49:54 $
+ Version: $Revision: 1.201 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// or Location (0020,0050)
// as the Z coordinate,
// 0. for all the coordinates if nothing is found
-
-// \todo find a way to inform the caller nothing was found
-// \todo How to tell the caller a wrong number of values was found?
//
// ---------------------------------------------------------------
//
if ( strImPos == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
- /// \todo How to tell the caller nothing was found ?
return 0.;
}
}
if ( strImPos == GDCM_UNFOUND )
{
gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)");
- /// \todo How to tell the caller nothing was found ?
return 0.;
}
}
}
}
-/// \todo TODO : unify those two (previous one and next one)
/**
* \brief Recover the pixel area length (in Bytes)
* @return Pixel Element Length, as stored in the header
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/25 15:44:24 $
- Version: $Revision: 1.60 $
+ Date: $Date: 2005/01/26 09:49:54 $
+ Version: $Revision: 1.61 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool SQItem::AddEntry(DocEntry *entry)
{
DocEntries.push_back(entry);
- //TODO : check if it worked
return true;
}
*/
DocEntry *SQItem::GetNextEntry()
{
- // gdcmAssertMacro (ItDocEntries != DocEntries.end());
- {
- ++ItDocEntries;
- if (ItDocEntries != DocEntries.end())
- return *ItDocEntries;
- return NULL;
- }
+ ++ItDocEntries;
+ if (ItDocEntries != DocEntries.end())
+ return *ItDocEntries;
+ return NULL;
}
/**
for(ListDocEntry::iterator i = DocEntries.begin();
i != DocEntries.end(); ++i)
{
- if ( (*i)->GetGroup()==group && (*i)->GetElement()==elem )
+ if ( (*i)->GetGroup() == group && (*i)->GetElement() == elem )
return *i;
}
return NULL;