Program: gdcm
Module: $RCSfile: PrintFile.cxx,v $
Language: C++
- Date: $Date: 2007/11/09 17:52:59 $
- Version: $Revision: 1.89 $
+ Date: $Date: 2009/03/04 08:57:40 $
+ Version: $Revision: 1.92 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" usage: PrintFile {filein=inputFileName|dirin=inputDirectoryName}[level=n]",
" [forceload=listOfElementsToForceLoad] [rec] [noex] ",
" [4DLoc= ][dict= privateDirectory] ",
- " [ { [noshadowseq] | [noshadow][noseq] } ] ",
+ " [ { [noshadowseq] | [noshadow][noseq] } ] [load] ",
" [debug] [warning] ",
" level = 0,1,2 : depending on the amount of details user wants to see",
" rec : user wants to parse recursively the directory ",
- " noex : user doen't want extra 'user friendly' info ",
+ " load : user wants to load the pixels, as well (to see warning info) ",
+ " noex : user doesn't want extra 'user friendly' info ",
" 4DLoc: group-elem(in hexa, no space) of the DataEntry holdind 4thDim",
" listOfElementsToForceLoad : group-elem,g2-e2,... (in hexa, no space)",
" of Elements to load whatever their length ",
}
}
+ bool load = ( 0 != am->ArgMgrDefined("load") );
+
bool showlut = ( 0 != am->ArgMgrDefined("SHOWLUT") );
bool ddict = am->ArgMgrDefined("dict") ? true : false;
if (ori != "\\" )
std::cout << "Orientation [" << ori << "]" << std::endl;
o->Delete();
+
+
+/*
+std::vector <double> valueVector;
+GDCM_NAME_SPACE::DataEntry *e_0018_5212 = f->GetDataEntry(0x0018, 0x5212);
+bool resJP = e_0018_5212->GetDSValue(valueVector);
+if (resJP) {
+ double test;
+ for ( int i=0; i < 3; i++ ) {
+ test = valueVector[i];
+ std::cout << " test " << test << std::endl;
+ }
+}
+//e_0018_5212->Delete();
+*/
+
+
+/* -----------------------------
+
+// Try :
+std::cout << std::endl << std::endl << "===========Try Get Numerical ======="
+ << std::endl;
+GDCM_NAME_SPACE::DataEntry *e;
+bool res;
+std::vector<double> vd;
+
+// Transfert Syntax
+e=f->GetDataEntry(0x0002,0x0010);
+if (e){
+ res=e->GetNumerical(vd);
+ if (!res){
+ std::cout << "0x0002,0x0010 not numerical, size =" << vd.size() << std::endl;
+ }
+}
+// Columns
+e=f->GetDataEntry(0x0028,0x0011);
+if (e){
+ res=e->GetNumerical(vd);
+ if (!res){
+ std::cout << "0x0028,0x0011 not numerical, size =" << vd.size() << std::endl;
+ } else {
+ std::cout << "0x0028,0x0011 numerical, size =" << vd.size() << std::endl;
+ std::cout << vd[0]<< std::endl;
+ }
+}
+// Im Orient (Pat)
+e=f->GetDataEntry(0x0020,0x0032);
+if (e){
+ res=e->GetNumerical(vd);
+ if (!res){
+ std::cout << "0x0020,0x0032 not numerical, size =" << vd.size() << std::endl;
+ } else {
+ std::cout << "0x0020,0x0032 numerical, size =" << vd.size() << std::endl;
+ for(int l=0; l<vd.size(); l++)
+ std::cout << "vd[" << l << "]=" << vd[l]<< std::endl;
+ }
+}
+
+// Pixel Spacing
+
+e=f->GetDataEntry(0x0028,0x0030);
+if (e){
+ res=e->GetNumerical(vd);
+ if (!res){
+ std::cout << "0x0028,0x0030 not numerical, size =" << vd.size() << std::endl;
+ } else {
+ std::cout << "0x0028,0x0030 numerical, size =" << vd.size() << std::endl;
+ for(int l=0; l<vd.size(); l++)
+ std::cout << "vd[" << l << "]=" << vd[l]<< std::endl;
+ }
+}
+
+----------------------------------------------*/
+
}
//------------------------------
else
std::cout << "No LUT Data (0x0028,0x3000) found " << std::endl;
}
+ /*
else
{
if ( fh->GetLutItemSize() == 8 )
<< (int)(lutrgba16[i*4+2]) << std::endl;
}
}
+ */
}
else if (showlut)
{
std::string ori = o->GetOrientation ( f );
if (ori != "\\" )
std::cout << "Orientation [" << ori << "]" << std::endl;
- o->Delete();
+ o->Delete();
}
//-------------------------------
if (f->IsReadable())
+ {
+ if (load) // just to see warning messages at load time !
+ {
+ uint8_t *pixels = fh->GetImageData(); (void)pixels;
+ uint32_t lgth = fh->GetImageDataSize(); (void)lgth;
+ }
+
std::cout <<std::endl<<it->c_str()<<" is Readable"<<std::endl;
+ }
else
std::cout <<std::endl<<it->c_str()<<" is NOT Readable"<<std::endl;
std::cout << "\n\n" << std::endl;
+
+
+
f->Delete();
fh->Delete();
}