]> Creatis software - gdcm.git/commitdiff
ENH: Several change, fix compilation warnings, and update to newer API...no comment
authormalaterre <malaterre>
Tue, 18 Oct 2005 19:06:28 +0000 (19:06 +0000)
committermalaterre <malaterre>
Tue, 18 Oct 2005 19:06:28 +0000 (19:06 +0000)
Example/WriteDicomAsJPEG.cxx
Testing/TestDataEntry.cxx
src/gdcmJpeg.cxx

index dbdd5aa1ebe7360854f078cd51d5a356a01ab475..934542a67f45155a51fe12aceaade1c2086fcdc0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicomAsJPEG.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 18:36:53 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/10/18 19:06:28 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -172,11 +172,12 @@ bool CreateOneFrame (std::ostream *fp, void *input_buffer, int fragment_size,
 // Open a dicom file and compress it as JPEG stream
 int main(int argc, char *argv[])
 {
+  if( argc < 2)
+    return 1;
+
   std::string filename = argv[1];
 
 // Step 1 : Create the header of the image
-   gdcm::File *header = new gdcm::File();
-
    gdcm::File *f = new gdcm::File();
    f->SetLoadMode ( gdcm::LD_ALL ); // Load everything
    f->SetFileName( filename );
@@ -208,6 +209,7 @@ int main(int argc, char *argv[])
       return 1;
    }
    std::streambuf* sb = of->rdbuf();
+   (void)sb;
    //of->close();
    std::ofstream out("/tmp/jpeg2.jpg");
    //out.write( of->str(), of
@@ -228,44 +230,44 @@ int main(int argc, char *argv[])
    // Set the image size
    str.str("");
    str << xsize;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0011); // Columns
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0011); // Columns
    str.str("");
    str << ysize;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0010); // Rows
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0010); // Rows
 
    //if(img.sizeZ>1)
    //{
    //   str.str("");
    //   str << img.sizeZ;
-   //   fileToBuild->InsertValEntry(str.str(),0x0028,0x0008); // Number of Frames
+   //   fileToBuild->InsertEntryString(str.str(),0x0028,0x0008); // Number of Frames
    //}
 
    // Set the pixel type
    str.str("");
    str << 8; //img.componentSize;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0100); // Bits Allocated
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0100); // Bits Allocated
 
    str.str("");
    str << 8; //img.componentUse;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0101); // Bits Stored
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0101); // Bits Stored
 
    str.str("");
    str << 7; //( img.componentSize - 1 );
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0102); // High Bit
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0102); // High Bit
 
    // Set the pixel representation
    str.str("");
    str << 0; //img.sign;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0103); // Pixel Representation
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0103); // Pixel Representation
 
    // Set the samples per pixel
    str.str("");
    str << samplesPerPixel; //img.components;
-   fileToBuild->InsertValEntry(str.str(),0x0028,0x0002); // Samples per Pixel
+   fileToBuild->InsertEntryString(str.str(),0x0028,0x0002); // Samples per Pixel
 
    str.str("");
    str << "1.2.840.10008.1.2.4.50";
-   fileToBuild->InsertValEntry(str.str(),0x0002,0x0010); // Transfer Syntax UID
+   fileToBuild->InsertEntryString(str.str(),0x0002,0x0010); // Transfer Syntax UID
 
 // Step 2 : Create the output image
 //   std::cout << "2...";
index b9b2e54203a7d22dbccee0e1c0bf63c26185165f..c6fc0d312f2eb54d4bb0d0b32e153021f0499775 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDataEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 08:35:46 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/10/18 19:06:29 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -33,9 +33,8 @@ unsigned long nbvalue = 5;
 /**
   * \brief Test the DataEntry object
   */  
-int TestDataEntry(int argc, char *argv[])
+int TestDataEntry(int , char *[])
 {
-   unsigned int error = 0;
    gdcm::DictEntry *dict;
    gdcm::DataEntry *entry;
 
index 3edb58af2b46d2b733750d58ea80927a45232af5..7cfee75fc209001b1a585f4611f27e012f92ca5a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 18:39:49 $
-  Version:   $Revision: 1.50 $
+  Date:      $Date: 2005/10/18 19:06:30 $
+  Version:   $Revision: 1.51 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -108,6 +108,7 @@ bool gdcm_write_JPEG_file (std::ostream *fp, void *im_buf,
  //
  // }
   assert( 0 );
+  (void)fp;
   //jpeg_stdio_dest(&cinfo, fp, 0, 0, image_width, image_height, quality);
 
   /* Step 3: set parameters for compression */