Program: gdcm
Module: $RCSfile: BatchUncompress.cxx,v $
Language: C++
- Date: $Date: 2005/12/12 23:46:52 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2007/06/21 15:06:12 $
+ 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
* Someone at some point could update it to have more option, like not copying the private tags,
* sequence...
*/
+
+ // Well ... ReWrite.cxx does the same thing
+
#include "gdcmFile.h"
#include "gdcmFileHelper.h"
#include "gdcmDocument.h"
const char *inputfilename = argv[1];
const char *outputfilename = argv[2];
- gdcm::File *input = new gdcm::File( );
+ GDCM_NAME_SPACE::File *input = new GDCM_NAME_SPACE::File( );
input->SetFileName( inputfilename );
// input->SetLoadMode(loadMode);
input->Load();
if ( input->IsReadable() )
{
- gdcm::FileHelper *output = new gdcm::FileHelper( input );
+ GDCM_NAME_SPACE::FileHelper *output = new GDCM_NAME_SPACE::FileHelper( input );
output->GetImageData(); //EXTREMELY IMPORTANT
//Otherwise ReadPixel == -1 -> the dicom writing fails completely
uint8_t *imageData = output->GetImageData();
output->SetImageData( imageData, dataSize);
+ // lossy compression would be a pixel modification.
+ // uncompress is *not*
+ fh->SetContentType(GDCM_NAME_SPACE::UNMODIFIED_PIXELS_IMAGE);
output->WriteDcmExplVR( outputfilename );
delete output;