]> Creatis software - gdcm.git/commitdiff
2004-03-23 Jean-Pierre Roux
authorjpr <jpr>
Tue, 23 Mar 2004 14:31:32 +0000 (14:31 +0000)
committerjpr <jpr>
Tue, 23 Mar 2004 14:31:32 +0000 (14:31 +0000)
     * FIX Now gdcmFile::SwapZone doesn't seg faults any longer for
           big endian made volumes
     * ENH Now gdcmParser constructor and destructor are protected to forbid
           end user to instanciate class gdcmParser
   (only gdcmHeader and gdcmDicomDir are meaningfull)

ChangeLog
src/gdcmDicomDir.cxx
src/gdcmFile.cxx
src/gdcmParser.h
vtk/vtkGdcmReader.cxx

index 7679be8ebe126b77b05be31d896568bc2869f9cf..107bf87e2f12b09db139bc1ccde3b1d8c58bc063 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+
+2004-03-23  Jean-Pierre Roux
+     * FIX Now gdcmFile::SwapZone doesn't seg faults any longer for 
+           big endian made volumes
+     * ENH Now gdcmParser constructor and destructor are protected to forbid 
+           end user to instanciate class gdcmParser
+          (only gdcmHeader and gdcmDicomDir are meaningfull)
+                  
 2004-03-22 Benoit Regrain
      * FIX : src/gdcmDicomDir.cxx : make windows compilable
      * FIX : gdcmPython/gdcm.i : change gdcmStudy to gdcmDicomDirStudy and
                        of gdcmDicomDirImage::NewImage as empty function.
 
 2004-02-28  Jean-Pierre Roux
-     *ENH add gdcmDicomDir:NewPatient
-          add gdcmDicomDirPatient:NewStudy
-          add gdcmDicomDirStudy:NewSerie
-          add gdcmDicomDirSerie:NewImage
-          to allow making gdcDicomDir object.
-     *ADD PrintDicomDir executable that uses gdcmDicomDir tree-like structure
+<<<<<<< ChangeLog
+     * ENH add gdcmDicomDir:NewPatient
+           add gdcmDicomDirPatient:NewStudy
+           add gdcmDicomDirStudy:NewSerie
+           add gdcmDicomDirSerie:NewImage
+          to allow making gdcDicomDir object.
+     * ADD PrintDicomDir executable that uses gdcmDicomDir tree-like structure
           (as opposite to the gdcmHeader chained list)
 
 2004-02-11 Benoit Regrain
@@ -52,7 +61,7 @@
 
 2004-02-05 Benoit Regrain
      * ENH : add methods in gdcmObject to get the hash table or the list of
-       header entries
+             header entries
      * FIX : wrapping python for ListPatient, ListStudy, ListSerie, ListImage
      * FIX : wrapping python for TagHeaderEntryHT
 
      * bug fix under python
 
 2004-01-16 Jean-Pierre Roux
-     * removal of class gdcmHeaderEntrySet
-     * removal of files gdcmHeaderEntrySet.cxx, gdcmHeaderEntrySet.h
-     * add file gdcmHeader2.cxx
-     * add method gdcmHeader::SetPrintLevel (for PrintHeader)
+    * REM removal of class gdcmHeaderEntrySet
+    * REM removal of files gdcmHeaderEntrySet.cxx, gdcmHeaderEntrySet.h
+    * ADD add file gdcmHeader2.cxx 
+    * ADD add method gdcmHeader::SetPrintLevel (for PrintHeader)
 
 2004-01-15 Benoit Regrain
      * src/gdcmDicSet.[h|cxx] : add virtual entries to have a reference of
      * Update Windows projects and .cvsignore files
 
 2003-11-12 Jean-Pierre Roux
-     *ENH  gdcmHeader constructor has one more parameter (default value : false)
+     * ENH  gdcmHeader constructor has one more parameter (default value : false)
            that allows the user to 'go inside' the SeQuences only
            if he wants to.
            gdcmElValSet:Print takes it into account
 
 2003-11-12  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     *ENH: Update gdcmPython/CMakeLists
-     *FIX: (gdcmHeaderHelper) GetRescale and GetSlope
-     *FIX: (gdcmElValSet) char 'tag' was overiding private members (VC++)
+     * ENH: Update gdcmPython/CMakeLists
+     * FIX: (gdcmHeaderHelper) GetRescale and GetSlope
+     * FIX: (gdcmElValSet) char 'tag' was overiding private members (VC++)
 
 2003-11-10 Jean-Pierre Roux
-     *FIX : gdcmHeader::LoadElements is now based
-            on the ListTag listElem member,
-            not longer on the TagElValueHT tagHt member
-     *ENH : PrintPubElVal shows (temporarily) both results,
-            with the tagHt member and the listElem member.
-            (it's easier to 'see' the problems when using Printheader)
-     *FIX : old private member LgrElem is now splitted into
-            ReadLength   : Length actually found on disk (updated only
-                      if bug fixing is necessary), for internal use only
-            UsableLength : Updated by FixFoundLength, to fix a bug
-                           or to allow Parser going on.
-            Will allow to re-write a kosher header when a SeQuence
-            with a length (not 0000) is found
-            Warning : gdcmFile::Write still uses the TagHt (not ListElem)
-                      because gdcmElValSet::Add does not update ListElem
-                      (to be written)
+      * FIX : gdcmHeader::LoadElements is now based
+             on the ListTag listElem member,
+             not longer on the TagElValueHT tagHt member
+      * ENH : PrintPubElVal shows (temporarily) both results,
+             with the tagHt member and the listElem member.
+            (it's easier to 'see' the problems when using Printheader)
+
+      * FIX : old private member LgrElem is now splitted into
+             ReadLength   : Length actually found on disk (updated only
+                           if bug fixing is necessary), for internal
+                           use only
+            UsableLength : Updated by FixFoundLength, to fix a bug
+                           or to allow Parser going on.
+            Will allow to re-write a kosher header when a SeQuence
+            with a length (not 0000) is found
+      Warning : gdcmFile::Write still uses the TagHt (not ListElem)
+               because gdcmElValSet::Add does not update ListElem
+               (to be written)
 
 2003-11-07 Jean-Pierre Roux
-     *FIX misstyping in Transfert Syntax name table
-     *ENH gdcmHeader::FixFoundLength now allow to 'go inside' tge SeQuences
+     * FIX misstyping in Transfert Syntax name table
+     * ENH gdcmHeader::FixFoundLength now allow to 'go inside' tge SeQuences
           when they have an actual length (not 0000 nor FFFFF)
      (Nobody should care of it, but DICOMDIR explorers)
 
 2003-11-06  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     *ENH: vtkgdcmViewer now works with LUT dicom (OT-PAL-face ...)
+     * ENH: vtkgdcmViewer now works with LUT dicom (OT-PAL-face ...)
 
 2003-11-05  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     *ENH: vtkGdcmReader now supports LUT !
+     * ENH: vtkGdcmReader now supports LUT !
           (vtkgdcmViewer for now is not able to use them though)
 
 2003-11-05 Jean-Pierre Roux
      * in testSuite.py : new files names for checking the package
-     * Fix : Forgot to commit gdcmFile::GetImageDataSizeRaw();
+     * FIX : Forgot to commit gdcmFile::GetImageDataSizeRaw();
              that returns the pixel area size to the *aware* (vtk) user
              that DOESN'T want to turn the PALETTE COLOR image into an RGB image
 
        in order to loose the 'history' of un-anonymised images
        
 2003-10-31 Jean-Pierre Roux
-     *RMV : removal of useless jBitsInJsample.h 
-            for both 8 and 12 Bits JPEG Lossy Libraries
-      
+     * RMV : removal of useless jBitsInJsample.h 
+           for both 8 and 12 Bits JPEG Lossy Libraries
+
 2003-10-31 Jean-Pierre Roux
      * ENH : Add the functions gdcmFile::GetImageDataRaw 
                                gdcmFile::GetImageDataIntoVectorRaw
      * FIX : a VC++ intended syntax modif broke the 12/12 Bytes expanding
              
 2003-10-29  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     *ENH: Can be used like this '$vtkgdcmViewer *.dcm' with *.dcm 
-           being coherents dicom files.
+     * ENH: Can be used like this '$vtkgdcmViewer *.dcm' with *.dcm 
+          being coherents dicom files.
      
 2003-10-29  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     *FIX: DOH ! Forgot about windo$e users, they couldn't read lossless jpeg,
+     * FIX: DOH ! Forgot about windo$e users, they couldn't read lossless jpeg,
            from medcon lib !
-     *ENH: Turn it into DOS file type to match libgdcmijpeg8.dsp file type 
-     *ENH: Two steps is necessary to please VC++ compiler...
-     *FIX: DOH ! libgdcmijpg8 -> libgdcmljpeg
-     *ENH: Add include dir to medcon lib
-     *FIX: only one function is being exported for now ! 
+     * ENH: Turn it into DOS file type to match libgdcmijpeg8.dsp file type 
+     * ENH: Two steps is necessary to please VC++ compiler...
+     * FIX: DOH ! libgdcmijpg8 -> libgdcmljpeg
+     * ENH: Add include dir to medcon lib
+     * FIX: only one function is being exported for now ! 
            You should use GLOBAL(return type) see ljpg/jpeg.h for more info
             
 2003-10-29 Jean-Pierre Roux
index b109d1efc8fa3882097be3e7e190ed9b701861cc..b74bad25d923d464d552847d8b916b2980120e68 100644 (file)
@@ -23,7 +23,9 @@
 //  For full DICOMDIR description, see:
 //  PS 3.3-2003, pages 731-750
 //-----------------------------------------------------------------------------
+
 // Constructor / Destructor
+
 /*
  * \ingroup gdcmDicomDir
  * \brief   Constructor : Parses recursively the directory and creates the DicomDir
@@ -59,7 +61,7 @@ gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir,
 
    metaElems=NULL;
 
-// gdcmParser already  executed
+// gdcmParser already executed
 // if user passed a root directory, sure we didn't get anything
 
    if( GetListEntry().begin()==GetListEntry().end() ) 
@@ -69,7 +71,7 @@ gdcmDicomDir::gdcmDicomDir(const char *Name, bool parseDir,
 
       if(strlen(Name)==1 && Name[0]=='.') { // user passed '.' as Name
                                             // we get current directory name
-         char*dummy=(char*) malloc(1000);   // TODO : check with Windoze // JPR
+         char*dummy=(char*) malloc(1000);
 #ifdef _MSC_VER
          _getcwd(dummy,(size_t)1000);
 #else
@@ -307,8 +309,7 @@ bool gdcmDicomDir::Write(std::string fileName)
    fwrite(filePreamble,128,1,fp1);
    fwrite("DICM",4,1,fp1);
    free(filePreamble);        
-   //UpdateDirectoryRecordSequenceLength(); // a reecrire en utilisant   JPR
-                                            // la structure arborescente JPR
+   UpdateDirectoryRecordSequenceLength();
    WriteDicomDirEntries(fp1);
 
    fclose(fp1);
index f802dcb86ae9a4515f136e6c9998d89a8ce73e19..62e75550f9a5810e112f8f7deecca5a8f019d27e 100644 (file)
@@ -196,6 +196,7 @@ void * gdcmFile::GetImageData (void) {
    PixelData = (void *) malloc(lgrTotale);
    if (PixelData)
       GetImageDataIntoVector(PixelData, lgrTotale);
+      
    PixelRead=0; // no PixelRaw
    return(PixelData);
 }
@@ -332,7 +333,7 @@ size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t MaxSize) {
    }
        
    (void)ReadPixelData(destination);
-       
+       
        // Number of Bits Allocated for storing a Pixel
    str_nb = Header->GetEntryByNumber(0x0028,0x0100);
    if (str_nb == GDCM_UNFOUND ) {
@@ -378,7 +379,6 @@ size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t MaxSize) {
           deb++;   
          }
     }
-
    // re arange bits inside the bytes
    if (nbu != nb){
       int l = (int)lgrTotale / (nb/8);
@@ -772,9 +772,10 @@ if(nb == 16)
       case 2143:
       case 4321:
 
-         for(i=0;i<lgr;i++)
+         for(i=0;i<lgr/2;i++) {
             ((unsigned short int*)im)[i]= ((((unsigned short int*)im)[i])>>8)
                                         | ((((unsigned short int*)im)[i])<<8);
+       }
          break;
                        
       default:
@@ -788,7 +789,7 @@ if( nb == 32 )
          break;
 
       case 4321:
-         for(i=0;i<lgr;i++) {
+         for(i=0;i<lgr/4;i++) {
             faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 4321 */
             fort  =((unsigned long int*)im)[i]>>16;
             fort=  (fort>>8)   | (fort<<8);
@@ -799,7 +800,7 @@ if( nb == 32 )
          break;
 
       case 2143:
-         for(i=0;i<lgr;i++) {
+         for(i=0;i<lgr/4;i++) {
             faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 2143 */
             fort=((unsigned long int*)im)[i]>>16;
             fort=  (fort>>8)   | (fort<<8);
@@ -810,7 +811,7 @@ if( nb == 32 )
          break;
   
       case 3412:
-         for(i=0;i<lgr;i++) {
+         for(i=0;i<lgr/4;i++) {
             faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 3412 */
             fort=((unsigned long int*)im)[i]>>16;                  
             s32=faible; 
index 8335d9f7362cd97bb85bc6a601635659965e53f7..1a84b010d7cceb1ab54acc6089f5768ce78df04a 100644 (file)
@@ -120,8 +120,9 @@ public:
    guint32 UnswapLong(guint32);  // needed by gdcmFile
 
 protected:
-// constructor and destructor are protected to forbid end user to instanciate
-// class gdcmParser (only gdcmHeader and gdcmDicomDir are meaningfull)
+// constructor and destructor are protected to forbid end user 
+// to instanciate class gdcmParser 
+// (only gdcmHeader and gdcmDicomDir are meaningfull)
    gdcmParser(bool exception_on_error  = false);
    gdcmParser(const char *inFilename, 
               bool  exception_on_error = false, 
index 139623d32626e1a09105180b35f8011271df8928..89ff5dc0dec821835bfda402993df1448c810520 100644 (file)
@@ -593,6 +593,7 @@ size_t vtkGdcmReader::LoadImageInMemory(
    int LineSize   = NumComponents * NumColumns * GdcmFile.GetHeader()->GetPixelSize();
 
    unsigned char * Source;
+   
    if( GdcmFile.GetHeader()->HasLUT() )
    {
       size               = GdcmFile.GetImageDataSizeRaw();
@@ -642,7 +643,6 @@ size_t vtkGdcmReader::LoadImageInMemory(
    }
    //GetImageData allocate a (void*)malloc, remove it:
    free(pSource);
-
    return size;
 }