tree::AttributeDescriptor::GetDicomGroupElementFromKey(i->first,gr,el);
if ( ( gr!=0 ) && ( el!=0 ) )
{
- gdcm::DataElement de( gdcm::Tag(gr,el) );
+
std::string val = GetStringValueFromTag(reader.GetFile().GetDataSet().GetDataElement(gdcm::Tag(gr,el)));
i->second = irclean(val);
}
gdcm::Scanner::TagToValue::const_iterator it = mapping.begin();
std::map<std::string, std::string>::iterator i;
- int j= 0;
-
-
for (;it != mapping.end(); ++it)
- {
- /*std::stringstream val;
- val << "D";
- val << std::hex << it->first.GetGroup() ;
- val << "_";;
- val << std::hex << it->first.GetElement();
- var >> key*/
- char key[12] ;
-
+ { char key[12] ;
sprintf(key,"D%04x_%04x", it->first.GetGroup(), it->first.GetElement());
attr[key] = irclean(it->second);
}
#include "gdcmDocument.h"
#include "gdcmFileHelper.h"
#endif
+
+#if defined(USE_GDCM2)
+#include "gdcmGlobal.h"
+#include "gdcmFile.h"
+#include "gdcmDictPrinter.h"
+#include "gdcmPrinter.h"
+#include "gdcmReader.h"
+#endif
#include "icons/save.xpm"
namespace creaImageIO
void WxDumpPanel::Print()
{
std::stringstream os;
+ std::string result = "";
if ( !filename.empty()) // ====== Deal with a single file ======
{
- /* GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
+
+#if defined(USE_GDCM)
+ GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
f->SetLoadMode(GDCM_NAME_SPACE::LD_ALL);
f->SetFileName( filename );
f->SetMaxSizeLoadEntry(0xffff);
f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ |GDCM_NAME_SPACE::LD_NOSHADOW);
fh->SetPrintLevel( 0 );
fh->Print(os);
- std::string result;
+
std::string line;
while(std::getline(os, line))
{
result +=clean(line.c_str());
result += "\n";
}
- DumpText->SetValue(crea::std2wx(result));
-
- std::string pixelType =f->GetPixelType();
- int nX,nY,nZ,nT,sPP,planarConfig;
-
- nX=f->GetXSize();
- nY=f->GetYSize();
- nZ=f->GetZSize();
- nT=f->GetTSize();*/
+
+
+#endif
+#if defined(USE_GDCM2)
+ gdcm::Reader reader;
+ reader.SetFileName( filename.c_str() );
+ if (reader.Read())
+ {
+ gdcm::Printer printer;
+ printer.SetFile ( reader.GetFile() );
+ printer.SetColor( 0 );
+ printer.Print( os );
+ result = os.str();
+ }
+#endif
+ DumpText->SetValue(crea::std2wx(result));
+
}
}