]> Creatis software - gdcm.git/blobdiff - Example/WriteDicomAsMPEG.cxx
Fix mistypings
[gdcm.git] / Example / WriteDicomAsMPEG.cxx
index 6ee8a2fb9884dea15c6c76c21b4eb493c36168c7..8e106e208886e864556837fc62d0803902684b12 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicomAsMPEG.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/08 16:32:20 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2007/06/21 15:01:00 $
+  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
@@ -33,46 +33,46 @@ int main(int argc, char *argv[])
 
    // Step 1 : Create the header of the image
 
-   gdcm::File *fileToBuild = gdcm::File::New();
+   GDCM_NAME_SPACE::File *fileToBuild = GDCM_NAME_SPACE::File::New();
    std::ostringstream str;
 
    // Set the image size
    str.str("");
    str << xsize;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0011); // Columns
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0011,"US"); // Columns
    str.str("");
    str << ysize;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0010); // Rows
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0010,"US"); // Rows
 
    if(zsize>1)
    {
       str.str("");
       str << zsize;
-      fileToBuild->InsertEntryString(str.str(),0x0028,0x0008); // Number of Frames
+      fileToBuild->InsertEntryString(str.str(),0x0028,0x0008,"IS"); // Number of Frames
    }
 
    // Set the pixel type
    str.str("");
    str << 8; //img.componentSize;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0100); // Bits Allocated
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0100,"US"); // Bits Allocated
 
    str.str("");
    str << 8; //img.componentUse;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0101); // Bits Stored
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0101,"US"); // Bits Stored
 
    str.str("");
    str << 7; //( img.componentSize - 1 );
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0102); // High Bit
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0102,"US"); // High Bit
 
    // Set the pixel representation
    str.str("");
    str << 0; //img.sign;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0103); // Pixel Representation
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0103,"US"); // Pixel Representation
 
    // Set the samples per pixel
    str.str("");
    str << samplesPerPixel; //img.components;
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0002); // Samples per Pixel
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0002,"US"); // Samples per Pixel
 
 // Step 2 : Create the output image
 //   std::cout << "2...";
@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
                * samplesPerPixel /* * img.componentSize / 8*/;
 
    uint8_t *imageData = new uint8_t[size];
-   gdcm::FileHelper *fileH = gdcm::FileHelper::New(fileToBuild);
+   GDCM_NAME_SPACE::FileHelper *fileH = GDCM_NAME_SPACE::FileHelper::New(fileToBuild);
    //fileH->SetImageData(imageData,size);
    std::ifstream mpeg("/tmp/ts.mpg");
    mpeg.seekg(0, std::ios::end);