From: jpr Date: Mon, 7 Nov 2005 09:53:53 +0000 (+0000) Subject: Use fh->SetKeepMediaStorageSOPClassUID(true); X-Git-Tag: OpenJPEG.Version1.2~33 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=61f7dc4d582d5de456fc07ea25700df7c2f6320e;p=gdcm.git Use fh->SetKeepMediaStorageSOPClassUID(true); ( Since we just Anonymized/ReWrited the file, we know no modification was performed on the pixels. We don't want this image appears as a 'Secondary Captured image' ) --- diff --git a/Example/Anonymize.cxx b/Example/Anonymize.cxx index 7e33bfa6..63985643 100644 --- a/Example/Anonymize.cxx +++ b/Example/Anonymize.cxx @@ -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: 2005/11/07 09:53:53 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -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; diff --git a/Example/ReWrite.cxx b/Example/ReWrite.cxx index e049bec8..9cdab8e3 100644 --- a/Example/ReWrite.cxx +++ b/Example/ReWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: ReWrite.cxx,v $ Language: C++ - Date: $Date: 2005/10/25 14:52:27 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/11/07 09:53:53 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -160,6 +160,11 @@ int main(int argc, char *argv[]) std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; + // Since we just ReWrite the image, we know no modification + // was performed on the pixels. + // We don't want this image appears as a 'Secondary Captured image' + fh->SetKeepMediaStorageSOPClassUID(true); + switch (mode[0]) { case 'A' :