]> Creatis software - gdcm.git/blobdiff - Example/WriteDicomAsJPEG2000.cxx
Remove obsolet file.
[gdcm.git] / Example / WriteDicomAsJPEG2000.cxx
index ab27c4729493ecb999567b311cbae520de3ec790..d864ea17202ce43ced18be930c858459919cd298 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicomAsJPEG2000.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/12 09:35:38 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2007/06/21 15:01:00 $
+  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
@@ -39,16 +39,16 @@ int main(int argc, char *argv[])
    std::cerr << "Using quality: " << quality << std::endl;
 
 // Step 1 : Create the header of the image
-   //gdcm::File *f = new gdcm::File();
+   //GDCM_NAME_SPACE::File *f = new GDCM_NAME_SPACE::File();
    // gdcm1.3 syntax. Sorry
-   gdcm::File *f = gdcm::File::New();
-   f->SetLoadMode ( gdcm::LD_ALL ); // Load everything
+   GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
+   f->SetLoadMode ( GDCM_NAME_SPACE::LD_ALL ); // Load everything
    f->SetFileName( filename );
    f->Load();
 
-   //gdcm::FileHelper *tested = new gdcm::FileHelper( f );
+   //GDCM_NAME_SPACE::FileHelper *tested = new GDCM_NAME_SPACE::FileHelper( f );
    // gdcm1.3 syntax. Sorry   
-   gdcm::FileHelper *tested = gdcm::FileHelper::New( f );
+   GDCM_NAME_SPACE::FileHelper *tested = GDCM_NAME_SPACE::FileHelper::New( f );
    std::string PixelType = tested->GetFile()->GetPixelType();
    int xsize = f->GetXSize();
    int ysize = f->GetYSize();
@@ -61,9 +61,9 @@ int main(int argc, char *argv[])
 
 // Step 1 : Create the header of the image
 
-//   gdcm::File *fileToBuild = new gdcm::File();
+//   GDCM_NAME_SPACE::File *fileToBuild = new GDCM_NAME_SPACE::File();
    // gdcm1.3 syntax. Sorry !
-   gdcm::File *fileToBuild = gdcm::File::New();
+   GDCM_NAME_SPACE::File *fileToBuild = GDCM_NAME_SPACE::File::New();
    
    std::ostringstream str;
 
@@ -72,12 +72,12 @@ int main(int argc, char *argv[])
    str << xsize;
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0011); // Columns
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0011, "UI"); // Columns
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0011, "US"); // Columns
    str.str("");
    str << ysize;
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0010); // Rows
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0010, "UI"); // Rows
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0010, "US"); // Rows
 
    if(zsize>1)
    {
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
       str << zsize;
       //fileToBuild->InsertValEntry(str.str(),0x0028,0x0008); // Number of Frames
    // gdcm1.3 syntax. Sorry !
-      fileToBuild->InsertEntryString(str.str(),0x0028,0x0008, "UI"); // Number of Frames
+      fileToBuild->InsertEntryString(str.str(),0x0028,0x0008, "IS"); // Number of Frames
    }
    int bitsallocated = f->GetBitsAllocated();
    int bitsstored = f->GetBitsStored();
@@ -104,19 +104,19 @@ int main(int argc, char *argv[])
    str << bitsstored;  
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0101); // Bits Stored   
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0101, "UI"); // Bits Stored
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0101, "US"); // Bits Stored
    str.str("");
    str << highbit;
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0102); // High Bit
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0102, "UI"); // High Bit
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0102, "US"); // High Bit
 
    // Set the pixel representation
    str.str("");
    str << sign;
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0103); // Pixel Representation
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0103, "UI"); // Pixel Representation
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0103, "US"); // Pixel Representation
 
 
    // Set the samples per pixel
@@ -124,12 +124,12 @@ int main(int argc, char *argv[])
    str << samplesPerPixel; //img.components;
    //fileToBuild->InsertValEntry(str.str(),0x0028,0x0002); // Samples per Pixel
    // gdcm1.3 syntax. Sorry !
-   fileToBuild->InsertEntryString(str.str(),0x0028,0x0002, "UI"); // Samples per Pixel
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0002, "US"); // Samples per Pixel
 
 // Step 2 : Create the output image
-   //gdcm::FileHelper *fileH = new gdcm::FileHelper(fileToBuild);
+   //GDCM_NAME_SPACE::FileHelper *fileH = new GDCM_NAME_SPACE::FileHelper(fileToBuild);
    // gdcm1.3 syntax. Sorry !
-   gdcm::FileHelper *fileH = gdcm::FileHelper::New(fileToBuild);
+   GDCM_NAME_SPACE::FileHelper *fileH = GDCM_NAME_SPACE::FileHelper::New(fileToBuild);
    fileH->SetWriteTypeToJPEG2000(  );
    fileH->SetImageData(testedImageData, testedDataSize);
    if( !fileH->Write(outfilename) )