]> Creatis software - gdcm.git/commitdiff
Some normalizations :
authorjpr <jpr>
Sun, 23 Jan 2005 10:12:31 +0000 (10:12 +0000)
committerjpr <jpr>
Sun, 23 Jan 2005 10:12:31 +0000 (10:12 +0000)
- Move some methods to parent class
- Position correctly the entry points for JPEG2000 and JPEG-LS
  (JPG-LS in NOT jpeg 'lossless')
- Remove deprecated and useless methods
- Update comments
- Update Doxygenation

35 files changed:
Example/PrintFile.cxx
Example/TestPapyrus.cxx
Testing/TestTS.cxx
src/gdcmBase.cxx
src/gdcmBinEntry.cxx
src/gdcmDicomDir.cxx
src/gdcmDicomDirImage.cxx
src/gdcmDicomDirMeta.cxx
src/gdcmDicomDirPatient.cxx
src/gdcmDicomDirSerie.cxx
src/gdcmDicomDirStudy.cxx
src/gdcmDict.cxx
src/gdcmDictEntry.cxx
src/gdcmDictSet.cxx
src/gdcmDirList.h
src/gdcmDocEntry.cxx
src/gdcmDocEntrySet.cxx
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmElementSet.cxx
src/gdcmElementSet.h
src/gdcmFile.cxx
src/gdcmFile.h
src/gdcmFileHelper.cxx
src/gdcmFileHelper.h
src/gdcmGlobal.cxx
src/gdcmJPEGFragmentsInfo.cxx
src/gdcmPixelReadConvert.cxx
src/gdcmPixelReadConvert.h
src/gdcmPixelWriteConvert.cxx
src/gdcmSeqEntry.cxx
src/gdcmTS.cxx
src/gdcmTS.h
src/gdcmUtil.cxx
src/gdcmValEntry.cxx

index de95dc454d9398711c06f37b44d6b45f7b7bf000..c88731761bdef8e10f33e7c8e43d4093fd0c0e87 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: PrintFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:52 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2005/01/23 10:12:31 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -45,16 +45,16 @@ int main(int argc, char* argv[])
    if (argc > 3)
       gdcm::Debug::SetDebugOn();
    
-   e1= new gdcm::File( fileName.c_str() );
+   e1 = new gdcm::File( fileName.c_str() );
    f1 = new gdcm::FileHelper(e1);
 
    if (argc > 2) 
    {
       int level = atoi(argv[2]);   
-      e1->SetPrintLevel(level);
+      f1->SetPrintLevel(level);
    }
 
-   e1->Print();   
+   f1->Print();   
 
    std::cout << "\n\n" << std::endl; 
 
index 63ae5e048e17f88c145f60fa2e3b477253390149..9d918d18cf906460a1587bb9f6912a23d43c09e5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestPapyrus.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:52 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/23 10:12:32 $
+  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
@@ -96,7 +96,7 @@ int main(int argc, char* argv[])
 
    // Look for private Papyrus Sequence
    gdcm::SeqEntry *seqPapyrus= h->GetSeqEntry(0x0041, 0x1050);
-   if (!h)
+   if (!seqPapyrus)
    {
       std::cout << "NOT a Papyrus File" << std::endl;
       delete h;
@@ -165,12 +165,16 @@ int main(int argc, char* argv[])
    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.
index 582264393a94d3d4c8a504c548410898d72b33b7..77d528b9b2104d23b8e7510f36991653bab3769a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 17:19:38 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/01/23 10:12:32 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -67,7 +67,6 @@ int TestTS(int , char *[])
    std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl;
    std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl;
    std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl;
-   std::cout << ts.IsEncapsulate( "1.2.840.10008.1.2.5") << std::endl;
    std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl;
    std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" )  << std::endl;
 
index a74a2cdcee8ac8e3c2c3e44f68929a8a51172fc2..dcba3c95fdda028bdbdfa735ab18d077397ddec6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBase.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/01/23 10:12:32 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,7 +44,7 @@ Base::~Base()
 /**
  * \brief   Print all the object
  * @param   os The output stream to be written to.
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  */
 void Base::Print(std::ostream &, std::string const & )
 {
index 62dfc3da21187abba740a477138e853116e160bf..194ca5ff93846551a3f2e58b06aeee434105ef91 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/19 15:58:00 $
-  Version:   $Revision: 1.54 $
+  Date:      $Date: 2005/01/23 10:12:32 $
+  Version:   $Revision: 1.55 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -46,9 +46,6 @@ BinEntry::BinEntry(DocEntry *e) : ValEntry(e->GetDictEntry())
 {
    Copy(e);
 
-   //FIXME
-   //SQDepthLevel = e->GetDepthLevel();
-
    BinArea = 0; // let's be carefull !
    SelfArea = true;
 }
@@ -68,10 +65,11 @@ BinEntry::~BinEntry()
 
 //-----------------------------------------------------------------------------
 // Print
-/*
- * \brief   canonical Printer
+/**
+ * \brief   Prints a BinEntry (Dicom entry)
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
  */
 void BinEntry::Print(std::ostream &os, std::string const & )
 {
    os << "B ";
@@ -94,8 +92,7 @@ void BinEntry::Print(std::ostream &os, std::string const & )
       {
          //s << " [gdcm::Binary data NOT loaded]";
          s << " [" <<GetValue() << "]";
-      }
-         
+      }         
    }
    os << s.str();
 }
@@ -117,7 +114,7 @@ void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
    // TODO FIME
    // Probabely, the same operation will have to be done when we want 
    // to write image with Big Endian Transfert Syntax, 
-   //   and we are working onj Little Endian Processor
+   //   and we are working on Little Endian Processor
 
 #ifdef GDCM_WORDS_BIGENDIAN
       // Be carefull with *any* 16 bits words 'binEntries !'
index f94de80566bb7f36e82bac2b599d10e204221941..e9dfaa9ba15c477518fffc124e05cc7713f08327 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 15:28:18 $
-  Version:   $Revision: 1.113 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.114 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -89,7 +89,8 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ):
    Initialize();  // sets all private fields to NULL
 
    // if user passed a root directory, sure we didn't get anything
-   if ( GetFirstEntry() != 0 ) // when user passed a Directory to parse
+
+   if ( GetFirstEntry() == 0 ) // when user passed a Directory to parse
    {
       if (!parseDir)
          gdcmVerboseMacro( "Entry HT empty for file: "<<fileName);
@@ -161,6 +162,8 @@ DicomDir::~DicomDir()
 // Print
 /**
  * \brief  Canonical Printer 
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
  */
 void DicomDir::Print(std::ostream &os, std::string const & )
 {
@@ -471,7 +474,7 @@ DicomDirMeta *DicomDir::NewMeta()
    if( MetaElems )
       delete MetaElems;
 
- // friend hunting : we miss GetLastEntry and GetPreviousEntry
+ // friend class hunting : we miss GetLastEntry and GetPreviousEntry
  //                  to be able to remove any direct reference to TagHT
 
    DocEntry *e = GetFirstEntry();
@@ -743,8 +746,6 @@ void DicomDir::CreateDicomDir()
    }
 
    NewMeta();
-
-   //ListSQItem listItems = s->GetSQItems();
    
    DocEntry *d;
    std::string v;
@@ -813,7 +814,6 @@ void DicomDir::CreateDicomDir()
 
       if( si )
          MoveSQItem(si,tmpSI);
-
       tmpSI=s->GetNextSQItem();
    }
 // friend hunting : this one will be difficult to remove !
@@ -1000,7 +1000,7 @@ void DicomDir::MoveSQItem(SQItem *dst,SQItem *src)
 }
 
 /**
- * \brief   compares two dgcmHeaders
+ * \brief   compares two files
  */
 bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
 {
index 6ad054f8c9d6d72e423dde6c17cbfcbe867fed4b..688886fd7bde7a3a0a0ee773067b0fe7df1dd24d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirImage.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:42 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -50,7 +50,7 @@ DicomDirImage::~DicomDirImage()
 /**
  * \brief   Prints the Object
  * @param os ostream to write to
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  * @return
  */ 
 void DicomDirImage::Print(std::ostream &os, std::string const & )
index 516150de0cd29c7635ccbe431ebab977b28d5312..b008d0e54be55337ac555d9b4fcdb2bc85289e38 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirMeta.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:42 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,7 +53,7 @@ DicomDirMeta::~DicomDirMeta()
 /**
  * \brief   Prints the Meta Elements
  * @param os ostream to write to 
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  */ 
 void DicomDirMeta::Print(std::ostream &os, std::string const & )
 {
index cc2ba5b58d937cb7495d0d23e81a52a60a32d4cd..ceeea5b4fe4179e6a699b5712105b98d5c8c3f73 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:42 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -60,7 +60,7 @@ DicomDirPatient::~DicomDirPatient()
 /**
  * \brief   Prints the Object
  * @param os ostream to write to 
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  */ 
 void DicomDirPatient::Print(std::ostream &os, std::string const & )
 {
index 5ae79875455ac04f3d94717dd73c6c7559329294..5b0b3179cea36d1ee4c1b03337f472c03f83be60 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:42 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  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
@@ -59,7 +59,7 @@ DicomDirSerie::~DicomDirSerie()
 /**
  * \brief   Prints the Object
  * @param os ostream to write to
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  */ 
 void DicomDirSerie::Print(std::ostream &os, std::string const &)
 {
index 6c43c6b01dec6eab9b6bcb8a72e49dac36a2e2b4..b2ef75232fb7aeb66e340c5edf1ab671a6697fd8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 16:16:42 $
-  Version:   $Revision: 1.29 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.30 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -58,7 +58,7 @@ DicomDirStudy::~DicomDirStudy()
 /**
  * \brief   Prints the Object
  * @param os ostream to write to 
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  * @return
  */ 
 void DicomDirStudy::Print(std::ostream &os, std::string const & )
index d56ff7c2ce5167b8f6caa507829c3a9300bb4837..162b79c04237662ef239768e29903e397fe99736 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.68 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  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
@@ -91,7 +91,7 @@ Dict::~Dict()
  * \brief   Print all the dictionary entries contained in this dictionary.
  *          Entries will be sorted by tag i.e. the couple (group, element).
  * @param   os The output stream to be written to.
- * @param   indent indent 
+ * @param indent Indentation string to be prepended during printing
  */
 void Dict::Print(std::ostream &os, std::string const & )
 {
index 186f2cb5c31730da39fd3493c422878a6b1497db..7c64268a0d35afba40fb079c8604997419f565f6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/17 17:27:03 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -52,6 +52,11 @@ DictEntry::DictEntry(uint16_t group, uint16_t elem,
 
 //-----------------------------------------------------------------------------
 // Print
+/**
+ * \brief   Prints an entry of the Dicom DictionaryEntry
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
 void DictEntry::Print(std::ostream &os, std::string const & )
 {
    std::string vr;
index f4ae8c8c7c7ddabf2d610d40315287e19599ce06..c9cdfbcfb66a3544144ce1871779e8c3883f52d0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.55 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.56 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -65,7 +65,7 @@ DictSet::~DictSet()
  * \brief   Print, in an informal fashion, the list of all the dictionaries
  *          contained is this DictSet, along with their respective content.
  * @param   os Output stream used for printing.
- * @param   indent indent
+ * @param indent Indentation string to be prepended during printing
  */
 void DictSet::Print(std::ostream &os, std::string const & )
 {
index 7e79044be68181e458b732a214d511a1f2b85d37..6f1f234e836d76b0c9f4e4b0fbd2641ad096d024 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 22:20:11 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.19 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 namespace gdcm 
 {
 
+typedef std::vector<std::string> DirListType;
+
 //-----------------------------------------------------------------------------
+
+// NOTE: Due to a VC6 'feature' we can not export a std::list in a dll, 
+// so GDCM_EXPORT keyword was removed for this class only
+
 /**
  * \ingroup DirList
  * \brief   List containing the file Header s of all the gdcm readable files
  *          found by exploring recursively a root directory. 
  */
-// NOTE: Due to a VC6 'feature' we can not export a std::list in a dll, 
-// so GDCM_EXPORT keyword was removed for this class only
-
-typedef std::vector<std::string> DirListType;
-
 class GDCM_EXPORT DirList
 {
 public :
index 3701d3a6266587a0f945cd57052f5190d5ecfc18..e82e2100c8dd2c6ad8d2e94884ca3ebcccb681d9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/19 15:58:00 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.45 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -116,7 +116,7 @@ void DocEntry::Print(std::ostream &os, std::string const & )
 
 /**
  * \brief   Writes the common part of any ValEntry, BinEntry, SeqEntry
- * @param fp already open file pointer
+ * @param fp already open ofstream pointer
  * @param filetype type of the file to be written
  */
 void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
index 2ffa021a26703775a6c04f20fb12b43268a4f717..141813d368c9ea3ceb37289f684408dd0fc13c20 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:39:49 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -39,7 +39,7 @@ namespace gdcm
  * @param   group group  number of the underlying DictEntry
  * @param   elem  element number of the underlying DictEntry
  * @param   vr    VR (Value Representation) of the underlying DictEntry
- * @param   vm    VM (Value Multiplicity) of the underlying DictEntry
+ * @param   vm    VM (Value Multiplicity)   of the underlying DictEntry
  * @param   name   english name
  */
 DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group,uint16_t elem,
@@ -125,7 +125,7 @@ SeqEntry* DocEntrySet::NewSeqEntry(uint16_t group,uint16_t elem)
  *          exist)] for the presence of the DictEntry with given
  *          group and element. The public dictionary has precedence on the
  *          shadow one.
- * @param   group   group number of the searched DictEntry
+ * @param   group  group number of the searched DictEntry
  * @param   elem element number of the searched DictEntry
  * @return  Corresponding DictEntry when it exists, NULL otherwise.
  */
@@ -149,7 +149,7 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem)
  * \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   group  group number of the searched DictEntry
  * @param   elem element number of the searched DictEntry
  * @param   vr Value Representation to use, if necessary 
  * @return  Corresponding DictEntry when it exists, NULL otherwise.
@@ -185,10 +185,11 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem,
          goodEntry = NewVirtualDictEntry(group, elem, goodVR);
       }
    }
-
    return goodEntry;
 }
 
+
+
 //-----------------------------------------------------------------------------
 // Private
 
index bb3d81df1addaf1a83701eaae7d61b31a299731d..8437264ba6268cf28f9d21c8eb86fb132f8a95a7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:37:37 $
-  Version:   $Revision: 1.203 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.204 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -59,7 +59,7 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff;
 
 /**
  * \brief   constructor  
- * @param   filename file to be opened for parsing
+ * @param   filename 'Document' (File or DicomDir) to be opened for parsing
  */
 Document::Document( std::string const &filename ) : ElementSet(-1)
 {
@@ -265,7 +265,8 @@ bool Document::IsReadable()
       return false;
    }
 
-   if( TagHT.empty() )
+   //if( TagHT.empty() )
+   if ( IsEmpty() )
    { 
       gdcmVerboseMacro( "No tag in internal hash table.");
       return false;
@@ -324,6 +325,23 @@ bool Document::IsDicomV3()
    return GetDocEntry(0x0002, 0x0010) != NULL;
 }
 
+/**
+ * \brief   Predicate for Papyrus file
+ *          Dedicated to whomsoever it may concern
+ * @return  True when the file is a Papyrus file.
+ */
+bool Document::IsPapyrus()
+{
+   // check for Papyrus private Sequence
+   DocEntry *e = GetDocEntry(0x0041, 0x1050);
+   if ( !e )
+      return false;
+   // check if it's actually a Sequence
+   if ( !dynamic_cast<SeqEntry*>(e) )
+      return  false;
+   return true;
+}
+
 /**
  * \brief  returns the File Type 
  *         (ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown)
@@ -663,39 +681,6 @@ bool Document::ReplaceIfExist(std::string const &value,
 //-----------------------------------------------------------------------------
 // Protected
 
-/**
- * \brief   Checks if a given Dicom Element exists within the H table
- * @param   group   Group number of the searched Dicom Element 
- * @param   elem  Element number of the searched Dicom Element 
- * @return true is found
- */
-bool Document::CheckIfEntryExist(uint16_t group, uint16_t elem )
-{
-   const std::string &key = DictEntry::TranslateToKey(group, elem );
-   return TagHT.count(key) != 0;
-}
-
-
-/**
- * \brief   Searches within Header Entries (Dicom Elements) parsed with 
- *          the public and private dictionaries 
- *          for the element value representation of a given tag.
- * @param   group  Group number of the searched tag.
- * @param   elem Element number of the searched tag.
- * @return  Corresponding element value representation when it exists,
- *          and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
- */
-std::string Document::GetEntry(uint16_t group, uint16_t elem)
-{
-   TagKey key = DictEntry::TranslateToKey(group, elem);
-   if ( !TagHT.count(key))
-   {
-      return GDCM_UNFOUND;
-   }
-
-   return ((ValEntry *)TagHT.find(key)->second)->GetValue();
-}
-
 /**
  * \brief   Searches within Header Entries (Dicom Elements) parsed with 
  *          the public and private dictionaries 
@@ -2477,25 +2462,25 @@ DocEntry *Document::ReadNextDocEntry()
    return newEntry;
 }
 
-
+//GenerateFreeTagKeyInGroup? What was it designed for ?!? 
 /**
  * \brief   Generate a free TagKey i.e. a TagKey that is not present
  *          in the TagHt dictionary.
  * @param   group The generated tag must belong to this group.  
  * @return  The element of tag with given group which is fee.
  */
-uint32_t Document::GenerateFreeTagKeyInGroup(uint16_t group) 
-{
-   for (uint32_t elem = 0; elem < UINT32_MAX; elem++) 
-   {
-      TagKey key = DictEntry::TranslateToKey(group, elem);
-      if (TagHT.count(key) == 0)
-      {
-         return elem;
-      }
-   }
-   return UINT32_MAX;
-}
+//uint32_t Document::GenerateFreeTagKeyInGroup(uint16_t group) 
+//{
+//   for (uint32_t elem = 0; elem < UINT32_MAX; elem++) 
+//   {
+//      TagKey key = DictEntry::TranslateToKey(group, elem);
+//      if (TagHT.count(key) == 0)
+//      {
+//         return elem;
+//      }
+//   }
+//   return UINT32_MAX;
+//}
 
 /**
  * \brief   Assuming the internal file pointer \ref Document::Fp 
@@ -2749,7 +2734,7 @@ void Document::ComputeJPEGFragmentInfo()
    }
 }
 
-/**
+/*
  * \brief Walk recursively the given \ref DocEntrySet, and feed
  *        the given hash table (\ref TagDocEntryHT) with all the
  *        \ref DocEntry (Dicom entries) encountered.
@@ -2810,7 +2795,7 @@ void Document::ComputeJPEGFragmentInfo()
    }
 }*/
 
-/**
+/*
  * \brief Build a \ref TagDocEntryHT (i.e. a std::map<>) from the current
  *        Document.
  *
index 6ebc79c9fb5041e30ebca1054c4655f49b5cfd73..e81582467fbcde9b13961db83c98fe6d1663e24f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:55 $
-  Version:   $Revision: 1.96 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  Version:   $Revision: 1.97 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,8 +48,9 @@ public:
    FileType GetFileType();
 
    std::string GetTransferSyntax();
+   /// returns RLEFramesInfo 
    RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
+   /// returns JPEGFragmentsInfo
    JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
 
 // Dictionaries
@@ -99,22 +100,19 @@ public:
 
    virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);   
 
-   virtual std::string GetEntry  (uint16_t group, uint16_t elem);
    virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
    virtual int GetEntryLength(uint16_t group, uint16_t elem);
 
    ValEntry *ReplaceOrCreate(std::string const &value,
                              uint16_t group, uint16_t elem,
                              TagName const &vr = GDCM_UNKNOWN);
-   BinEntry *ReplaceOrCreate(uint8_tbinArea, int lgth,
+   BinEntry *ReplaceOrCreate(uint8_t *binArea, int lgth,
                              uint16_t group, uint16_t elem,
                              TagName const &vr = GDCM_UNKNOWN);
    SeqEntry *ReplaceOrCreate(uint16_t group, uint16_t elem);
 
    bool ReplaceIfExist(std::string const &value,
                        uint16_t group, uint16_t elem );
-
-   bool CheckIfEntryExist(uint16_t group, uint16_t elem );
    
    virtual void LoadEntryBinArea(uint16_t group, uint16_t elem);
    virtual void LoadEntryBinArea(BinEntry *entry);
@@ -126,6 +124,7 @@ public:
    std::string GetTransferSyntaxName();
 
    bool IsDicomV3();
+   bool IsPapyrus();
 
 protected:
 // Methods
@@ -227,11 +226,11 @@ private:
    // DocEntry related utilities
    DocEntry *ReadNextDocEntry();
 
-   uint32_t GenerateFreeTagKeyInGroup(uint16_t group);
-/  void BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
-                                   DocEntrySet* set );*/
+//  uint32_t GenerateFreeTagKeyInGroup(uint16_t group);
+//  void BuildFlatHashTableRecurse( TagDocEntryHT &builtHT,
+//                                   DocEntrySet *set );
 
-   void HandleBrokenEndian(uint16_t &group, uint16_t &elem);
+   void HandleBrokenEndian  (uint16_t &group, uint16_t &elem);
    void HandleOutOfGroup0002(uint16_t &group, uint16_t &elem);
 
 // Variables
@@ -254,8 +253,9 @@ private:
    uint32_t MaxSizePrintEntry;   
 
 private:
-   friend class FileHelper;
+
 };
+
 } // end namespace gdcm
 
 //-----------------------------------------------------------------------------
index cf778c42745d9a3faf69fe42030045ee36070c5d..317c108f9b6df7f08104eaf262e6ee1e5e65866f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:37:37 $
-  Version:   $Revision: 1.47 $
+  Date:      $Date: 2005/01/23 10:12:33 $
+  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
@@ -96,7 +96,6 @@ void ElementSet::WriteContent(std::ofstream *fp, FileType filetype)
    } 
 }
 
-
 /**
  * \brief  retrieves a Dicom Element using (group, element)
  * @param   group  Group number of the searched Dicom Element 
@@ -189,6 +188,39 @@ SeqEntry *ElementSet::GetSeqEntry(uint16_t group, uint16_t elem)
 //-----------------------------------------------------------------------------
 // Protected
 
+/**
+ * \brief   Checks if a given Dicom Element exists within the H table
+ * @param   group   Group number of the searched Dicom Element 
+ * @param   elem  Element number of the searched Dicom Element 
+ * @return true is found
+ */
+bool ElementSet::CheckIfEntryExist(uint16_t group, uint16_t elem )
+{
+   const std::string &key = DictEntry::TranslateToKey(group, elem );
+   return TagHT.count(key) != 0;
+}
+
+/**
+ * \brief   Searches within Header Entries (Dicom Elements) parsed with 
+ *          the public and private dictionaries 
+ *          for the element value representation of a given tag.
+ * @param   group  Group number of the searched tag.
+ * @param   elem Element number of the searched tag.
+ * @return  Corresponding element value representation when it exists,
+ *          and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string ElementSet::GetEntry(uint16_t group, uint16_t elem)
+{
+   TagKey key = DictEntry::TranslateToKey(group, elem);
+   if ( !TagHT.count(key))
+   {
+      return GDCM_UNFOUND;
+   }
+
+   return ((ValEntry *)TagHT.find(key)->second)->GetValue();
+}
+
+
 //-----------------------------------------------------------------------------
 // Private
 
@@ -276,5 +308,34 @@ DocEntry *ElementSet::GetNextEntry()
    return NULL;
 }
 
+
+/**
+ * \brief   Get the larst entry while visiting the DocEntrySet
+ * \return  The last DocEntry if found, otherwhise NULL
+ */
+DocEntry *ElementSet::GetLastEntry()
+{
+   ItTagHT = TagHT.end();
+   if ( ItTagHT != TagHT.begin() )
+      return  ItTagHT->second;
+   return NULL;
+}
+
+/**
+ * \brief   Get the previous entry while visiting the Hash table (TagHT)
+ * \note : meaningfull only if GetFirstEntry already called 
+ * \return  The previous DocEntry if found, otherwhise NULL
+ */
+DocEntry *ElementSet::GetPreviousEntry()
+{
+   gdcmAssertMacro (ItTagHT != TagHT.begin());
+
+   --ItTagHT;
+   if (ItTagHT != TagHT.begin())
+      return  ItTagHT->second;
+   return NULL;
+}
+
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 5622c19d00370215c9f9c80a53da8581427d9d88..09499ad6f7cad8f345dfdbe94a77b3f918fa9a80 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:37:37 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -57,22 +57,27 @@ public:
 
    DocEntry *GetFirstEntry();
    DocEntry *GetNextEntry();
+   DocEntry *GetLastEntry();
+   DocEntry *GetPreviousEntry();
 
    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
    ValEntry *GetValEntry(uint16_t group, uint16_t elem);
    BinEntry *GetBinEntry(uint16_t group, uint16_t elem);
    SeqEntry *GetSeqEntry(uint16_t group, uint16_t elem);
 
+   bool IsEmpty() { return TagHT.empty(); };
+   bool CheckIfEntryExist(uint16_t group, uint16_t elem);
+   std::string GetEntry(uint16_t group, uint16_t elem);
+
 protected:
-    
+
 private:
 // Variables
    /// Hash Table (map), to provide fast access
    TagDocEntryHT TagHT; 
    /// Hash Table (map) iterator, used to visit the TagHT variable
    TagDocEntryHT::iterator ItTagHT; 
-   friend class Document;
+     
    friend class DicomDir;        //For accessing private TagHT
    friend class DocEntryArchive; //For accessing private TagHT
 };
index 4adfcd303d266e474491c21912091fd480a07701..c3500c8b0d4ad29a2030e1236dc5d6bae246c3b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 12:37:15 $
-  Version:   $Revision: 1.196 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.197 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -45,7 +45,7 @@ File::File( std::string const &filename ):
    // is found by indirection through the "Image Location").
    // Inside the group pointed by "Image Location" the searched element
    // is conventionally the element 0x0010 (when the norm is respected).
-   // When the "Image Location" is Missing we default to group 0x7fe0.
+   // When the "Image Location" is missing we default to group 0x7fe0.
    // Note: this IS the right place for the code
  
    // Image Location
@@ -97,6 +97,8 @@ File::File( std::string const &filename ):
                              GrPixel, NumPixel,
                              PixelVR, "PXL", "Pixel Data");
  
+      // friend class hunting : should we *create* a new entry,
+      // instead of modifying its DictEntry,in order not to use 'friend' ?
       entry->SetDictEntry( newEntry );
    }
 }
@@ -1283,6 +1285,7 @@ bool File::AnonymizeFile()
 
 /**
   * \brief gets the info from 0020,0037 : Image Orientation Patient
+  * (needed to organize DICOM files based on their x,y,z position)
   * @param iop adress of the (6)float aray to receive values
   * @return cosines of image orientation patient
   */
index 106ce066fc70a07788efb35a8cd29d44facb4123..d7d8a6566e3b2b654c0476fa33b3f82df1e18ed2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 12:37:15 $
-  Version:   $Revision: 1.98 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.99 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -140,13 +140,16 @@ public:
    float GetYSpacing();
    float GetZSpacing();
 
-   // Useful for rescaling graylevel:
+   // For rescaling graylevel:
    float GetRescaleIntercept();
    float GetRescaleSlope();
 
    int GetNumberOfScalarComponents();
    int GetNumberOfScalarComponentsRaw();
 
+   // To organize DICOM files based on their x,y,z position 
+   void GetImageOrientationPatient( float iop[6] );
+
    int GetImageNumber();
    ModalityType GetModality();
 
@@ -172,12 +175,8 @@ protected:
    /// Replace patient's specific information by 'anonymous'
    bool AnonymizeFile();
 
-   /// Helper function needed to organize DICOM files based on 
-   /// their x,y,z position
-   void GetImageOrientationPatient( float iop[6] );
-
 private:
-  friend class SerieHeader;
+
 };
 } // end namespace gdcm
 
index 43f6b89be5063d15293831715ba23f98d0256b1e..4c6595a3eaee3fa1b08a1ba2e8a3f75f303ac35e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:55 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  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
@@ -901,7 +901,6 @@ ValEntry *FileHelper::CopyValEntry(uint16_t group,uint16_t elem)
 /**
  * \brief   Modifies the value of a given Bin 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   elem  Element number of the Entry
  * \return  pointer to the modified/created Bin Entry (NULL when creation
index 13134d77e95819fd47f36a419811dad8f8f1f5b6..1906e485c9be7985c9a21f1d58656a0738f59b67 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:55 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -98,7 +98,7 @@ public:
    uint8_t* GetLutRGBA();
 
    // Write mode
-   void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); };
+   void SetWriteModeToRaw()          { SetWriteMode(WMODE_RAW); };
    void SetWriteModeToRGB()          { SetWriteMode(WMODE_RGB); };
    void SetWriteMode(FileMode mode)  { WriteMode = mode; };
    FileMode GetWriteMode()           { return WriteMode; };
@@ -139,7 +139,7 @@ private:
    /// gdcm::File to use to load the file
    File *FileInternal;
 
-   /// \brief Whether the underlying \ref Header was loaded by
+   /// \brief Whether the underlying \ref gdcm::File was loaded by
    ///  the constructor or passed to the constructor. When false
    ///  the destructor is in charge of deletion.
    bool SelfHeader;
index a3a46599e12984cf7965514d5b624e854ea5fc6a..5d8c4e7195124f8fa38fe2d917b2d8935338cbf6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 08:01:41 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.16 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -30,7 +30,7 @@ namespace gdcm
 // used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX
 // you cannot have static initialization in a multithreaded environment
 // since there is a lazy construction everything got skrew up somehow
-// Therefore the actual initiliazation is done in a cxx file (avoid
+// Therefore the actual initialization is done in a cxx file (avoid
 // duplicated symbol), and an extern is used in gdcmCommon.h
 const std::string GDCM_UNKNOWN   = "gdcm::Unknown";
 const std::string GDCM_UNFOUND   = "gdcm::Unfound";
index 3a666cb2f104392befbad6ae0d8a6249b67b26da..ddfaaabd5d55cfed55a3f36191e5f04be58ee2a8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/17 03:05:55 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -38,14 +38,15 @@ JPEGFragmentsInfo::~JPEGFragmentsInfo()
 
 /**
  * \brief        Print self.
- * @param indent Indentation string to be prepended during printing.
  * @param os     Stream to print to.
+ * @param indent Indentation string to be prepended during printing.
  */
-void JPEGFragmentsInfo::Print( std::ostream &os, std::string const & indent )
+void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent )
 {
+   os << std::endl;
    os << indent
       << "----------------- JPEG fragments --------------------------------"
-      << std::endl;
+      << std::endl << std::endl;
    os << indent
       << "Total number of fragments : " << Fragments.size()
       << std::endl;
@@ -57,12 +58,12 @@ void JPEGFragmentsInfo::Print( std::ostream &os, std::string const & indent )
       os << indent
          << "   fragment number :" << fragmentNumber++;
       (*it)->Print( os, indent + "   ");
-      os << std::endl;
    }
+   os << std::endl;
 }
 
 /**
- * \brief  Calculate sum of all fragments lenght and return total
+ * \brief  Calculate sum of all fragments length and return total
  * @return Total size of JPEG fragments length
  */
 size_t JPEGFragmentsInfo::GetFragmentsLength()
index 281eb6967d3886712cbce3cdca6d7ff6e05fabfd..f2bbb902f79f03458cdc5a25e6edb7b564d9f34d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:55 $
-  Version:   $Revision: 1.31 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.32 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -180,8 +180,8 @@ bool PixelReadConvert::DecompressRLE16BitsFromRLE8Bits( int NumberOfFrames )
 /**
  * \brief Implementation of the RLE decoding algorithm for decompressing
  *        a RLE fragment. [refer to PS 3.5-2003, section G.3.2 p 86]
- * @param subRaw Sub region of \ref Raw where the de
- *        decoded fragment should be placed.
+ * @param subRaw Sub region of \ref Raw where the decoded fragment
+ *        should be placed.
  * @param fragmentSize The length of the binary fragment as found on the disk.
  * @param RawSegmentSize The expected length of the fragment ONCE
  *        Raw.
@@ -351,7 +351,7 @@ void PixelReadConvert::ConvertSwapZone()
 }
 
 /**
- * \brief Deal with endianity i.e. re-arange bytes inside the integer
+ * \brief Deal with endianness i.e. re-arange bytes inside the integer
  */
 void PixelReadConvert::ConvertReorderEndianity()
 {
@@ -562,7 +562,7 @@ bool PixelReadConvert::ConvertReArrangeBits() throw ( FormatError )
 }
 
 /**
- * \brief   Convert (Y plane, cB plane, cR plane) to RGB pixels
+ * \brief   Convert (cY plane, cB plane, cR plane) to RGB pixels
  * \warning Works on all the frames at a time
  */
 void PixelReadConvert::ConvertYcBcRPlanesToRGBPixels()
@@ -673,8 +673,8 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp )
    else if ( IsRaw )
    {
       // This problem can be found when some obvious informations are found
-      // after the field containing the image datas. In this case, these
-      // bad datas are added to the size of the image (in the PixelDataLength
+      // after the field containing the image data. In this case, these
+      // bad data are added to the size of the image (in the PixelDataLength
       // variable). But RawSize is the right size of the image !
       if( PixelDataLength != RawSize)
       {
@@ -841,7 +841,7 @@ void PixelReadConvert::GrabInformationsFromHeader( File *header )
       BitsAllocated = 16;
    }
 
-   // Number of "Bits Stored" defaulted to number of "Bits Allocated"
+   // Number of "Bits Stored", defaulted to number of "Bits Allocated"
    // when absent from the header.
    BitsStored = header->GetBitsStored();
    if ( BitsStored == 0 )
@@ -849,7 +849,7 @@ void PixelReadConvert::GrabInformationsFromHeader( File *header )
       BitsStored = BitsAllocated;
    }
 
-   // High Bit Position
+   // High Bit Position, defaulted to "Bits Allocated" - 1
    HighBitPosition = header->GetHighBitPosition();
    if ( HighBitPosition == 0 )
    {
@@ -871,9 +871,13 @@ void PixelReadConvert::GrabInformationsFromHeader( File *header )
      || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRLittleEndian
      || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRBigEndian
      || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::DeflatedExplicitVRLittleEndian;
-   IsJPEG2000     = Global::GetTS()->IsJPEG2000(ts);
-   IsJPEGLossless = Global::GetTS()->IsJPEGLossless(ts);
-   IsRLELossless  =  Global::GetTS()->IsRLELossless(ts);
+
+   IsJPEG2000      = Global::GetTS()->IsJPEG2000(ts);
+   IsJPEGLS        = Global::GetTS()->IsJPEGLS(ts);
+   IsJPEGLossy     = Global::GetTS()->IsJPEGLossy(ts);
+   IsJPEGLossless  = Global::GetTS()->IsJPEGLossless(ts);
+   IsRLELossless   = Global::GetTS()->IsRLELossless(ts);
+
    PixelOffset     = header->GetPixelOffset();
    PixelDataLength = header->GetPixelAreaLength();
    RLEInfo  = header->GetRLEInfo();
@@ -1137,7 +1141,7 @@ void PixelReadConvert::Print( std::ostream &os, std::string const & indent )
       }
    }
 
-   if ( IsJPEG2000 || IsJPEGLossless )
+   if ( IsJPEG2000 || IsJPEGLossless || IsJPEGLossy || IsJPEGLS )
    {
       if ( JPEGInfo )
       {
index 8aceec490fed5604079a64c77ba498bd44d90349..a9839600053cf50dc5af3d8ce7f1de74f3e491e8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:55 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -41,9 +41,9 @@ public:
    virtual ~PixelReadConvert();
 
    //// Getter accessors:
-   uint8_t* GetRGB() { return RGB; }
+   uint8_t* GetRGB()     { return RGB; }
    size_t   GetRGBSize() { return RGBSize; }
-   uint8_t* GetRaw() { return Raw; }
+   uint8_t* GetRaw()     { return Raw; }
    size_t   GetRawSize() { return RawSize; }
    uint8_t* GetLutRGBA() { return LutRGBA; }
 
@@ -118,7 +118,10 @@ private:
 
    bool IsRaw;
    bool IsJPEG2000;
+   bool IsJPEGLS;
    bool IsJPEGLossless;
+   bool IsJPEGLossy;
+   bool IsJPEG;
    bool IsRLELossless;
 
    RLEFramesInfo *RLEInfo;
index 5f97e055c7547f8b4430d97fe3d601892b2482e8..899f816f84e8047ed78399f4cfa27119930b3356 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:19:48 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
 =========================================================================*/
 
-//////////////////   TEMPORARY NOTE
-// look for "fixMem" and convert that to a member of this class
-// Removing the prefix fixMem and dealing with allocations should do the trick
-//
-// grep PixelWriteConvert everywhere and clean up !
-
 #include "gdcmDebug.h"
 #include "gdcmPixelWriteConvert.h"
 
@@ -29,6 +23,8 @@ namespace gdcm
 {
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
+
+/// \brief Construcror
 PixelWriteConvert::PixelWriteConvert() 
 {
    ReadData = 0;
@@ -38,24 +34,40 @@ PixelWriteConvert::PixelWriteConvert()
    UserDataSize = 0;
 }
 
+/// \brief Destructor
 PixelWriteConvert::~PixelWriteConvert() 
 {
 }
 
 //-----------------------------------------------------------------------------
 // Public
+
+/**
+ * \brief   SetReadData
+ * @param   data data
+ * @param   size size
+ */
 void PixelWriteConvert::SetReadData(uint8_t *data,size_t size)
 {
    ReadData = data;
    ReadDataSize = size;
 }
 
+/**
+ * \brief   SetUserData
+ * @param   data data
+ * @param   size size
+ */
 void PixelWriteConvert::SetUserData(uint8_t *data,size_t size)
 {
    UserData = data;
    UserDataSize = size;
 }
 
+/**
+ * \brief   GetData
+ * @return  data 
+ */
 uint8_t *PixelWriteConvert::GetData()
 {
    if(UserData)
@@ -68,6 +80,10 @@ uint8_t *PixelWriteConvert::GetData()
    }
 }
 
+/**
+ * \brief   GetDataSize
+ * @return  size 
+ */
 size_t PixelWriteConvert::GetDataSize()
 {
    if(UserData)
index ec1a6d3de42e8d3b5cfd981fbcd8e3a957c62538..d5683fdf6ea9194fe6129a980b5acf23ac0f055d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/20 11:26:18 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.49 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -50,7 +50,7 @@ SeqEntry::SeqEntry( DictEntry *e )
  * \brief   Constructor from a given SeqEntry
  * @param   e Pointer to existing Doc entry
  * @param   depth depth level of the current Seq entry
 */
+ */
 SeqEntry::SeqEntry( DocEntry *e, int depth )
              : DocEntry( e->GetDictEntry() )
 {
@@ -201,9 +201,10 @@ SQItem *SeqEntry::GetSQItem(int nb)
          return *cc;
       }
    }
-   return *(Items.end()); // Euhhhhh ?!? Is this the last one . FIXME
+   return *(Items.end());
 }
 
+/// \brief retuens the number of SQItems within the current Sequence
 unsigned int SeqEntry::GetNumberOfSQItems()
 {
    return Items.size();
index 392cc548e5c97b9c9d402200cf2370e6fec0f776..348f7e003c496a68942de9b0b5261eeb1fa3afc0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 08:01:42 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.38 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -59,6 +59,10 @@ static const char *SpecialStrings[] =  {
   "1.2.840.10008.1.2.4.57",
   // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
   "1.2.840.10008.1.2.4.70",
+  // JPEG-LS Lossless Image Compression
+  "1.2.840.10008.1.2.4.80",
+  // JPEG-LS Lossy (Near-Lossless) Image Compression
+  "1.2.840.10008.1.2.4.81",
   // JPEG 2000 Lossless
   "1.2.840.10008.1.2.4.90",
   // JPEG 2000
@@ -147,13 +151,24 @@ TSAtr const & TS::GetValue(TSKey const &key)
    }
    return it->second;
 }
-
+/**
+ * \brief   Determines if the key passed corresponds to a 'Transfer Syntax'
+ *          as defined in DICOM (and stored in gdcm::TS class)
+ * @return  True when key is an actual 'Transfer Syntax'. False in all
+ *          other cases.
+ */
 bool TS::IsTransferSyntax(TSKey const &key)
 {
    TSHT::const_iterator it = TsMap.find(key);
    return it != TsMap.end();
 }
 
+/**
+ * \brief   Determines if the Transfer Syntax was already encountered
+ *          and if it corresponds to a Run Length Encoding Lossless one
+ * @return  True when Run Length Encoding Lossless found. False in all
+ *          other cases.
+ */
 bool TS::IsRLELossless(TSKey const &key)
 {
    bool r = false;
@@ -168,6 +183,12 @@ bool TS::IsRLELossless(TSKey const &key)
    return r;
 }
 
+/**
+ * \brief   Determines if the Transfer Syntax was already encountered
+ *          and if it corresponds to a 'classical' JPEG Lossless one
+ * @return  True when 'classical' Lossless found. False in all
+ *          other cases.
+ */
 bool TS::IsJPEGLossless(TSKey const &key)
 {
    bool r = false;
@@ -184,6 +205,28 @@ bool TS::IsJPEGLossless(TSKey const &key)
    return r;
 }
 
+/**
+ * \brief   Determines if the Transfer Syntax was already encountered
+ *          and if it corresponds to a 'classical' JPEG Lossy one
+ * @return  True when 'classical' Lossy found. False in all
+ *          other cases.
+ */
+bool TS::IsJPEGLossy(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[JPEGBaselineProcess1]
+        || key == SpecialStrings[JPEGExtendedProcess2_4]
+        || key == SpecialStrings[JPEGExtendedProcess3_5]
+        || key == SpecialStrings[JPEGSpectralSelectionProcess6_8] )
+      {
+         r = true;
+      }
+   }
+   return r;
+}
 /**
  * \brief   Determines if the Transfer Syntax was already encountered
  *          and if it corresponds to a JPEG2000 one
@@ -206,8 +249,8 @@ bool TS::IsJPEG2000(TSKey const &key)
 }
 
 /**
- * \brief   Determines if the Transfer Syntax corresponds to any form
- *          of Jpeg encoded Pixel data.
+ * \brief   Determines if the Transfer Syntax corresponds to 
+ *          'classical' Jpeg Lossless or Jpeg lossy.
  * @return  True when any form of JPEG found. False otherwise.
  */
 bool TS::IsJPEG(TSKey const &key)
@@ -216,12 +259,9 @@ bool TS::IsJPEG(TSKey const &key)
    // First check this is an actual transfer syntax
    if( IsTransferSyntax(key) )
    {
-      if ( key == SpecialStrings[JPEGBaselineProcess1]
-        || key == SpecialStrings[JPEGExtendedProcess2_4]
-        || key == SpecialStrings[JPEGExtendedProcess3_5]
-        || key == SpecialStrings[JPEGSpectralSelectionProcess6_8]
-        || IsJPEGLossless( key ) 
-        || IsJPEG2000( key ) )
+      if ( IsJPEGLossy( key )
+        || IsJPEGLossless( key )
+         )
       {
          r = true;
       }
@@ -230,18 +270,18 @@ bool TS::IsJPEG(TSKey const &key)
 }
 
 /**
- * \brief   Determines if the Transfer Syntax corresponds to encapsulated
- *          of encoded Pixel Data (as opposed to native).
- * @return  True when encapsulated. False when native.
+ * \brief   Determines if the Transfer Syntax corresponds to any form
+ *          of Jpeg-LS encoded Pixel data.
+ * @return  True when any form of JPEG-LS found. False otherwise.
  */
-bool TS::IsEncapsulate(TSKey const &key)
+bool TS::IsJPEGLS(TSKey const &key)
 {
    bool r = false;
    // First check this is an actual transfer syntax
    if( IsTransferSyntax(key) )
    {
-      if ( key == SpecialStrings[RLELossless]
-        || IsJPEG(key) )
+      if ( key == SpecialStrings[JPEGLSLossless]
+        || key == SpecialStrings[JPEGLSNearLossless] ) 
       {
          r = true;
       }
index 4b6ddc501896e57907b059beedb4d8aa29baf73d..6375a0a4d01fcba492a3da27edbd2c7f0046cc93 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 16:44:43 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  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
@@ -54,7 +54,9 @@ enum SpecialType {
   JPEGFullProgressionProcess10_12,
   JPEGLosslessProcess14,
   JPEGLosslessProcess14_1,
-  JPEG2000Lossless,
+  JPEGLSLossless,
+  JPEGLSNearLossless,
+  JPEG2000Lossless,  
   JPEG2000,
   RLELossless,
   UnknownTS
@@ -71,9 +73,10 @@ public:
    bool IsTransferSyntax(TSKey const &key);
    bool IsRLELossless(TSKey const &key);
    bool IsJPEGLossless(TSKey const&key);
+   bool IsJPEGLossy(TSKey const&key);
    bool IsJPEG2000(TSKey const &key);
    bool IsJPEG(TSKey const &key);
-   bool IsEncapsulate(TSKey const &key);
+   bool IsJPEGLS(TSKey const &key);
 
    // This should be deprecated very soon
    SpecialType GetSpecialTransferSyntax(TSKey const &key);
index 012e1b6c6a6378a1236c8360a3409c7ea60d6315..14b4d52e7622843e2e5a944a81234ed75f9809ea 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/22 23:29:16 $
-  Version:   $Revision: 1.121 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.122 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -328,13 +328,13 @@ std::string Util::DicomString(const char *s, size_t l)
 
 /**
  * \brief Create a /DICOM/ string:
- * It should a of even lenght (no odd length ever)
+ * It should a of even length (no odd length ever)
  * It can contain as many (if you are reading this from your
  * editor the following character is is backslash followed by zero
  * that needed to be escaped with an extra backslash for doxygen) \\0
  * as you want.
  * This function is similar to DicomString(const char*), 
- * except it doesn't take a lenght
+ * except it doesn't take a length
  * It only pad with a null character if length is odd
  */
 std::string Util::DicomString(const char *s)
@@ -351,8 +351,8 @@ std::string Util::DicomString(const char *s)
 
 /**
  * \brief Safely compare two Dicom String:
- *        - Both string should be of even lenght
- *        - We allow padding of even lenght string by either a null 
+ *        - Both string should be of even length
+ *        - We allow padding of even length string by either a null 
  *          character of a space
  */
 bool Util::DicomStringEqual(const std::string &s1, const char *s2)
index 22029469235ee51bf004e43e92d8b82c50e742d6..2c589539a2026cf74977910f46d389c32378933b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/19 15:58:01 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.49 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -62,7 +62,9 @@ ValEntry::~ValEntry ()
 //-----------------------------------------------------------------------------
 // Print
 /**
- * \brief   canonical Printer
+ * \brief   Prints the 'std::string representable' value of ValEntry
+ * @param   os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
  */
 void ValEntry::Print(std::ostream &os, std::string const &)
 {
@@ -173,6 +175,12 @@ void ValEntry::Print(std::ostream &os, std::string const &)
 
 //-----------------------------------------------------------------------------
 // Public
+
+/**
+ * \brief   Sets the std::string representable' value of a ValEntry
+ * @param  val value to set 
+ */
+
 void ValEntry::SetValue(std::string const &val)
 {
    // Integers have a special treatement for their length:
@@ -213,8 +221,10 @@ void ValEntry::SetValue(std::string const &val)
    SetLength(l);
 }
 
-/*
- * \brief   canonical Writer
+/**
+ * \brief   Writes the std::string representable' value of a ValEntry
+ * @param fp already open ofstream pointer
+ * @param filetype type of the file to be written
  */
 void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
 {
@@ -227,7 +237,8 @@ void ValEntry::WriteContent(std::ofstream *fp, FileType filetype)
 
    const VRKey &vr = GetVR();
    unsigned int lgr = GetLength();
-   //std::cout<<std::hex<<GetGroup()<<"|"<<GetElement()<<std::dec<<" : "<<GetReadLength()<<" / "<<GetLength()<<"\n";
+   //std::cout<<std::hex<<GetGroup()<<"|"<<GetElement()
+   //         <<std::dec<<" : "<<GetReadLength()<<" / "<<GetLength()<<"\n";
    if (vr == "US" || vr == "SS")
    {
       // some 'Short integer' fields may be mulivaluated