]> Creatis software - gdcm.git/blobdiff - Testing/TestWriteSimple.cxx
Don't write 'Zero length' Sequences.
[gdcm.git] / Testing / TestWriteSimple.cxx
index 3bb432b8f78957386fad2087e84b2a9e83a2e9c7..3c0dbafd6a00afa8046f38a916f90745a72ac07e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestWriteSimple.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/25 16:43:46 $
-  Version:   $Revision: 1.43 $
+  Date:      $Date: 2005/10/28 13:16:48 $
+  Version:   $Revision: 1.46 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -45,56 +45,59 @@ typedef struct
 } Image;
 
 Image Images [] = {
-   {256, 256, 1, 1, 8,  8,  0, 'a'},
-   {256, 256, 1, 1, 8,  8,  0, 'e'},
-   {256, 256, 1, 1, 8,  8,  0, 'i'},
-   {512, 256, 1, 1, 8,  8,  0, 'a'},
-   {512, 256, 1, 1, 8,  8,  0, 'e'},
-   {512, 256, 1, 1, 8,  8,  0, 'i'},
-
-   {256, 512, 1, 1, 8,  8,  0, 'a'},
-   {256, 512, 1, 1, 8,  8,  0, 'e'},
-   {256, 512, 1, 1, 8,  8,  0, 'i'},
-
-   {256, 512, 1, 1, 16, 16, 0, 'a'},
-   {256, 512, 1, 1, 16, 16, 0, 'e'},
-   {256, 512, 1, 1, 16, 16, 0, 'i'},
-   {256, 512, 1, 1, 16, 16, 0, 'a'},
-   {256, 512, 1, 1, 16, 16, 0, 'e'},
-   {256, 512, 1, 1, 16, 16, 0, 'i'},
-
-   {512, 256, 10, 1, 8, 8,  0, 'a'},
-   {512, 256, 10, 1, 8, 8,  0, 'e'},
-   {512, 256, 10, 1, 8, 8,  0, 'i'},
-   {512, 256, 10, 3, 8, 8,  0, 'a'},
-   {512, 256, 10, 3, 8, 8,  0, 'e'},
-   {512, 256, 10, 3, 8, 8,  0, 'i'},
-
-   {256, 256, 1, 1, 8,  8,  1, 'a'},
-   {256, 256, 1, 1, 8,  8,  1, 'e'},
-   {256, 256, 1, 1, 8,  8,  1, 'i'},
-
-   {512, 256, 1, 1, 8,  8,  1, 'a'},
-   {512, 256, 1, 1, 8,  8,  1, 'e'},
-   {512, 256, 1, 1, 8,  8,  1, 'i'},
-
-   {256, 512, 1, 1, 8,  8,  1, 'a'},
-   {256, 512, 1, 1, 8,  8,  1, 'e'},
-   {256, 512, 1, 1, 8,  8,  1, 'i'},
-
-   {256, 512, 1, 1, 16, 16, 1, 'a'},
-   {256, 512, 1, 1, 16, 16, 1, 'e'},
-   {256, 512, 1, 1, 16, 16, 1, 'i'},
-   {256, 512, 1, 1, 16, 16, 1, 'a'},
-   {256, 512, 1, 1, 16, 16, 1, 'e'},
-   {256, 512, 1, 1, 16, 16, 1, 'i'},
-
-   {512, 256, 10, 1, 8, 8,  1, 'a'},
-   {512, 256, 10, 1, 8, 8,  1, 'e'},
-   {512, 256, 10, 1, 8, 8,  1, 'i'},
-   {512, 256, 10, 3, 8, 8,  1, 'a'},
-   {512, 256, 10, 3, 8, 8,  1, 'e'},
-   {512, 256, 10, 3, 8, 8,  1, 'i'},
+
+   {128, 128, 1, 1, 8,  8,  0, 'e'},
+   {256, 128, 1, 1, 8,  8,  0, 'e'},
+   {128, 128, 1, 1, 16, 16, 0, 'e'},      
+   {128, 256, 1, 1, 16, 16, 0, 'e'},   
+        
+   {128, 128, 1, 1, 8,  8,  0, 'i'},
+   {256, 128, 1, 1, 8,  8,  0, 'i'},
+   {256, 128, 1, 1, 8,  8,  0, 'a'},
+   {128, 128, 1, 1, 8,  8,  0, 'a'},
+   
+   {128, 256, 1, 1, 8,  8,  0, 'e'},
+   {128, 256, 1, 1, 8,  8,  0, 'i'},
+   {128, 256, 1, 1, 8,  8,  0, 'a'},
+   
+   {128, 256, 1, 1, 16, 16, 0, 'i'},
+   {128, 256, 1, 1, 16, 16, 0, 'i'},
+   {128, 256, 1, 1, 16, 16, 0, 'a'},
+   {128, 256, 1, 1, 16, 16, 0, 'a'},  
+
+   {256, 128, 10, 1, 8, 8,  0, 'e'},
+   {256, 128, 10, 3, 8, 8,  0, 'e'},
+   {256, 128, 10, 3, 8, 8,  0, 'i'},
+   {256, 128, 10, 1, 8, 8,  0, 'i'},
+   {256, 128, 10, 1, 8, 8,  0, 'a'},
+   {256, 128, 10, 3, 8, 8,  0, 'a'},
+      
+   {128, 128, 1, 1, 8,  8,  1, 'e'},
+   {128, 128, 1, 1, 8,  8,  1, 'i'},
+   {128, 128, 1, 1, 8,  8,  1, 'a'},
+   
+   {256, 128, 1, 1, 8,  8,  1, 'e'},
+   {256, 128, 1, 1, 8,  8,  1, 'i'},
+   {256, 128, 1, 1, 8,  8,  1, 'a'},
+   
+   {128, 256, 1, 1, 8,  8,  1, 'a'},
+   {128, 256, 1, 1, 8,  8,  1, 'e'},
+   {128, 256, 1, 1, 8,  8,  1, 'i'},
+
+   {128, 256, 1, 1, 16, 16, 1, 'e'},
+   {128, 256, 1, 1, 16, 16, 1, 'e'},
+   {128, 256, 1, 1, 16, 16, 1, 'i'},
+   {128, 256, 1, 1, 16, 16, 1, 'i'},
+   {128, 256, 1, 1, 16, 16, 1, 'a'},
+   {128, 256, 1, 1, 16, 16, 1, 'a'},     
+
+   {256, 128, 10, 1, 8, 8,  1, 'e'},
+   {256, 128, 10, 1, 8, 8,  1, 'i'},
+   {256, 128, 10, 1, 8, 8,  1, 'a'},   
+   
+   {256, 128, 10, 3, 8, 8,  1, 'e'},
+   {256, 128, 10, 3, 8, 8,  1, 'i'},
+   {256, 128, 10, 3, 8, 8,  1, 'a'},
    {0,   0,   1,  1, 8, 8,  0, 'i'} // to find the end
 };
 
@@ -113,8 +116,7 @@ int WriteSimple(Image &img)
    gdcm::FileHelper *fileH = gdcm::FileHelper::New();
  
  //  Get the (empty) image header.  
-   gdcm::File *fileToBuild = fileH->GetFile()
-   ;
+   gdcm::File *fileToBuild = fileH->GetFile();
    std::ostringstream str;
 
    // Set the image size
@@ -361,7 +363,6 @@ int WriteSimple(Image &img)
 
    std::cout << "OK" << std::endl;
 
-   fileToBuild->Delete();
    fileH->Delete();
    reread->Delete();
    delete[] imageData;