Building DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
braggpeaks
Posts: 15
Joined: Tue, 2012-04-17, 08:02

Building DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10

#1 Post by braggpeaks »

Hey,

here is a patch to successfully build DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10, tested on Ubuntu 12.10, 13.04 and on Fedora.

Code: Select all

diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diargpxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diargpxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diargpxt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diargpxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -91,7 +91,7 @@
                  const unsigned long planeSize,
                  const int bits)
     {                                             // not very much optimized, but no one really uses ARGB !!
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             register T2 value;
             const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1));
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicmypxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicmypxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicmypxt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicmypxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -87,7 +87,7 @@
                  const unsigned long planeSize,
                  const int bits)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             // use the number of input pixels derived from the length of the 'PixelData'
             // attribute), but not more than the size of the intermediate buffer
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicocpt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicocpt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicocpt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicocpt.h	2013-02-22 22:23:41.102755106 +0100
@@ -86,7 +86,7 @@
     inline void copy(const T *pixel[3],
                      const unsigned long offset)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             for (int j = 0; j < 3; j++)
                 OFBitmanipTemplate<T>::copyMem(pixel[j] + offset, this->Data[j], this->getCount());
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicoflt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicoflt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicoflt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicoflt.h	2013-02-22 22:23:41.103755127 +0100
@@ -98,14 +98,14 @@
                      const int horz,
                      const int vert)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             if (horz && vert)
-                flipHorzVert(pixel, this->Data);
+                this->flipHorzVert(pixel, this->Data);
             else if (horz)
-                flipHorz(pixel, this->Data);
+                this->flipHorz(pixel, this->Data);
             else if (vert)
-                flipVert(pixel, this->Data);
+                this->flipVert(pixel, this->Data);
         }
     }
 };
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicorot.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicorot.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicorot.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicorot.h	2013-02-22 22:23:41.103755127 +0100
@@ -98,14 +98,14 @@
     inline void rotate(const T *pixel[3],
                        const int degree)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             if (degree == 90)
-                rotateRight(pixel, this->Data);
+                this->rotateRight(pixel, this->Data);
             else if (degree == 180)
-                rotateTopDown(pixel, this->Data);
+                this->rotateTopDown(pixel, this->Data);
             else  if (degree == 270)
-                rotateLeft(pixel, this->Data);
+                this->rotateLeft(pixel, this->Data);
         }
     }
 };
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicosct.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicosct.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dicosct.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dicosct.h	2013-02-22 22:23:41.103755127 +0100
@@ -107,8 +107,8 @@
     inline void scale(const T *pixel[3],
                       const int interpolate)
     {
-        if (Init(pixel))
-            scaleData(pixel, this->Data, interpolate);
+        if (this->Init(pixel))
+            this->scaleData(pixel, this->Data, interpolate);
     }
 };
 
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dihsvpxt.h	2013-02-22 22:23:41.103755127 +0100
@@ -87,7 +87,7 @@
                  const unsigned long planeSize,
                  const int bits)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             register T2 *r = this->Data[0];
             register T2 *g = this->Data[1];
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dipalpxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dipalpxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dipalpxt.h	2010-10-14 15:16:29.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dipalpxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -92,7 +92,7 @@
     void convert(const T1 *pixel,
                  DiLookupTable *palette[3])
     {                                                                // can be optimized if necessary !
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             register const T1 *p = pixel;
             register T2 value = 0;
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h	2010-10-14 15:16:30.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/dirgbpxt.h	2013-02-22 22:23:41.103755127 +0100
@@ -87,7 +87,7 @@
                  const unsigned long planeSize,
                  const int bits)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             // use the number of input pixels derived from the length of the 'PixelData'
             // attribute), but not more than the size of the intermediate buffer
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diybrpxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diybrpxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diybrpxt.h	2010-10-14 15:16:30.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diybrpxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -91,7 +91,7 @@
                  const int bits,
                  const OFBool rgb)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1));
             // use the number of input pixels derived from the length of the 'PixelData'
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h	2010-10-14 15:16:30.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diyf2pxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -95,7 +95,7 @@
                  const int bits,
                  const OFBool rgb)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             const T1 offset = OFstatic_cast(T1, DicomImageClass::maxval(bits - 1));
             register unsigned long i;
diff -uNrb ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h
--- ./dcmtk-3.6.0/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h	2010-10-14 15:16:30.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimage/include/dcmtk/dcmimage/diyp2pxt.h	2013-02-22 22:23:41.102755106 +0100
@@ -91,7 +91,7 @@
     void convert(const T1 *pixel,
                  const int bits)
     {
-        if (Init(pixel))
+        if (this->Init(pixel))
         {
             register T2 *r = this->Data[0];
             register T2 *g = this->Data[1];
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/diflipt.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/diflipt.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/diflipt.h	2010-10-14 15:16:26.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/diflipt.h	2013-02-22 22:23:41.083754704 +0100
@@ -129,7 +129,7 @@
             else if (vert)
                 flipVert(src, dest);
             else
-                copyPixel(src, dest);
+                this->copyPixel(src, dest);
         }
     }
 
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h	2010-10-14 15:16:26.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimoflt.h	2013-02-22 22:23:41.084754726 +0100
@@ -106,11 +106,11 @@
             if (this->Data != NULL)
             {
                 if (horz && vert)
-                    flipHorzVert(&pixel, &this->Data);
+                    this->flipHorzVert(&pixel, &this->Data);
                 else if (horz)
-                    flipHorz(&pixel, &this->Data);
+                    this->flipHorz(&pixel, &this->Data);
                 else if (vert)
-                    flipVert(&pixel, &this->Data);
+                    this->flipVert(&pixel, &this->Data);
             }
         }
     }
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h	2010-10-14 15:16:26.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimoipxt.h	2013-02-22 22:23:41.085754747 +0100
@@ -76,10 +76,10 @@
             else if ((this->Modality != NULL) && this->Modality->hasRescaling())
             {
                 rescale(pixel, this->Modality->getRescaleSlope(), this->Modality->getRescaleIntercept());
-                determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue()));
+                this->determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue()));
             } else {
                 rescale(pixel);                     // "copy" or reference pixel data
-                determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue()));
+                this->determineMinMax(OFstatic_cast(T3, this->Modality->getMinValue()), OFstatic_cast(T3, this->Modality->getMaxValue()));
             }
         }
     }
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimorot.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimorot.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimorot.h	2010-10-14 15:16:26.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimorot.h	2013-02-22 22:23:41.085754747 +0100
@@ -105,11 +105,11 @@
             if (this->Data != NULL)
             {
                 if (degree == 90)
-                    rotateRight(&pixel, &(this->Data));
+                    this->rotateRight(&pixel, &(this->Data));
                 else if (degree == 180)
-                    rotateTopDown(&pixel, &(this->Data));
+                    this->rotateTopDown(&pixel, &(this->Data));
                 else if (degree == 270)
-                    rotateLeft(&pixel, &(this->Data));
+                    this->rotateLeft(&pixel, &(this->Data));
             }
         }
     }
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimosct.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimosct.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dimosct.h	2010-10-14 15:16:26.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dimosct.h	2013-02-22 22:23:41.085754747 +0100
@@ -124,7 +124,7 @@
             {
                 const T value = OFstatic_cast(T, OFstatic_cast(double, DicomImageClass::maxval(bits)) *
                     OFstatic_cast(double, pvalue) / OFstatic_cast(double, DicomImageClass::maxval(WIDTH_OF_PVALUES)));
-                scaleData(&pixel, &this->Data, interpolate, value);
+                this->scaleData(&pixel, &this->Data, interpolate, value);
              }
         }
     }
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dirotat.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dirotat.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/dirotat.h	2010-10-14 15:16:27.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/dirotat.h	2013-02-22 22:23:41.083754704 +0100
@@ -132,7 +132,7 @@
         else if (degree == 270)
             rotateLeft(src, dest);
         else
-            copyPixel(src, dest);
+            this->copyPixel(src, dest);
     }
 
 
diff -uNrb ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/discalet.h ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/discalet.h
--- ./dcmtk-3.6.0/dcmimgle/include/dcmtk/dcmimgle/discalet.h	2010-10-14 15:16:27.000000000 +0200
+++ ./dcmtk-3.6.0_p/dcmimgle/include/dcmtk/dcmimgle/discalet.h	2013-02-22 22:23:41.083754704 +0100
@@ -206,12 +206,12 @@
                 (Left >= OFstatic_cast(signed long, Columns)) || (Top >= OFstatic_cast(signed long, Rows)))
             {                                                                         // no image to be displayed
                 DCMIMGLE_DEBUG("clipping area is fully outside the image boundaries");
-                fillPixel(dest, value);                                               // ... fill bitmap
+                this->fillPixel(dest, value);                                               // ... fill bitmap
             }
             else if ((this->Src_X == this->Dest_X) && (this->Src_Y == this->Dest_Y))  // no scaling
             {
                 if ((Left == 0) && (Top == 0) && (Columns == this->Src_X) && (Rows == this->Src_Y))
-                    copyPixel(src, dest);                                             // copying
+                    this->copyPixel(src, dest);                                             // copying
                 else if ((Left >= 0) && (OFstatic_cast(Uint16, Left + this->Src_X) <= Columns) &&
                          (Top >= 0) && (OFstatic_cast(Uint16, Top + this->Src_Y) <= Rows))
                     clipPixel(src, dest);                                             // clipping
@@ -567,7 +567,7 @@
         if ((xtemp == NULL) || (xvalue == NULL))
         {
             DCMIMGLE_ERROR("can't allocate temporary buffers for interpolation scaling");
-            clearPixel(dest);
+            this->clearPixel(dest);
         } else {
             for (int j = 0; j < this->Planes; ++j)
             {
@@ -905,7 +905,7 @@
         if (pTemp == NULL)
         {
             DCMIMGLE_ERROR("can't allocate temporary buffer for interpolation scaling");
-            clearPixel(dest);
+            this->clearPixel(dest);
         } else {
 
             /*
@@ -1029,7 +1029,7 @@
         if (pTemp == NULL)
         {
             DCMIMGLE_ERROR("can't allocate temporary buffer for interpolation scaling");
-            clearPixel(dest);
+            this->clearPixel(dest);
         } else {
 
             /*
diff -uNrb ./dcmtk-3.6.0/ofstd/include/dcmtk/ofstd/ofoset.h ./dcmtk-3.6.0_p/ofstd/include/dcmtk/ofstd/ofoset.h
--- ./dcmtk-3.6.0/ofstd/include/dcmtk/ofstd/ofoset.h	2010-10-14 15:15:50.000000000 +0200
+++ ./dcmtk-3.6.0_p/ofstd/include/dcmtk/ofstd/ofoset.h	2013-02-22 22:23:41.078754598 +0100
@@ -146,7 +146,7 @@
       {
         // if size equals num, we need more space
         if( this->size == this->num )
-          Resize( this->size * 2 );
+          this->Resize( this->size * 2 );
 
         // copy item
         T *newItem = new T( item );
@@ -189,7 +189,7 @@
         {
           // if size equals num, we need more space
           if( this->size == this->num )
-            Resize( this->size * 2 );
+            this->Resize( this->size * 2 );
 
           // copy item
           T *newItem = new T( item );
To run the patch, save the code as "patch.dcmtk-3.6.0", go to the folder that contains the dcmtk-3.6.0 folder and type

Code: Select all

patch -p1 < patch.dcmtk-3.6.0

Code: Select all

mkdir dcmtk-3.6.0-build
cd dcmtk-3.6.0-build
cmake ../dcmtk-3.6.0 -DCMAKE_BUILD_TYPE=RELEASE
make
make install
Thanks to Markus Mehrwald for sharing the patch.

Daniel

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Building DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10

#2 Post by J. Riesmeier »

Thanks, but DCMTK 3.6.0 is already two years old. Using the current development snapshot or the git version should also work :)

braggpeaks
Posts: 15
Joined: Tue, 2012-04-17, 08:02

Re: Building DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10

#3 Post by braggpeaks »

Hey Jörg,

yes, but since we're working in a CE-certified environment, we solely use releases that are declared as stable (although this is no warranty at all).
Is there a public roadmap for upcoming DCMTK releases?

Daniel

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Building DCMTK 3.6.0 with gcc 4.7.2 and CMake 2.8.10

#4 Post by J. Riesmeier »

yes, but since we're working in a CE-certified environment, we solely use releases that are declared as stable (although this is no warranty at all).
Of course, I understand that, but the main intention of my posting was to point out that there have been many fixes like this during the last two years ...
Is there a public roadmap for upcoming DCMTK releases?
Last time, we talked about that was last Friday. The short answer is: No, there is neither a public nor a private roadmap.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest