Program: gdcm
Module: $RCSfile: FlatHashTablePrint.cxx,v $
Language: C++
- Date: $Date: 2005/07/08 12:02:02 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
argv[0] << " input_dicom " << std::endl;
return 1;
}
- gdcm::File *header = new gdcm::File();
+ GDCM_NAME_SPACE::File *header = new GDCM_NAME_SPACE::File();
header->SetFileName(argv[1] );
header->Load();
- gdcm::TagDocEntryHT *Ht = header->BuildFlatHashTable();
+ GDCM_NAME_SPACE::TagDocEntryHT *Ht = header->BuildFlatHashTable();
- for (gdcm::TagDocEntryHT::iterator tag = Ht->begin(); tag != Ht->end(); ++tag)
+ for (GDCM_NAME_SPACE::TagDocEntryHT::iterator tag = Ht->begin(); tag != Ht->end(); ++tag)
{
tag->second->Print();
std::cout << std::endl;
Program: gdcm
Module: $RCSfile: WriteDicomAsJPEG2000.cxx,v $
Language: C++
- Date: $Date: 2006/07/20 17:47:34 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ 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
std::cerr << "Using quality: " << quality << std::endl;
// Step 1 : Create the header of the image
- //gdcm::File *f = new gdcm::File();
+ //GDCM_NAME_SPACE::File *f = new GDCM_NAME_SPACE::File();
// gdcm1.3 syntax. Sorry
- gdcm::File *f = gdcm::File::New();
- f->SetLoadMode ( gdcm::LD_ALL ); // Load everything
+ GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
+ f->SetLoadMode ( GDCM_NAME_SPACE::LD_ALL ); // Load everything
f->SetFileName( filename );
f->Load();
- //gdcm::FileHelper *tested = new gdcm::FileHelper( f );
+ //GDCM_NAME_SPACE::FileHelper *tested = new GDCM_NAME_SPACE::FileHelper( f );
// gdcm1.3 syntax. Sorry
- gdcm::FileHelper *tested = gdcm::FileHelper::New( f );
+ GDCM_NAME_SPACE::FileHelper *tested = GDCM_NAME_SPACE::FileHelper::New( f );
std::string PixelType = tested->GetFile()->GetPixelType();
int xsize = f->GetXSize();
int ysize = f->GetYSize();
// Step 1 : Create the header of the image
-// gdcm::File *fileToBuild = new gdcm::File();
+// GDCM_NAME_SPACE::File *fileToBuild = new GDCM_NAME_SPACE::File();
// gdcm1.3 syntax. Sorry !
- gdcm::File *fileToBuild = gdcm::File::New();
+ GDCM_NAME_SPACE::File *fileToBuild = GDCM_NAME_SPACE::File::New();
std::ostringstream str;
fileToBuild->InsertEntryString(str.str(),0x0028,0x0002, "US"); // Samples per Pixel
// Step 2 : Create the output image
- //gdcm::FileHelper *fileH = new gdcm::FileHelper(fileToBuild);
+ //GDCM_NAME_SPACE::FileHelper *fileH = new GDCM_NAME_SPACE::FileHelper(fileToBuild);
// gdcm1.3 syntax. Sorry !
- gdcm::FileHelper *fileH = gdcm::FileHelper::New(fileToBuild);
+ GDCM_NAME_SPACE::FileHelper *fileH = GDCM_NAME_SPACE::FileHelper::New(fileToBuild);
fileH->SetWriteTypeToJPEG2000( );
fileH->SetImageData(testedImageData, testedDataSize);
if( !fileH->Write(outfilename) )
Program: gdcm
Module: $RCSfile: WriteDicomAsMPEG.cxx,v $
Language: C++
- Date: $Date: 2006/07/26 17:47:39 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Step 1 : Create the header of the image
- gdcm::File *fileToBuild = gdcm::File::New();
+ GDCM_NAME_SPACE::File *fileToBuild = GDCM_NAME_SPACE::File::New();
std::ostringstream str;
// Set the image size
* samplesPerPixel /* * img.componentSize / 8*/;
uint8_t *imageData = new uint8_t[size];
- gdcm::FileHelper *fileH = gdcm::FileHelper::New(fileToBuild);
+ GDCM_NAME_SPACE::FileHelper *fileH = GDCM_NAME_SPACE::FileHelper::New(fileToBuild);
//fileH->SetImageData(imageData,size);
std::ifstream mpeg("/tmp/ts.mpg");
mpeg.seekg(0, std::ios::end);
Program: gdcm
Module: $RCSfile: exExtractCSA.cxx,v $
Language: C++
- Date: $Date: 2007/06/15 13:18:51 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" inputFileName : Name of the (single) file user wants to anonymize ",
" listOfElementsExtract : group-elem,g2-e2,... (in hexa, no space) ",
" of Elements to extract ",
- " default : 0029-1210,0029-1220 ",
+ " default : 0029-1010,0029-1020 ",
" noshadowseq: user doesn't want to load Private Sequences ",
" noshadow : user doesn't want to load Private groups (odd number) ",
" noseq : user doesn't want to load Sequences ",
if ( am->ArgMgrDefined("noseq") )
loadMode |= GDCM_NAME_SPACE::LD_NOSEQ;
}
-
+
const char *tempWorkFile = am->ArgMgrGetString("tmp");
int extractNb;
uint16_t *elemsToExtract;
- if (am->ArgMgrDefined("extract"))
+ if (am->ArgMgrDefined("extract"))
+ {
am->ArgMgrGetXInt16Enum("extract", &extractNb);
+ std::cout << "extractNb=" << extractNb << std::endl;
+ if (extractNb =! 0)
+ for (int k=0;k<extractNb; k++)
+ std::cout << std::hex << elemsToExtract[2*k] << "|" << elemsToExtract[2*k+1] <<std::endl;
+ }
else
{
elemsToExtract = new uint16_t[4];
elemsToExtract[0] = 0x0029;
- elemsToExtract[1] = 0x1210;
+ elemsToExtract[1] = 0x1010;
elemsToExtract[2] = 0x0029;
- elemsToExtract[3] = 0x1220;
+ elemsToExtract[3] = 0x1020;
extractNb=2;
}
uint16_t group = elemsToExtract[2*tag_no];
uint16_t elem = elemsToExtract[2*tag_no+1];
+ if (verbose)
+ std::cout << "Let's try tag : " << std::hex << group << "|" << elem << std::endl;
+
std::string dicom_tag_value = f->GetEntryString(group, elem);
if (dicom_tag_value == gdcm::GDCM_UNFOUND)
{
gdcm::DictEntry *dictEntry = f->GetPubDict()->GetEntry( group, elem);
- std::cerr << "Image doesn't contain any tag: " << dictEntry->GetName()
- << std::endl;
+ if (dictEntry != NULL)
+ std::cerr << "Image doesn't contain any tag: " << dictEntry->GetName()
+ << std::endl;
+ else
+ std::cerr << "Dicom Dictionary doesn't contain any tag: "
+ << std::hex << group << "|" << elem << std::endl;
f->Delete();
return 1;
}
Program: gdcm
Module: $RCSfile: exInline.cxx,v $
Language: C++
- Date: $Date: 2006/06/30 09:54:30 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
r1 = times(&tms1);
for(i = 0 ; i< nbLoop ; i++)
{
- gdcm::Util::hifpswap (&a, &b);
+ GDCM_NAME_SPACE::Util::hifpswap (&a, &b);
}
r2 = times(&tms2);
std::cout
r1 = times(&tms1);
for(i = 0 ; i< nbLoop ; i++)
{
- gdcm::Util::hNoifpswap (&a, &b);
+ GDCM_NAME_SPACE::Util::hNoifpswap (&a, &b);
}
r2 = times(&tms2);
std::cout
Program: gdcm
Module: $RCSfile: exPrintTime.cxx,v $
Language: C++
- Date: $Date: 2005/10/21 08:43:32 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
clock_t r1, r2, r3, r4;
struct tms tms1, tms2, tms3, tms4;
- gdcm::File *e1;
+ GDCM_NAME_SPACE::File *e1;
//std::ostream os = std::cout;
//std::ostringstream s;
filename += "/"; //doh!
filename += gdcmDataImages[i];
- e1= new gdcm::File( );
+ e1= new GDCM_NAME_SPACE::File( );
r1 = times(&tms1);
e1->SetFileName( filename );
e1->Load( );
if (!e1->IsReadable())
std::cout << "-----------Not Readable " << std::endl;
delete e1;
- e1= new gdcm::File( );
- e1->SetLoadMode( gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW );
+ e1= new GDCM_NAME_SPACE::File( );
+ e1->SetLoadMode( GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW );
r3 = times(&tms3);
e1->SetFileName( filename );
e1->Load( );
filename += "/"; //doh!
filename += gdcmDataImages[i];
- e1= new gdcm::File( );
+ e1= new GDCM_NAME_SPACE::File( );
e1->SetFileName( filename );
e1->Load( );
if (!e1->IsReadable())
filename += "/"; //doh!
filename += gdcmDataImages[i];
- e1= new gdcm::File( );
- e1->SetLoadMode( gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW );
+ e1= new GDCM_NAME_SPACE::File( );
+ e1->SetLoadMode( GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW );
e1->SetFileName( filename );
e1->Load( );
if (!e1->IsReadable())
Program: gdcm
Module: $RCSfile: exPrintWritePrint.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 08:35:44 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
int main(int argc, char *argv[])
{
- gdcm::File *f;
- gdcm::FileHelper *fh;
+ GDCM_NAME_SPACE::File *f;
+ GDCM_NAME_SPACE::FileHelper *fh;
std::string fileNameToWrite;
void *imageData;
int dataSize;
std::cout << " This program allows to see at a glance" << std::endl;
- std::cout << " if the gdcm::File remains unimpaired" << std::endl;
+ std::cout << " if the GDCM_NAME_SPACE::File remains unimpaired" << std::endl;
std::cout << " after a Write" << std::endl;
std::cout << " In a future step, we could move it to" << std::endl;
std::cout << " gdcm Testing, for a systematic checking"<< std::endl;
std::string fileName = argv[1];
std::string mode = argv[2];
- f = new gdcm::File( );
- f->SetLoadMode( gdcm::LD_NOSEQ );
+ f = new GDCM_NAME_SPACE::File( );
+ f->SetLoadMode( GDCM_NAME_SPACE::LD_NOSEQ );
f->SetFileName( fileName );
f->Load( );
return 0;
}
- fh = new gdcm::FileHelper(f);
+ fh = new GDCM_NAME_SPACE::FileHelper(f);
// ---
f->Print();
Program: gdcm
Module: $RCSfile: exSerieHelper.cxx,v $
Language: C++
- Date: $Date: 2007/06/04 08:51:23 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2007/06/21 15:01:00 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//---------------------------------------------------------
zspacing = s->GetZSpacing();
- // Just to show : GetZSpacing from a gdcm::SerieHelper is right
+ // Just to show : GetZSpacing from a GDCM_NAME_SPACE::SerieHelper is right
std::cout << "GetZSpacing() of sorted SingleSerieUIDFileSet "
- << "from gdcm::SerieHelper: " << zspacing << std::endl;
+ << "from GDCM_NAME_SPACE::SerieHelper: " << zspacing << std::endl;
std::cout << " ('-1' means all the files have the same position)" << std::endl;
for (std::vector<GDCM_NAME_SPACE::File* >::iterator it = l->begin();
it != l->end();
++it)
{
- // Just to show : GetZSpacing from a gdcm::File may be different
- std::cout << (*it)->GetFileName() << " --> GetZSpacing() from gdcm::File : "
+ // Just to show : GetZSpacing from a GDCM_NAME_SPACE::File may be different
+ std::cout << (*it)->GetFileName() << " --> GetZSpacing() from GDCM_NAME_SPACE::File : "
<< (*it)->GetZSpacing() << std::endl;
}
{
// ============== Initialize Arguments Manager =============================
- gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv);
+ GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
if (argc == 1 || am->ArgMgrDefined("usage"))
{
std::cout << "Failed to open [" << fileout << "] for writting" << std::endl;
return 0;
}
- gdcm::File *f = gdcm::File::New();
- f->SetLoadMode( gdcm::LD_ALL);
+ GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
+ f->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
f->SetFileName( filein );
bool res = f->Load();