Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/12/10 13:49:07 $
- Version: $Revision: 1.175 $
+ Date: $Date: 2005/01/06 16:05:06 $
+ Version: $Revision: 1.182 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Print
+void File::Print(std::ostream &os)
+{
+ HeaderInternal->SetPrintLevel(PrintLevel);
+ HeaderInternal->Print(os);
+
+ PixelReadConverter->SetPrintLevel(PrintLevel);
+ PixelReadConverter->Print(os);
+}
//-----------------------------------------------------------------------------
// Public
/**
* \brief Writes on disk A SINGLE Dicom file,
* using the Explicit Value Representation convention
- * NO test is performed on processor "Endiannity". * @param fileName name of the file to be created
+ * NO test is performed on processor "Endiannity".
+ * @param fileName name of the file to be created
* (any already existing file is overwritten)
* @return false if write fails
*/
return Write(fileName);
}
-bool File::Write(std::string const& fileName)
-{
- return WriteBase(fileName);
-}
-
-bool File::SetEntryByNumber(std::string const& content,
- uint16_t group, uint16_t element)
-{
- return HeaderInternal->SetEntryByNumber(content,group,element);
-}
-
-bool File::SetEntryByNumber(uint8_t* content, int lgth,
- uint16_t group, uint16_t element)
-{
- return HeaderInternal->SetEntryByNumber(content,lgth,group,element);
-}
-
-bool File::ReplaceOrCreateByNumber(std::string const& content,
- uint16_t group, uint16_t element)
-{
- return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL;
-}
-
-/**
- * \brief Access to the underlying \ref PixelReadConverter RGBA LUT
- */
-uint8_t* File::GetLutRGBA()
-{
- return PixelReadConverter->GetLutRGBA();
-}
-
-//-----------------------------------------------------------------------------
-// Protected
/**
- * \brief NOT a end user inteded function
- * (used by WriteDcmExplVR, WriteDcmImplVR, WriteAcr, etc)
+ * \brief Writes on disk A SINGLE Dicom file,
* @param fileName name of the file to be created
* (any already existing file is overwritten)
- * @param type file type (ExplicitVR, ImplicitVR, ...)
* @return false if write fails
*/
-bool File::WriteBase (std::string const & fileName)
+bool File::Write(std::string const& fileName)
{
switch(WriteType)
{
return check;
}
+/**
+ * \brief Accesses an existing DocEntry (i.e. a Dicom Element)
+ * through it's (group, element) and modifies it's content with
+ * the given value.
+ * @param content new value (string) to substitute with
+ * @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,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->SetEntryByNumber(content,group,element);
+}
+
+
+/**
+ * \brief Accesses an existing DocEntry (i.e. a Dicom Element)
+ * through it's (group, element) and modifies it's content with
+ * the given value.
+ * @param content new value (void* -> uint8_t*) to substitute with
+ * @param lgth new value length
+ * @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,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->SetEntryByNumber(content,lgth,group,element);
+}
+
+/**
+ * \brief Modifies the value of a given Doc Entry (Dicom Element)
+ * when it exists. Create it with the given value when unexistant.
+ * @param content (string) Value to be set
+ * @param group Group number of the Entry
+ * @param element Element number of the Entry
+ * \return pointer to the modified/created Header Entry (NULL when creation
+ * failed).
+ */
+bool File::ReplaceOrCreateByNumber(std::string const& content,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL;
+}
+
+/*
+ * \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 group Group number of the Entry
+ * @param element Element number of the Entry
+ * \return pointer to the modified/created Header Entry (NULL when creation
+ * failed).
+ */
+bool File::ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
+ uint16_t group, uint16_t element)
+{
+ return HeaderInternal->ReplaceOrCreateByNumber(binArea,lgth,group,element) != NULL;
+}
+
+/**
+ * \brief Access to the underlying \ref PixelReadConverter RGBA LUT
+ */
+uint8_t* File::GetLutRGBA()
+{
+ return PixelReadConverter->GetLutRGBA();
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+
/**
* \brief Check the write integrity
*
ValEntry* tss = CopyValEntry(0x0002,0x0010);
tss->SetValue(ts);
+
+ Archive->Push(tss);
}
void File::RestoreWriteFileType()
void File::SetWriteToLibido()
{
- ValEntry *oldRow = dynamic_cast<ValEntry *>(HeaderInternal->GetDocEntryByNumber(0x0028, 0x0010));
- ValEntry *oldCol = dynamic_cast<ValEntry *>(HeaderInternal->GetDocEntryByNumber(0x0028, 0x0011));
+ ValEntry *oldRow = dynamic_cast<ValEntry *>
+ (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0010));
+ ValEntry *oldCol = dynamic_cast<ValEntry *>
+ (HeaderInternal->GetDocEntryByNumber(0x0028, 0x0011));
if( oldRow && oldCol )
{
void File::SetWriteToNoLibido()
{
- ValEntry *recCode = dynamic_cast<ValEntry *>(HeaderInternal->GetDocEntryByNumber(0x0008,0x0010));
+ ValEntry *recCode = dynamic_cast<ValEntry *>
+ (HeaderInternal->GetDocEntryByNumber(0x0008,0x0010));
if( recCode )
{
if( recCode->GetValue() == "ACRNEMA_LIBIDO_1.1" )