Program: gdcm
Module: $RCSfile: PatchHeader.cxx,v $
Language: C++
- Date: $Date: 2005/08/28 17:10:49 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2005/10/25 14:52:27 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// and re-write with a right value.
// This program does the job by brutally overwritting the wrong values.
// It may be usefull to save a set of images ...
-// (It dosn't allow to *add* a missing field)
+// (It doesn't allow to *add* a missing field)
// ------------------------------------------------------------------------
// global variables will be seen inside any function.
uint16_t highbit;
uint16_t pixelrepresentation;
-bool bsamplesperpixel;
-bool bplanarconfiguration;
-bool bsize;
-bool brows;
-bool bcolumns;
-bool bplanes;
-bool bbitsallocated;
-bool bbitsstored;
-bool bhighbit;
-bool bpixelrepresentation;
+int bsamplesperpixel;
+int bplanarconfiguration;
+int bsize;
+int brows;
+int bcolumns;
+int bplanes;
+int bbitsallocated;
+int bbitsstored;
+int bhighbit;
+int bpixelrepresentation;
void update()
{
return 0;
}
-bsamplesperpixel = am->ArgMgrDefined("samplesperpixel");
+ bsamplesperpixel = am->ArgMgrDefined("samplesperpixel");
if ( bsamplesperpixel )
samplesperpixel = am->ArgMgrWantInt("samplesperpixel",usage);
if (am->ArgMgrDefined("debug"))
gdcm::Debug::DebugOn();
- int loadMode = 0x00000000;
+ int loadMode = gdcm::LD_ALL;
if ( am->ArgMgrDefined("noshadowseq") )
- loadMode |= NO_SHADOWSEQ;
+ loadMode |= gdcm::LD_NOSHADOWSEQ;
else
{
- if ( am->ArgMgrDefined("noshadow") )
- loadMode |= NO_SHADOW;
+ if ( am->ArgMgrDefined("noshadow") )
+ loadMode |= gdcm::LD_NOSHADOW;
if ( am->ArgMgrDefined("noseq") )
- loadMode |= NO_SEQ;
+ loadMode |= gdcm::LD_NOSEQ;
}
/* if unused Param we give up */
if ( fileName != 0 ) // ====== Deal with a single file ======
{
-
- //
- // Parse the input file.
- //
-
- f = new gdcm::File( );
+ //
+ // Parse the input file.
+ //
+ f = gdcm::File::New( );
f->SetLoadMode(loadMode);
f->SetFileName( fileName );
bool res = f->Load();
// not only gdcm::File (as opposed to gdcm::DicomDir)
if ( !res )
{
- std::cout <<std::endl
- << "Sorry, " << fileName <<" not a gdcm-readable "
- << "DICOM / ACR Document"
- << std::endl;
- delete f;
- return 1;
+ std::cout <<std::endl
+ << "Sorry, " << fileName <<" not a gdcm-readable "
+ << "DICOM / ACR Document"
+ << std::endl;
+ f->Delete();
+ return 1;
}
std::cout << fileName << " is readable " << std::endl;
fp->close();
delete fp;
- delete f;
+ f->Delete();
return 0;
}
it != fileList.end();
++it )
{
- f = new gdcm::File( );
+ f = gdcm::File::New( );
f->SetLoadMode(loadMode);
f->SetFileName( it->c_str() );
bool res = f->Load();
if ( !res )
{
- delete f;
+ f->Delete();
continue;
}
fp->close();
delete fp;
- delete f;
- }
+ f->Delete();
+ }
}
return 0;
}