]> Creatis software - gdcm.git/blobdiff - Example/Anonymize.cxx
Since grid tagging is quote either 'ROW' or 'COL' (nobody can guess it !),
[gdcm.git] / Example / Anonymize.cxx
index 7e33bfa6fc58ef5fb93ad7d41620f00e58d0c3f9..3be4812d6e9609586641a8bb4184ec47f04ed761 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: Anonymize.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/25 14:52:26 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2006/01/02 15:16:38 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
    " \n Anonymize :\n                                                         ",
    " Anonymize a full gdcm-readable Dicom image                               ",
    "          Warning : probably segfaults if pixels are not gdcm readable.   ",
-   "                    Use exAnonymizeNoLoad instead.                        ",
+   "                    Use AnonymizeNoLoad instead.                        ",
    " usage: Anonymize filein=inputFileName fileout=anonymizedFileName[debug]  ",
    "        debug    : user wants to run the program in 'debug mode'          ",
    FINISH_USAGE
@@ -97,7 +97,8 @@ int main(int argc, char *argv[])
    // We need a gdcm::FileHelper, since we want to load the pixels        
    gdcm::FileHelper *fh = gdcm::FileHelper::New(f);
 
-   // (unit8_t DOESN'T mean it's mandatory for the image to be a 8 bits one) 
+   // unit8_t DOESN'T mean it's mandatory for the image to be a 8 bits one !
+   // Feel free to cast if you know it's not. 
 
    uint8_t *imageData = fh->GetImageData();
 
@@ -125,7 +126,7 @@ int main(int argc, char *argv[])
    // Telephone
    f->AddAnonymizeElement(0x0010, 0x2154, "3615" );
 
-   // Aware user will add more fields to anonymize here
+   // Aware user will add here more fields to anonymize here
 
    // The gdcm::File is modified in memory
 
@@ -134,7 +135,12 @@ int main(int argc, char *argv[])
    // ============================================================
    //   Write a new file
    // ============================================================
-
+   
+   // Since we just Anonymized the file, we know no modification 
+   // was performed on the pixels.
+   // We don't want this image appears as a 'Secondary Captured image'
+   fh->SetKeepMediaStorageSOPClassUID(true);
+   
    fh->WriteDcmExplVR(outputFileName);
    std::cout <<"End Anonymize" << std::cout;