X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestWrite.cxx;h=213042091ec09b83e88540c30e6c3834723fe3ac;hb=a4a4d786fdefad3af77842f41b12dcb85b7b1142;hp=ee92a4b19307208965f6311084e2b39311856689;hpb=3e82e8b67eddf5d4b95b6aa2a2e2615aced4c452;p=gdcm.git diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index ee92a4b1..21304209 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2005/02/02 10:06:32 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/06/15 09:54:13 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -65,7 +65,13 @@ int main(int argc, char *argv[]) std::string fileName = argv[1]; std::string mode = argv[2]; - e1 = new gdcm::File( fileName.c_str() ); + //e1 = new gdcm::File( fileName.c_str() ); + + // new style : + e1 = new gdcm::File( ); + e1->SetLoadMode(0); + e1->Load( fileName.c_str() ); + if (!e1->IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <Print(); f1 = new gdcm::FileHelper(e1); + dataSize = f1->GetImageDataSize(); + imageData= f1->GetImageData(); + + // --- - dataSize = f1->GetImageDataSize(); std::cout <GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; - -/* if ( transferSyntaxName != "Implicit VR - Little Endian" + +/* + if ( transferSyntaxName != "Implicit VR - Little Endian" && transferSyntaxName != "Explicit VR - Little Endian" && transferSyntaxName != "Deflated Explicit VR - Little Endian" && transferSyntaxName != "Explicit VR - Big Endian" @@ -111,9 +121,8 @@ int main(int argc, char *argv[]) f1->GetPixelReadConverter()->Print(); std::cout << std::endl << "===========================================" << std::endl; - }*/ - imageData= f1->GetImageData(); - + } +*/ switch (mode[0]) { case 'a' : @@ -160,7 +169,7 @@ int main(int argc, char *argv[]) std::cout << "videoinv for 8 bits" << std::endl; for (int i=0; i