]> Creatis software - gdcm.git/blobdiff - Example/FindTags.cxx
*** empty log message ***
[gdcm.git] / Example / FindTags.cxx
index 83c6e599f1ab073059e64975a55a4207425f9310..38d4b2e4ef238fa7f681d76dcb241a3f467e495f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: FindTags.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 15:03:57 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/01/25 15:44:22 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -15,8 +15,8 @@
      PURPOSE.  See the above copyright notices for more information.
                                                                                 
 =========================================================================*/
+#include "gdcmFileHelper.h"
 #include "gdcmFile.h"
-#include "gdcmHeader.h"
 #include "gdcmUtil.h"
 
 #include <iostream>
@@ -26,14 +26,14 @@ int main(int argc, char* argv[])
 {
    std::string toto, titi;
 
-   gdcm::File  * f1;
+   gdcm::FileHelper *f1;
 
    if(argc > 1 )
-      f1 = new gdcm::File(argv[1]);
+      f1 = new gdcm::FileHelper(argv[1]);
    else  {
       toto = GDCM_DATA_ROOT;
       toto += "/test.acr";
-      f1 = new gdcm::File(toto);
+      f1 = new gdcm::FileHelper(toto);
    }
 
    std::string ManufacturerName="SIEMENS ";
@@ -47,14 +47,14 @@ int main(int argc, char* argv[])
    int dataSize = f1->GetImageDataSize();
    std::cout << "---> pourFindTaggs : dataSize " << dataSize << std::endl;
 
-   f1->SetEntry(RecCode ,0x0008,0x0010);
-   f1->SetEntry(ManufacturerName ,0x0008,0x0070);
+   f1->SetValEntry(RecCode ,0x0008,0x0010);
+   f1->SetValEntry(ManufacturerName ,0x0008,0x0070);
 
 // ImagePositionPatient
-   ImagePositionPatient = f1->GetHeader()->GetEntry(0x0020,0x0032);
+   ImagePositionPatient = f1->GetFile()->GetEntryValue(0x0020,0x0032);
 
 // Image Position (RET)
-   f1->SetEntry(ImagePositionPatient, 0x0020,0x0030);
+   f1->SetValEntry(ImagePositionPatient, 0x0020,0x0030);
 
    sscanf(ImagePositionPatient.c_str(), "%f%c%f%c%f", &x,&c,&y,&c,&z);
 
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
 // Location
    std::string zizi = gdcm::Util::Format("%f",l);
    Location = gdcm::Util::DicomString(zizi.c_str());
-   f1->SetEntry(Location, 0x0020,0x0050);
+   f1->SetValEntry(Location, 0x0020,0x0050);
 
 // sinon, la longueur du champ est erronée (?!?) 
 // Probable sac de noeud entre strlen(xxx.c_str()) et xxx.length()
@@ -79,25 +79,25 @@ int main(int argc, char* argv[])
 // SetEntryLength is private now.
 //TO DO : see is the pb goes on...
 
-//f1->GetHeader()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050);
+//f1->GetFile()->SetEntryLength(strlen(Location.c_str())-1, 0x0020,0x0050);
 
 // Image Location 
 
    zizi = gdcm::Util::Format("%d",0x7FE0);
    ImageLocation = gdcm::Util::DicomString(zizi.c_str());
-//f1->SetEntry(Location, 0x0028,0x0200);
-//f1->GetHeader()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
+//f1->SetValEntry(Location, 0x0028,0x0200);
+//f1->GetFile()->SetEntryLength(strlen(ImageLocation.c_str())-1, 0x0020,0x0050); // prudence !
 
 // void* imageData= f1->GetImageData();
 
-// ecriture d'un fichier ACR à partir d'un dcmHeader correct.
+// ecriture d'un fichier ACR à partir d'un dcmFile correct.
 
    std::cout << "----------------avant PrintEntry---------------------" << std::endl;
-   f1->GetHeader()->Print();
+   f1->GetFile()->Print();
    std::cout << "----------------avant WriteDcm---------------------" << std::endl;
 
 
-// ecriture d'un fichier ACR à partir d'un dcmHeader correct.
+// ecriture d'un fichier ACR à partir d'un dcmFile correct.
 
    zozo = toto + ".acr";
    std::cout << "WriteACR" << std::endl;