From: jpr Date: Mon, 22 Aug 2005 11:18:34 +0000 (+0000) Subject: Remove useless exAnonymize.cxx (use Anonymize.cxx) X-Git-Tag: Version1.2.bp~226 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e96e9cdf740e86f08f9a91258606c5adfcd01ddd;p=gdcm.git Remove useless exAnonymize.cxx (use Anonymize.cxx) --- diff --git a/Example/exAnonymize.cxx b/Example/exAnonymize.cxx deleted file mode 100644 index d0672dda..00000000 --- a/Example/exAnonymize.cxx +++ /dev/null @@ -1,118 +0,0 @@ -/*========================================================================= - - Program: gdcm - Module: $RCSfile: exAnonymize.cxx,v $ - Language: C++ - Date: $Date: 2005/07/07 17:31:53 $ - 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 - http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#include "gdcmFile.h" -#include "gdcmFileHelper.h" -#include "gdcmCommon.h" -#include "gdcmDebug.h" - -#include - -int main(int argc, char *argv[]) -{ - gdcm::Debug::DebugOn(); - std::cout << "------------------------------------------------" << std::endl; - std::cout << "Anonymize a full gdcm-readable Dicom image" << std::endl; - std::cout << " Warning : probably segfaults if pixels are not " - << " gdcm readable. Use exAnonymizeNoLoad" << std::endl; - - if( argc < 3 ) - { - std::cerr << "Usage " << argv[0] << " Source image.dcm " - << " Output image.dcm " << std::endl; - return 1; - } - - std::string fileName = argv[1]; - std::string outputFileName = argv[2]; - -// ============================================================ -// Read the input image. -// ============================================================ - - std::cout << argv[1] << std::endl; - - gdcm::File *f = new gdcm::File(); - f->SetLoadMode( 0x00000000); - f->SetFileName( fileName ); - bool res = f->Load(); - - if (!res) { - std::cerr << "Sorry, " << fileName <<" not a gdcm-readable " - << "DICOM / ACR File" - <GetImageData(); - - if ( imageData == 0 ) - { - std::cerr << "Sorry, Pixels of" << fileName <<" are not " - << " gdcm-readable." << std::endl - << "Use exAnonymizeNoLoad" << std::endl; - - return 0; - } - -// ============================================================ -// Choose the fields to anonymize. -// ============================================================ - // Institution name - f->AddAnonymizeElement(0x0008, 0x0080, "Xanadoo"); - // Patient's name - f->AddAnonymizeElement(0x0010, 0x0010, "Fantomas"); - // Patient's ID - f->AddAnonymizeElement( 0x0010, 0x0020,"1515" ); - // Study Instance UID - f->AddAnonymizeElement(0x0020, 0x000d, "9.99.999.9999" ); - // Telephone - f->AddAnonymizeElement(0x0010, 0x2154, "3615" ); - // Aware use will add new fields here - -// The gdcm::File is modified in memory - - f->AnonymizeFile(); - -// ============================================================ -// Write a new file -// ============================================================ - - fh->WriteDcmExplVR(outputFileName); - std::cout <<"End Anonymize" << std::cout; - -// ============================================================ -// Remove the Anonymize list -// ============================================================ - f->ClearAnonymizeList(); - - delete f; - delete fh; - return 0; -} -