]> Creatis software - gdcm.git/commitdiff
* src/gdcmFile.cxx, gdcmHeader.cxx : bug fix for the msvc compilation
authorregrain <regrain>
Wed, 5 May 2004 09:01:18 +0000 (09:01 +0000)
committerregrain <regrain>
Wed, 5 May 2004 09:01:18 +0000 (09:01 +0000)
     * Test/ShowDicom.cxx : bug fix for msvc compilation
     * vtk/vtkgdcmViewer.cxx : bug fix for msvc compilation
     -- BeNours

ChangeLog
src/gdcmFile.cxx
src/gdcmHeader.cxx
vtk/vtkgdcmViewer.cxx

index 998e80e9ef1ea1458865b7b2e5659cf6a17061da..c2ee06a8f444894ad951996c67d07f81eb0fe78f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,21 +1,25 @@
+2004-05-04 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+     * src/gdcmFile.cxx, gdcmHeader.cxx : bug fix for the msvc compilation
+     * Test/ShowDicom.cxx : bug fix for msvc compilation
+     * vtk/vtkgdcmViewer.cxx : bug fix for msvc compilation
 
 2004-05-04 Jean-Pierre Roux
-   * ADD Taking into account the 'Dicom Sequences' leads up to introduce 
-         new concepts (and new classes) :
-         a 'gdcmDocument' is composed of a set of Doc Entries, that are
-          - elementary gdcmDocEntries (former gdcmHeaderEntries)
-          - Sequence Doc Entries (gdcmSeqEntries)
-         a Sequence is composed of Items.
-         Each item is a set of Doc Entries (this is recursive)    
-         The non uniqueness of the 'Dicom tag' is due to this recursivity
-         (never taken into account)
-         Our unability to add a new 'entry' in the header 
-         at the proper location (neither in the H-Table (map or multimap), 
-        nor in the Chained List is also due to this recursivity.
-         Don't try, right now, to use/modify/compile these new sources : 
-        nothing is finished.
-         We just commit all the stuff, 'as is', in order not to loose it.
-                
+     * ADD Taking into account the 'Dicom Sequences' leads up to introduce
+       new concepts (and new classes) :
+       a 'gdcmDocument' is composed of a set of Doc Entries, that are
+        - elementary gdcmDocEntries (former gdcmHeaderEntries)
+        - Sequence Doc Entries (gdcmSeqEntries)
+       a Sequence is composed of Items.
+       Each item is a set of Doc Entries (this is recursive)
+       The non uniqueness of the 'Dicom tag' is due to this recursivity
+       (never taken into account)
+       Our unability to add a new 'entry' in the header
+       at the proper location (neither in the H-Table (map or multimap),
+       nor in the Chained List is also due to this recursivity.
+       Don't try, right now, to use/modify/compile these new sources :
+       nothing is finished.
+       We just commit all the stuff, 'as is', in order not to loose it.
+
 2004-05-04 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
      * vtk/vtkGdcmReader.cxx : bug fix in the setting of file name
      
index 1e7cf3d4b609ff71bf55594cae99cd2312547d47..607c37ae1bfd2b1e4c0654c4337786b9981324ce 100644 (file)
@@ -92,7 +92,7 @@ gdcmFile::gdcmFile(std::string & filename,
  *          with a FALSE value for the 'enable_sequence' param.
  *          ('public elements' may be embedded in 'shadow Sequences')
  */
- gdcmFile::gdcmFile(const char * filename, 
+ gdcmFile::gdcmFile(const char *filename, 
                    bool exception_on_error,
                    bool enable_sequences, 
                    bool ignore_shadow) {
@@ -261,9 +261,9 @@ size_t gdcmFile::GetImageDataIntoVector (void* destination, size_t MaxSize) {
       return lgrTotale; 
                             
    // from Lut R + Lut G + Lut B
-   unsigned char * newDest = new (unsigned char)[lgrTotale];
-   unsigned char * a       = (unsigned char *)destination;      
-   unsigned char * lutRGBA =                  Header->GetLUTRGBA();
+   unsigned char *newDest = new unsigned char[lgrTotale];
+   unsigned char *a       = (unsigned char *)destination;       
+   unsigned char *lutRGBA =                  Header->GetLUTRGBA();
    if (lutRGBA) {          
       int l = lgrTotaleRaw;
       memmove(newDest, destination, l);// move Gray pixels to temp area            
@@ -352,7 +352,7 @@ void * gdcmFile::GetImageDataRaw (void) {
  * @return  On success, the number of bytes actually copied. Zero on
  *          failure e.g. MaxSize is lower than necessary.
  */
-size_t gdcmFile::GetImageDataIntoVectorRaw (voiddestination, size_t MaxSize) {
+size_t gdcmFile::GetImageDataIntoVectorRaw (void *destination, size_t MaxSize) {
 
    int nb, nbu, highBit, signe;
    std::string str_nbFrames, str_nb, str_nbu, str_highBit, str_signe;
@@ -492,11 +492,11 @@ size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t MaxSize) {
             int l = Header->GetXSize()*Header->GetYSize();
             int nbFrames = Header->GetZSize();
 
-            unsigned char * newDest = new (unsigned char)[lgrTotale];
-            unsigned char *x  = newDest;
-            unsigned char * a = (unsigned char *)destination;
-            unsigned char * b = a + l;
-            unsigned char * c = b + l;
+            unsigned char *newDest = new unsigned char[lgrTotale];
+            unsigned char *x = newDest;
+            unsigned char *a = (unsigned char *)destination;
+            unsigned char *b = a + l;
+            unsigned char *c = b + l;
             double R,G,B;
 
             /// \todo : Replace by the 'well known' integer computation
@@ -533,11 +533,11 @@ size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t MaxSize) {
 
             int l = Header->GetXSize()*Header->GetYSize()*Header->GetZSize();
 
-            char * newDest = new char[lgrTotale];
-            char * x = newDest;
-            char * a = (char *)destination;
-            char * b = a + l;
-            char * c = b + l;
+            char *newDest = new char[lgrTotale];
+            char *x = newDest;
+            char *a = (char *)destination;
+            char *b = a + l;
+            char *c = b + l;
 
             for (int j=0;j<l; j++) {
                *(x++) = *(a++);
@@ -583,7 +583,7 @@ size_t gdcmFile::GetImageDataIntoVectorRaw (void* destination, size_t MaxSize) {
  *
  * @return boolean     
  */
-bool gdcmFile::SetImageData(void * inData, size_t ExpectedSize) {
+bool gdcmFile::SetImageData(void *inData, size_t ExpectedSize) {
    Header->SetImageDataSize(ExpectedSize);
    PixelData = inData;
    lgrTotale = ExpectedSize;
@@ -601,7 +601,7 @@ bool gdcmFile::SetImageData(void * inData, size_t ExpectedSize) {
  */
 
 bool gdcmFile::WriteRawData (std::string fileName) {
-   FILE * fp1;
+   FILE *fp1;
    fp1 = fopen(fileName.c_str(),"wb");
    if (fp1 == NULL) {
       printf("Fail to open (write) file [%s] \n",fileName.c_str());
@@ -635,7 +635,7 @@ bool gdcmFile::WriteDcmImplVR (std::string fileName) {
  * @return false if write fails        
  */
  
-bool gdcmFile::WriteDcmImplVR (const charfileName) {
+bool gdcmFile::WriteDcmImplVR (const char *fileName) {
    return WriteDcmImplVR (std::string (fileName));
 }
        
@@ -684,7 +684,7 @@ bool gdcmFile::WriteAcr (std::string fileName) {
  */
 bool gdcmFile::WriteBase (std::string fileName, FileType type) {
 
-   FILE * fp1;
+   FILE *fp1;
    
    if (PixelRead==-1 && type != ExplicitVR) {
       return false;               
@@ -697,7 +697,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
    }
 
    if ( (type == ImplicitVR) || (type == ExplicitVR) ) {
-      char * filePreamble;
+      char *filePreamble;
       // writing Dicom File Preamble
       filePreamble=new char[128];
       memset(filePreamble,0,128);
@@ -735,7 +735,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
           
    TagKey key = gdcmDictEntry::TranslateToKey(grPixel, numPixel); 
    TagHeaderEntryHT::iterator p2;
-   gdcmHeaderEntry * PixelElement;
+   gdcmHeaderEntry *PixelElement;
    
    IterHT it= Header->GetEntry().equal_range(key); // get a pair of iterators first-last synonym   
 
@@ -785,7 +785,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
  * @param   lgr Area Length
  * @param   nb Pixels Bit number 
  */
-void gdcmFile::SwapZone(voidim, int swap, int lgr, int nb) {
+void gdcmFile::SwapZone(void *im, int swap, int lgr, int nb) {
 guint32 s32;
 guint16 fort,faible;
 int i;
@@ -803,8 +803,8 @@ if(nb == 16)
       case 4321:
 
          for(i=0;i<lgr/2;i++) {
-            ((unsigned short int*)im)[i]= ((((unsigned short int*)im)[i])>>8)
-                                        | ((((unsigned short int*)im)[i])<<8);
+            ((unsigned short int *)im)[i]= ((((unsigned short int *)im)[i])>>8)
+                                        | ((((unsigned short int *)im)[i])<<8);
        }
          break;
                        
@@ -820,32 +820,32 @@ if( nb == 32 )
 
       case 4321:
          for(i=0;i<lgr/4;i++) {
-            faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 4321 */
-            fort  =((unsigned long int*)im)[i]>>16;
+            faible=  ((unsigned long int *)im)[i]&0x0000ffff;    /* 4321 */
+            fort  =((unsigned long int *)im)[i]>>16;
             fort=  (fort>>8)   | (fort<<8);
             faible=(faible>>8) | (faible<<8);
             s32=faible;
-            ((unsigned long int*)im)[i]=(s32<<16)|fort;
+            ((unsigned long int *)im)[i]=(s32<<16)|fort;
          }
          break;
 
       case 2143:
          for(i=0;i<lgr/4;i++) {
-            faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 2143 */
-            fort=((unsigned long int*)im)[i]>>16;
+            faible=  ((unsigned long int *)im)[i]&0x0000ffff;    /* 2143 */
+            fort=((unsigned long int *)im)[i]>>16;
             fort=  (fort>>8)   | (fort<<8);
             faible=(faible>>8) | (faible<<8);
             s32=fort; 
-            ((unsigned long int*)im)[i]=(s32<<16)|faible;
+            ((unsigned long int *)im)[i]=(s32<<16)|faible;
          }
          break;
   
       case 3412:
          for(i=0;i<lgr/4;i++) {
-            faible=  ((unsigned long int*)im)[i]&0x0000ffff;    /* 3412 */
-            fort=((unsigned long int*)im)[i]>>16;                  
+            faible=  ((unsigned long int *)im)[i]&0x0000ffff;    /* 3412 */
+            fort=((unsigned long int *)im)[i]>>16;                  
             s32=faible; 
-            ((unsigned long int*)im)[i]=(s32<<16)|fort;
+            ((unsigned long int *)im)[i]=(s32<<16)|fort;
          }                 
          break; 
                                
@@ -862,7 +862,7 @@ return;
  * @param   destination where the pixel data should be stored.
  *
  */
-bool gdcmFile::ReadPixelData(voiddestination) {
+bool gdcmFile::ReadPixelData(void *destination) {
 
    FILE *fp;
 
@@ -881,7 +881,7 @@ bool gdcmFile::ReadPixelData(void* destination) {
       int nbPixels = Header->GetXSize() * Header->GetYSize();
       unsigned char b0, b1, b2;
       
-      unsigned short intpdestination = (unsigned short int*)destination;    
+      unsigned short int *pdestination = (unsigned short int*)destination;    
       for(int p=0;p<nbPixels;p+=2) {
          fread(&b0,1,1,fp);
          fread(&b1,1,1,fp);
@@ -992,7 +992,7 @@ bool gdcmFile::ReadPixelData(void* destination) {
                   
          JPEGLosslessDecodeImage (fp,  // Reading Fragment pixels
                                     (unsigned short *)destination,
-                                    Header->GetPixelSize()*8* Header->GetSamplesPerPixel(),
+                                    Header->GetPixelSize() * 8 * Header->GetSamplesPerPixel(),
                                      ln);                                                         
          res=1; // in order not to break the loop
   
index f0f68468a31121b32d3504847d2552a699c6704a..8096eb16503fd2d30f4162095497756d87be819b 100644 (file)
@@ -802,7 +802,7 @@ unsigned char * gdcmHeader::GetLUTRGBA(void) {
    } 
    // forge the 4 * 8 Bits Red/Green/Blue/Alpha LUT 
    
-   unsigned char *LUTRGBA = new (unsigned char)[1024]; // 256 * 4 (R, G, B, Alpha) 
+   unsigned char *LUTRGBA = new unsigned char[1024]; // 256 * 4 (R, G, B, Alpha) 
    if (!LUTRGBA) {
       return NULL;
    }
index b9caec87947b68c0ffdcc00c532a9ed525e23b12..ff1e6099b46f63a0a0b4b3b1dc0e1447ad4c7367 100644 (file)
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
   reader->Update();
   
   //print debug info:
-  reader->GetOutput()->Print( std::cout );
+  reader->GetOutput()->Print( cout );
         
   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();