X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FPrintFile.cxx;h=df97372165317e45e345f06b589416890bfb73dc;hb=a7b06006e972ee6ebc04f177a1461d4d5ae2089a;hp=6135c783aa29c9efe929b31f5c9c012aee98e439;hpb=4e91acd4c7ffc1eb58f3762419398d8e1d214956;p=gdcm.git diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index 6135c783..df973721 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/04/05 10:28:59 $ - Version: $Revision: 1.31 $ + Date: $Date: 2005/05/04 07:29:17 $ + Version: $Revision: 1.36 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -44,11 +44,20 @@ int main(int argc, char *argv[]) if (argc > 3) gdcm::Debug::DebugOn(); - + + bool res; if (argc > 4) - e1->SetLoadMode(NO_SEQ | NO_SHADOW); - - e1->Load( fileName.c_str() ); + e1->SetLoadMode(NO_SEQ | NO_SHADOW); + + // gdcm::File::IsReadable() is no usable here, because we deal with + // any kind of gdcm-Parsable *document* + // not only gdcm::File (as opposed to gdcm::DicomDir) + res = e1->Load( fileName.c_str() ); + if ( !res ) + { + delete e1; + return 0; + } f1 = new gdcm::FileHelper(e1); @@ -63,7 +72,7 @@ int main(int argc, char *argv[]) std::cout << "\n\n" << std::endl; std::cout <GetImageDataSize() << std::endl; + std::cout <<" dataSize " << f1->GetImageDataSize() << std::endl; std::cout <<" dataSizeRaw " << f1->GetImageDataRawSize() << std::endl; int nX,nY,nZ,sPP,planarConfig; @@ -77,7 +86,7 @@ int main(int argc, char *argv[]) sPP = e1->GetSamplesPerPixel(); planarConfig = e1->GetPlanarConfiguration(); - std::cout << " pixelType= [" << pixelType + std::cout << " pixelType= [" << pixelType << "] SamplesPerPixel= [" << sPP << "] PlanarConfiguration= [" << planarConfig << "] "<< std::endl