Program: gdcm
Module: $RCSfile: exConvert3DplusT.cxx,v $
Language: C++
- Date: $Date: 2006/09/01 13:42:02 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2007/06/21 15:06:13 $
+ 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
// ----- Initialize Arguments Manager ------
- gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv);
+ GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
if (am->ArgMgrDefined("usage") || argc == 1)
{
}
if (am->ArgMgrDefined("debug"))
- gdcm::Debug::DebugOn();
+ GDCM_NAME_SPACE::Debug::DebugOn();
int verbose = am->ArgMgrDefined("verbose");
int oververbose = am->ArgMgrDefined("oververbose");
int nbOfImagesInVolume = am->ArgMgrGetInt("imagesinvolume",
imagetteLineNumber*imagetteRowNumber);
- int loadMode = gdcm::LD_ALL;
+ int loadMode = GDCM_NAME_SPACE::LD_ALL;
if ( am->ArgMgrDefined("noshadowseq") )
- loadMode |= gdcm::LD_NOSHADOWSEQ;
+ loadMode |= GDCM_NAME_SPACE::LD_NOSHADOWSEQ;
else
{
if ( am->ArgMgrDefined("noshadow") )
- loadMode |= gdcm::LD_NOSHADOW;
+ loadMode |= GDCM_NAME_SPACE::LD_NOSHADOW;
if ( am->ArgMgrDefined("noseq") )
- loadMode |= gdcm::LD_NOSEQ;
+ loadMode |= GDCM_NAME_SPACE::LD_NOSEQ;
}
/* if unused Param we give up */
//std::cout << "dirIn [" << dirIn << "]" << std::endl;
- if ( ! gdcm::DirList::IsDirectory(dirIn) )
+ if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirIn) )
{
std::cout << "KO : [" << dirIn << "] is not a Directory." << std::endl;
return 0;
if (verbose)
std::cout << "Check for output directory :[" << dirOut << "]."
<<std::endl;
- if ( ! gdcm::DirList::IsDirectory(dirOut) ) // dirout not found
+ if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirOut) ) // dirout not found
{
systemCommand = "mkdir " +strDirNameout; // create it!
if (verbose)
std::cout << systemCommand << std::endl;
system (systemCommand.c_str());
- if ( ! gdcm::DirList::IsDirectory(dirOut) ) // be sure it worked
+ if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirOut) ) // be sure it worked
{
std::cout << "KO : not a dir : [" << dirOut
<< "] (creation failure ?)" << std::endl;
<< "] already exists; Used as is." << std::endl;
}
- gdcm::DirList dirList(dirIn,false); // gets (at single level) the file list
- gdcm::DirListType fileList = dirList.GetFilenames();
+ GDCM_NAME_SPACE::DirList dirList(dirIn,false); // gets (at single level) the file list
+ GDCM_NAME_SPACE::DirListType fileList = dirList.GetFilenames();
// hope sorting on the filename is enough!
// anyway, *no* filed is available to perform anything more clever.
// adding new Series to an already existing Study
std::string strStudyUID;
if ( !userDefinedStudy)
- strStudyUID = gdcm::Util::CreateUniqueUID();
+ strStudyUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
else
strStudyUID = studyUID;
std::string strSerieUID;
if ( !userDefinedSerie)
- strSerieUID = gdcm::Util::CreateUniqueUID();
+ strSerieUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
else
strSerieUID = serieUID;
memset(imageTable, 0, totalNumberOfPixels * imagePixelSize);
int16_t **tabImageData = new int16_t *[nbOfImagesInVolume];
- gdcm::File **f = new gdcm::File *[nbOfImagesInVolume];
- gdcm::FileHelper **fh = new gdcm::FileHelper *[nbOfImagesInVolume];
+ GDCM_NAME_SPACE::File **f = new GDCM_NAME_SPACE::File *[nbOfImagesInVolume];
+ GDCM_NAME_SPACE::FileHelper **fh = new GDCM_NAME_SPACE::FileHelper *[nbOfImagesInVolume];
std::string fullFilename, lastFilename;
float zPositionComponent = 0.0;
int imageNumber = 0;
- for( gdcm::DirListType::iterator it = fileList.begin();
+ for( GDCM_NAME_SPACE::DirListType::iterator it = fileList.begin();
it != fileList.end();
++it )
{
fullFilename = *it;
- f[imageNumber] = gdcm::File::New( );
+ f[imageNumber] = GDCM_NAME_SPACE::File::New( );
f[imageNumber]->SetLoadMode(loadMode);
f[imageNumber]->SetFileName( it->c_str() );
// Load the pixels in RAM.
- fh[imageNumber] = gdcm::FileHelper::New(f[imageNumber]);
+ fh[imageNumber] = GDCM_NAME_SPACE::FileHelper::New(f[imageNumber]);
// Don't convert (Gray Pixels + LUT) into (RGB pixels) ?!?
tabImageData[imageNumber] = (int16_t *)fh[imageNumber]->GetImageDataRaw();
// ==================================================================================================
fh[imageNumber]->SetWriteTypeToDcmExplVR();
- fh[imageNumber]->SetContentType(gdcm::UNMODIFIED_PIXELS_IMAGE);
+ fh[imageNumber]->SetContentType(GDCM_NAME_SPACE::UNMODIFIED_PIXELS_IMAGE);
- lastFilename = gdcm::Util::GetName( fullFilename );
- std::string fullWriteFilename = strDirNameout + gdcm::GDCM_FILESEPARATOR
+ lastFilename = GDCM_NAME_SPACE::Util::GetName( fullFilename );
+ std::string fullWriteFilename = strDirNameout + GDCM_NAME_SPACE::GDCM_FILESEPARATOR
+ lastFilename;
if (verbose)
std::cout << "Write : [" << fullWriteFilename << "]" << std::endl;