Program: gdcm
Module: $RCSfile: exExtractOverlaysACR.cxx,v $
Language: C++
- Date: $Date: 2007/09/14 08:23:34 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2007/10/30 09:15:57 $
+ 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
START_USAGE(usage)
" \n exExtractOverlaysACR :\n ",
" Extract ACR-NEMA style overlays from an image ",
- " usage: exExtractOverlaysACR filein=inputFileName [debug] ",
+ " Resulting image name(s) are postpended with .ovly.dcm ",
+ " usage: exExtractOverlaysACR filein=inputFileName [debug] [warning] ",
+ " warning : user wants to run the program in 'warning mode' ",
" debug : developper wants to run the program in 'debug mode' ",
FINISH_USAGE
// ----- Initialize Arguments Manager ------
-
+
GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
if (argc == 1 || am->ArgMgrDefined("usage"))
if (am->ArgMgrDefined("debug"))
GDCM_NAME_SPACE::Debug::DebugOn();
-
+
if (am->ArgMgrDefined("warning"))
GDCM_NAME_SPACE::Debug::WarningOn();
-
+
// if unused Param we give up
if ( am->ArgMgrPrintUnusedLabels() )
{
delete am; // we don't need Argument Manager any longer
- // ========================== Now, we can do the job! ================
+ // ========================== Now, we can do the job! ================
GDCM_NAME_SPACE::File *f;
f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW);
f->SetFileName( fileName );
- bool res = f->Load();
-
+ bool res = f->Load();
if (!res) {
std::cout << "Sorry, " << fileName <<" not a gdcm-readable "
}
std::cout << fileName << " is read! " << std::endl;
-
+
// ============================================================
// Load the pixels in memory.
// ============================================================
unsigned int nx = f->GetXSize();
unsigned int ny = f->GetYSize();
- unsigned int nxy=nx*ny;
+ unsigned int nxy=nx*ny;
uint16_t currentOvlGroup;
int i;
if( GDCM_NAME_SPACE::Debug::GetDebugFlag() )
std::cout << "Mask :[" <<std::hex << mask << "]" << std::endl;
- for (int j=0; j<nxy; j++)
+ for (unsigned int j=0; j<nxy; j++)
{
if( GDCM_NAME_SPACE::Debug::GetDebugFlag() )
if (pixels[j] >= 0x1000)// if it contains at least one overlay bit