+2004-12-16 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmFile.[h|cxx] : add the Print method
+ * src/gdcmPixelReadConvert.[h|cxx] : add the generalized Print method
+ * src/gdcmDocEntrySet.h : generalize the Print with the PrintLevel
+ * src/gdcmDocument.h : remove the PrintLevel informations
+ * Example/PrintFile.cxx : use the new gdcm::File::Print
+
2004-12-16 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmFile.cxx : Add the code of ReplaceOrCreateByNumber to not have
problems when compiling with the python wrapping
Program: gdcm
Module: $RCSfile: PrintFile.cxx,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:55 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2004/12/16 11:37:01 $
+ 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
e1= new gdcm::Header( fileName.c_str() );
f1 = new gdcm::File(e1);
- e1->SetPrintLevel(2);
- e1->Print();
+ f1->SetPrintLevel(2);
+ f1->Print();
std::cout << "\n\n" << std::endl;
std::string transferSyntaxName = e1->GetTransfertSyntaxName();
std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl;
-/* if ( transferSyntaxName != "Implicit VR - Little Endian"
- && transferSyntaxName != "Explicit VR - Little Endian"
- && transferSyntaxName != "Deflated Explicit VR - Little Endian"
- && transferSyntaxName != "Explicit VR - Big Endian"
- && transferSyntaxName != "Uncompressed ACR-NEMA" )
- {
- std::cout << std::endl << "==========================================="
- << std::endl;
- f1->GetPixelReadConverter()->Print();
- std::cout << std::endl << "==========================================="
- << std::endl;
- }*/
-
if(e1->IsReadable())
std::cout <<std::endl<<fileName<<" is Readable"<<std::endl;
else
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2004/12/06 11:37:38 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2004/12/16 11:37:02 $
+ 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
DocEntrySet() {};
virtual ~DocEntrySet() {};
+ /// \brief prints any type of entry to the entry set (pure vitual)
+ virtual void Print (std::ostream & os = std::cout) = 0;// pure virtual
+ /// Accessor to \ref PrintLevel
+ void SetPrintLevel(int level) { PrintLevel = level; }
+
/// \brief adds any type of entry to the entry set (pure vitual)
virtual bool AddEntry(DocEntry *Entry) = 0; // pure virtual
virtual bool RemoveEntry(DocEntry *EntryToRemove)=0; // pure virtual
virtual bool RemoveEntryNoDestroy(DocEntry *EntryToRemove)=0; // pure virtual
- /// \brief prints any type of entry to the entry set (pure vitual)
- virtual void Print (std::ostream & os = std::cout) = 0;// pure virtual
-
/// \brief write any type of entry to the entry set
virtual void WriteContent (std::ofstream *fp, FileType filetype) = 0;// pure virtual
TagName const & name = "unkn" );
protected:
-
// DocEntry related utilities
ValEntry* NewValEntryByNumber(uint16_t group,
uint16_t element);
DictEntry *GetDictEntryByName (TagName const & name);
DictEntry *GetDictEntryByNumber(uint16_t, uint16_t);
+ /// \brief Amount of printed details for each Header Entry (Dicom Element):
+ /// 0 : stands for the least detail level.
+ int PrintLevel;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/12/07 13:39:33 $
- Version: $Revision: 1.68 $
+ Date: $Date: 2004/12/16 11:37:02 $
+ Version: $Revision: 1.69 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Store the JPEG fragments info obtained during parsing of pixels.
JPEGFragmentsInfo* JPEGInfo;
- /// \brief Amount of printed details for each Header Entry (Dicom Element):
- /// 0 : stands for the least detail level.
- int PrintLevel;
-
public:
// the 2 following will be merged
virtual void PrintPubDict (std::ostream &os = std::cout);
void HandleBrokenEndian(uint16_t group, uint16_t elem);
public:
// Accessors:
- /// Accessor to \ref PrintLevel
- void SetPrintLevel(int level) { PrintLevel = level; }
-
/// Accessor to \ref Filename
const std::string &GetFileName() const { return Filename; }
int GetSwapCode() { return SwapCode; }
bool operator<(Document &document);
-
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2004/12/03 17:13:18 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2004/12/16 11:37:02 $
+ 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
TagHT.clear();
}
-
-//-----------------------------------------------------------------------------
-// Public
-
-
//-----------------------------------------------------------------------------
// Print
/**
}
}
+//-----------------------------------------------------------------------------
+// Public
/**
* \brief Writes the Header Entries (Dicom Elements)
* from the H Table
i->second->WriteContent(fp, filetype);
}
}
-//-----------------------------------------------------------------------------
-// Protected
//-----------------------------------------------------------------------------
+// Protected
//-----------------------------------------------------------------------------
// Private
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ 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
ElementSet(int);
~ElementSet();
+ virtual void Print(std::ostream &os = std::cout);
+
bool AddEntry(DocEntry *Entry);
bool RemoveEntry(DocEntry *EntryToRemove);
bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
- void Print(std::ostream &os = std::cout);
void WriteContent(std::ofstream *fp, FileType filetype);
/// Accessor to \ref TagHT
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 10:51:49 $
- Version: $Revision: 1.177 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ Version: $Revision: 1.178 $
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->Print(os);
+}
//-----------------------------------------------------------------------------
// Public
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2004/12/16 10:51:49 $
- Version: $Revision: 1.87 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ Version: $Revision: 1.88 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifndef GDCMFILE_H
#define GDCMFILE_H
+#include <iostream>
#include "gdcmCommon.h"
namespace gdcm
virtual ~File();
+ void Print(std::ostream &os = std::cout);
+ /// Accessor to \ref PrintLevel
+ void SetPrintLevel(int level) { PrintLevel = level; }
+
/// Accessor to \ref Header
Header* GetHeader() { return HeaderInternal; }
ValEntry* CopyValEntry(uint16_t group,uint16_t element);
BinEntry* CopyBinEntry(uint16_t group,uint16_t element);
+ /// \brief Amount of printed details for each Header Entry (Dicom Element):
+ /// 0 : stands for the least detail level.
+ int PrintLevel;
+
private:
void Initialise();
uint8_t* GetRaw();
-private:
// members variables:
-
/// Header to use to load the file
Header *HeaderInternal;
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2004/12/14 13:05:34 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ 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
return true;
}
+/**
+ * \brief Print self.
+ * @param os Stream to print to.
+ */
+void PixelReadConvert::Print( std::ostream &os )
+{
+ Print("",os);
+}
+
/**
* \brief Print self.
* @param indent Indentation string to be prepended during printing.
<< std::endl;
os << indent
<< "Pixel Data: offset " << PixelOffset
- << " x" << std::hex << PixelOffset << std::dec
- << " length " << PixelDataLength
- << " x" << std::hex << PixelDataLength << std::dec
- << std::endl;
+ << " x(" << std::hex << PixelOffset << std::dec
+ << ") length " << PixelDataLength
+ << " x(" << std::hex << PixelDataLength << std::dec
+ << ")" << std::endl;
if ( IsRLELossless )
{
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.h,v $
Language: C++
- Date: $Date: 2004/12/12 17:21:07 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//// Predicates:
bool IsRawRGB();
+ void Print( std::ostream &os = std::cout );
void Print( std::string indent = "", std::ostream &os = std::cout );
// In progress
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2004/12/06 11:37:38 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2004/12/16 11:37:03 $
+ 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
SQItem(int depthLevel);
~SQItem();
- void Print(std::ostream &os = std::cout);
+ virtual void Print(std::ostream &os = std::cout);
void WriteContent(std::ofstream *fp, FileType filetype);
/// \brief returns the DocEntry chained List for this SQ Item.