- // ============================================================
- // Write a new file
- // ============================================================
-
- //
- // No need to load the pixels in memory.
- // File will be overwritten
-
- // Do not remove the commented out lines.
- // They will be usefull in a further program.
- //
-/*
- // Get the Pixels
- fh = gdcm::FileHelper::New(f);
-
- // 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();
-
- if ( imageData == 0 )
- {
- std::cerr << "Sorry, Pixels of" << im->GetEntryString(0x0004, 0x1500) <<" are not "
- << " gdcm-readable." << std::endl
- << "Use AnonymizeNoLoad" << std::endl;
- f->Delete();
- fh->Delete();
- break;
- }
-
- // Since we just Anonymized the file, we *know* no modification
- // was performed on the pixels.
- // The written image will not appear as a 'Secondary Captured image'
- // nor as a DERIVED one
-
- fh->SetContentType(gdcm::UNMODIFIED_PIXELS_IMAGE);
- outputFileName = outputDirName + "/" + im->GetEntryString(0x0004, 0x1500);
- fh->WriteDcmExplVR(outputFileName);
- std::cout <<"End Anonymize" << std::cout;
-
- fh->Delete();
-*/