Program: gdcm
Module: $RCSfile: exExtractCSA.cxx,v $
Language: C++
- Date: $Date: 2007/06/21 15:01:00 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2007/10/03 09:14:55 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmSQItem.h"
#include "gdcmArgMgr.h"
-// Looks like there is mapping in between syngodt and vr...
-// O <=> UN
-// 3 <=> DS
-// 4 <=> FD
-// 5 <=> FL
-// 6 <=> IS
-// 9 <=> UL
-// 10 <=> US
-// 16 <=> CS
-// 19 <=> LO
-// 20 <=> LT
-// 22 <=> SH
-// 25 <=> UI
// --------------------------------------------------------
char vr[2+1];
};
+// Looks like there is mapping in between syngodt and vr...
+// O <=> UN
+// 3 <=> DS
+// 4 <=> FD
+// 5 <=> FL
+// 6 <=> IS
+// 9 <=> UL
+// 10 <=> US
+// 16 <=> CS
+// 19 <=> LO
+// 20 <=> LT
+// 22 <=> SH
+// 25 <=> UI
static equ mapping[] = {
{ 0 , "UN" },
{ 3 , "DS" },
{ 4 , "FD" },
{ 5 , "FL" },
{ 6 , "IS" },
+ { 7 , "SL" },
+ { 8 , "SS" },
{ 9 , "UL" },
{ 10 , "US" },
{ 16 , "CS" },
{ 22 , "SH" },
{ 23 , "ST" },
{ 25 , "UI" },
+ { 27 , "UT" }
};
bool check_mapping(uint32_t syngodt, const char *vr)
}
- ///\to fix the Desctructor!
+ ///\to fix the Destructor!
void DeleteCSA_content (CSA_content &myMap) {
for ( CSA_content::const_iterator it = myMap.begin();
it != myMap.end();
{
am->ArgMgrUsage(usage); // Display 'usage'
delete am;
- return 0;
+ return 1;
}
if (am->ArgMgrDefined("debug"))
{
am->ArgMgrUsage(usage);
delete am;
- return 0;
+ return 1;
}
delete am; // ------ we don't need Arguments Manager any longer ------
// Read the input image.
// ============================================================
- gdcm::File *f = gdcm::File::New( );
+ GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New( );
- //f->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
+ //f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW);
f->SetFileName( fileName );
f->SetMaxSizeLoadEntry(0xffff);
bool res = f->Load();
- if( gdcm::Debug::GetDebugFlag())
+ if( GDCM_NAME_SPACE::Debug::GetDebugFlag())
{
std::cout << "---------------------------------------------" << std::endl;
f->Print();
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)
+ if (dicom_tag_value == GDCM_NAME_SPACE::GDCM_UNFOUND)
{
- gdcm::DictEntry *dictEntry = f->GetPubDict()->GetEntry( group, elem);
+ GDCM_NAME_SPACE::DictEntry *dictEntry = f->GetPubDict()->GetEntry( group, elem);
if (dictEntry != NULL)
std::cerr << "Image doesn't contain any tag: " << dictEntry->GetName()
<< std::endl;
return 1;
}
- gdcm::DocEntry *dicom_tag_doc = f->GetDocEntry(group, elem);
- gdcm::DataEntry *dicom_tag = dynamic_cast<gdcm::DataEntry *>(dicom_tag_doc);
+ GDCM_NAME_SPACE::DocEntry *dicom_tag_doc = f->GetDocEntry(group, elem);
+ GDCM_NAME_SPACE::DataEntry *dicom_tag = dynamic_cast<GDCM_NAME_SPACE::DataEntry *>(dicom_tag_doc);
if( !dicom_tag )
{
std::cerr << "Sorry DataEntry only please" << std::endl;
o.close();
+//#define OLDFORMAT
+
std::ifstream is( tempWorkFile );
+#ifndef OLDFORMAT
char dummy[4+1];
dummy[4] = 0;
is.read(dummy, 4);
if (verbose)
std::cout << (int)dummy[0] << (int)dummy[1] << (int)dummy[2]
<< (int)dummy[3]<< std::endl;
+#endif
uint32_t n;
is.read((char*)&n, sizeof(n));
if (verbose)
std::cout << "vm=" << vm << std::endl;
char vr[4];
is.read(vr, 4);
+#ifndef OLDFORMAT
assert( vr[2] == vr[3] && vr[2] == 0 );
+#endif
if (verbose)
std::cout << "vr=[" << vr << "]" <<std::endl;
uint32_t syngodt;