]> Creatis software - gdcm.git/commitdiff
ENH: Minor cleanup, still removing stdio.h and co ...
authormalaterre <malaterre>
Fri, 8 Oct 2004 04:52:55 +0000 (04:52 +0000)
committermalaterre <malaterre>
Fri, 8 Oct 2004 04:52:55 +0000 (04:52 +0000)
src/gdcmDocEntry.h
src/gdcmException.cxx
src/gdcmGlobal.cxx
src/gdcmJpeg12.cxx
src/gdcmJpeg2000.cxx
src/gdcmJpeg8.cxx
src/gdcmRLE.cxx

index b704a983a622d229153e621a754cafa45a7518c7..4acd164dbd421bede02f35adfb20948721d81cd3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/07 21:05:39 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2004/10/08 04:52:55 $
+  Version:   $Revision: 1.24 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,7 +21,6 @@
 
 #include "gdcmDictEntry.h"
 #include <iostream>
-#include <stdio.h>
 
 class gdcmHeader;
 class gdcmValEntry;
index 65ceb756c8aef2abb54f0bd43ee1f366cd9da30d..3f6666050182ce14948653b43305022adc4b93d2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmException.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/09/27 08:39:07 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2004/10/08 04:52:55 $
+  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
@@ -19,7 +19,6 @@
 #include "gdcmException.h"
 
 #include <typeinfo>
-#include <stdio.h>
 
 //-----------------------------------------------------------------------------
 // gdcmException
index cc6c279f43d29b32984ac4fcde4b65ebe22f2d43..0229c8edba9a738afa67f594e3da9bf647607a6d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/09/27 08:39:07 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2004/10/08 04:52:55 $
+  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
@@ -18,9 +18,6 @@
 
 #include "gdcmGlobal.h"
 #include "gdcmDebug.h"
-#include <stdio.h>
-#include <ctype.h>   // For isspace
-#include <string.h>  // CLEANME: could this be only string ? Related to Win32 ?
 
 /**
  * \ingroup Globals
@@ -58,9 +55,12 @@ gdcmGlobal gdcmGlob;
  * \ingroup gdcmGlobal
  * \brief   constructor : populates the various H Tables
  */
-gdcmGlobal::gdcmGlobal(void) {
+gdcmGlobal::gdcmGlobal()
+{
    if (VR || TS || Dicts || ddElem)
+   {
       dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated");
+   }
    Dicts  = new gdcmDictSet();
    VR     = new gdcmVR();
    TS     = new gdcmTS();
@@ -71,7 +71,8 @@ gdcmGlobal::gdcmGlobal(void) {
  * \ingroup gdcmGlobal
  * \brief   canonical destructor 
  */
-gdcmGlobal::~gdcmGlobal() {
+gdcmGlobal::~gdcmGlobal()
+{
    delete Dicts;
    delete VR;
    delete TS;
@@ -81,27 +82,31 @@ gdcmGlobal::~gdcmGlobal() {
  * \ingroup gdcmGlobal
  * \brief   returns a pointer to the 'Value Representation Table' 
  */
-gdcmVR *gdcmGlobal::GetVR(void) {
+gdcmVR *gdcmGlobal::GetVR()
+{
    return VR;
 }
 /**
  * \ingroup gdcmGlobal
  * \brief   returns a pointer to the 'Transfert Syntax Table' 
  */
-gdcmTS *gdcmGlobal::GetTS(void) {
+gdcmTS *gdcmGlobal::GetTS()
+{
    return TS;
 }
 /**
  * \ingroup gdcmGlobal
  * \brief   returns a pointer to Dictionaries Table 
  */
-gdcmDictSet *gdcmGlobal::GetDicts(void) {
+gdcmDictSet *gdcmGlobal::GetDicts()
+{
    return Dicts;
 }
 /**
  * \ingroup gdcmGlobal
  * \brief   returns a pointer to the DicomDir related elements Table 
  */
-gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements(void) {
+gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements()
+{
    return ddElem;
 }
index fe30bbb9f1218edb89ea98d72bf0d055a534e541..18d0787c184404ed5ef2fe9c55510928cad76eff 100644 (file)
@@ -1,13 +1,22 @@
-// gdcmJpeg12.cxx
-//-----------------------------------------------------------------------------
-#include <stdio.h>
-#include "gdcmFile.h"
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmJpeg12.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/10/08 04:52:55 $
+  Version:   $Revision: 1.17 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 
-#define BITS_IN_JSAMPLE 12
-
-#ifdef GDCM_DEBUG
-#define GDCM_jpr_DEBUG 0
-#endif   //GDCM_DEBUG
+#include "gdcmFile.h"
 
 /*
  * <setjmp.h> is used for the optional error recovery mechanism shown in
@@ -23,6 +32,7 @@
  */
 
 extern "C" {
+#include <stdio.h>
 #include "src/jpeg/libijg12/jconfig.h"
 #include "src/jpeg/libijg12/jpeglib.h"
 //#include "jconfig12.h"
index f14f6cd0ad36be51c87031a4a2861acd34b1820a..3b0499bef8e1ee69028516968ae113a2c1795b7d 100644 (file)
@@ -1,6 +1,21 @@
-// gdcmJpeg2000.cxx
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmJpeg2000.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/10/08 04:52:55 $
+  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
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 //-----------------------------------------------------------------------------
-#include <stdio.h>
 #include "gdcmFile.h"
 
 //-----------------------------------------------------------------------------
@@ -17,7 +32,7 @@
 bool gdcmFile::gdcm_read_JPEG2000_file (FILE* fp,void* image_buffer) {
    (void)fp;                  //FIXME
    (void)image_buffer;        //FIXME
-   printf("Sorry JPEG 2000 File not yet taken into account\n");
+   std::cout << "Sorry JPEG 2000 File not yet taken into account" << std::endl;
    return false;
 }
 
index 28d0acd17cfabbf2d39082d4363c28a28629fbfd..24b4f9e607fe17113de5b1cdd5e1fc72ab0a79be 100644 (file)
@@ -1,14 +1,22 @@
-// gdcmJpeg.cxx
-//-----------------------------------------------------------------------------
-#include <stdio.h>
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmJpeg8.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/10/08 04:52:55 $
+  Version:   $Revision: 1.2 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 #include "gdcmFile.h"
 
-#define BITS_IN_JSAMPLE 8
-
-#ifdef GDCM_DEBUG
-#define GDCM_jpr_DEBUG 0
-#endif   //GDCM_DEBUG
-
 /*
 DICOM provides a mechanism for supporting the use of JPEG Image Compression 
 through the Encapsulated Format (see PS 3.3 of the DICOM Standard). 
@@ -77,7 +85,7 @@ of the uncompressed pixel data from which the compressed data is derived
  */
 
 extern "C" {
-//#include "jpeglib.h"
+//#include "stdio.h"
 #include "src/jpeg/libijg8/jconfig.h"
 #include "src/jpeg/libijg8/jpeglib.h"
 
index fd2cf2b3151643fe5a553f0899d0da82ce6ea193..229c13a505a396ee195019100ed00efe45c0e260 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLE.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/06 22:31:31 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2004/10/08 04:52:55 $
+  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
@@ -16,9 +16,7 @@
                                                                                 
 =========================================================================*/
 
-#include <stdio.h>
 #include "gdcmFile.h"
-#include <ctype.h>     // For isprint()
 
 #define str2num(str, typeNum) *((typeNum *)(str))
 
@@ -31,7 +29,8 @@
  *            at which the pixel data should be copied 
  * @return    Boolean 
  */
-bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer) {
+bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer)
+{
    char * im = (char *)image_buffer;
    long uncompressedSegmentSize = Header->GetXSize() * Header->GetYSize();
    
@@ -52,7 +51,9 @@ bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer) {
       }
    }
 
-   if (Header->GetBitsAllocated()==16) { // try to deal with RLE 16 Bits
+   if (Header->GetBitsAllocated()==16)
+   {
+      // try to deal with RLE 16 Bits
    
       im = (char *)image_buffer;
          //  need to make 16 Bits Pixels from Low Byte and Hight Byte 'Planes'
@@ -65,8 +66,10 @@ bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer) {
       char * a = (char *)image_buffer;
       char * b = a + l;
 
-      for (int i=0;i<nbFrames;i++) {
-         for (int j=0;j<l; j++) {
+      for (int i=0;i<nbFrames;i++)
+      {
+         for (int j=0;j<l; j++)
+         {
             *(x++) = *(a++);
             *(x++) = *(b++);
          }
@@ -82,7 +85,8 @@ bool gdcmFile::gdcm_read_RLE_file (FILE* fp,void* image_buffer) {
 // ----------------------------------------------------------------------------
 // RLE LossLess Fragment
 int gdcmFile::gdcm_read_RLE_fragment(char** areaToRead, long lengthToDecode, 
-                                     long uncompressedSegmentSize, FILE* fp) {
+                                     long uncompressedSegmentSize, FILE* fp)
+{
    (void)lengthToDecode; //FIXME
    int count;
    long numberOfOutputBytes=0;
@@ -92,14 +96,19 @@ int gdcmFile::gdcm_read_RLE_fragment(char** areaToRead, long lengthToDecode,
    {
       fread(&n,sizeof(char),1,fp);
       count=n;
-      if (count >= 0 && count <= 127) {
+      if (count >= 0 && count <= 127)
+      {
          fread(*areaToRead,(count+1)*sizeof(char),1,fp);
          *areaToRead+=count+1;
          numberOfOutputBytes+=count+1;
-      } else {
-         if (count <= -1 && count >= -127) {
+      }
+      else
+      {
+         if (count <= -1 && count >= -127)
+         {
             fread(&car,sizeof(char),1,fp);
-            for(int i=0; i<-count+1; i++) {
+            for(int i=0; i<-count+1; i++)
+            {
                (*areaToRead)[i]=car;  
             }
             *areaToRead+=(-count+1);