Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2007/05/23 14:18:08 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ 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
/**
* \brief Sets the value (non string) of the current DataEntry
* @param area area
- * @param self self
+ * @param self self=true : The area : *belongs" to the DataEntry
+ * : will be delete with the DataEntry
+ * self=false The area *is not* deleted with the DataEntry
+ *
*/
void DataEntry::SetBinArea( uint8_t *area, bool self )
{
NewBinArea();
memcpy(BinArea,area,length);
if( length!=lgh )
- BinArea[length]=0;
+ BinArea[length]=0; // padd with zero
State = STATE_LOADED;
}
if( id > GetValueCount() )
{
- gdcmErrorMacro("Index (" << id << ")is greater than the data size");
+ gdcmErrorMacro("Index (" << id << ") is greater than the data size");
return;
}
}
}
/**
- * \brief returns, as a double (?!?) one of the values
+ * \brief returns, as a double one of the values
* (when entry is multivaluated), identified by its index.
* Returns 0.0 if index is wrong
* @param id id
return 0.0;
}
- /// \todo FIX the API : user *knows* that entry contains a US
- /// and he receives a double ?!?
+ // if user *knows* that entry contains a US,
+ // he just has to cast the double he receives
const VRKey &vr = GetVR();
- /// \todo FIX the API : user *knows* that entry contains a US,
- /// the method is supposed to return a double
- /// but sends a US ?!?
+
if( vr == "US" || vr == "SS" )
return ((uint16_t *)BinArea)[id];
else if( vr == "UL" || vr == "SL" )
}
/**
- * \brief Gets a std::vector <double> holding the value(s) of a DS DataEntry
+ * \brief Gets a std::vector of 'double' holding the value(s) of a DS DataEntry
* @param valueVector std::vector double of value(s)
* \return false if VR not "DS" or DataEntry empty
*/
}
/**
- * \brief Writes the 'value' area of a DataEntry
+ * \brief Writes the 'common part' + the 'value' area of a DataEntry
* @param fp already open ofstream pointer
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
-void DataEntry::WriteContent(std::ofstream *fp, FileType filetype)
+void DataEntry::WriteContent(std::ofstream *fp, FileType filetype,
+ bool insideMetaElements, bool insideSequence)
{
- DocEntry::WriteContent(fp, filetype);
+ // writes the 'common part'
+ DocEntry::WriteContent(fp, filetype, insideMetaElements, insideSequence);
if ( GetGroup() == 0xfffe )
{