X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestWrite.cxx;h=8fce916bd8c3f2f342a1f84a062fb49a58ea538f;hb=6e9466fd9b712361db37c64dfc5d8a7efaae59f0;hp=fb5468267bc0b110ec817f1f4c9925365d53af51;hpb=ba78e6c6d47d6db1528e8e88e5ebde7296a26692;p=gdcm.git diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index fb546826..8fce916b 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestWrite.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:55 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/24 16:10:49 $ + Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -15,19 +15,18 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" #include "gdcmFile.h" +#include "gdcmFileHelper.h" #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { std::string zozo; - gdcm::Header* e1; - gdcm::File * f1; + gdcm::File *e1; + gdcm::FileHelper *f1; - //gdcmDocument * d; //not used void* imageData; int dataSize; @@ -45,13 +44,13 @@ int main(int argc, char* argv[]) } /* if (0) { // Just to keep the code for further use - std::cout <GetHeader()->IsReadable()) { + std::cout <GetFile()->IsReadable()) { std::cout << "Sorry, not a DICOM / ACR File" < after new gdcmHeader" + std::cout << std::endl << "----------------------> after new gdcmFile" << std::endl; e1->PrintEntry(); std::cout <IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <Print(); - f1 = new gdcm::File(e1); + f1 = new gdcm::FileHelper(e1); // --- dataSize = f1->GetImageDataSize(); @@ -94,12 +93,12 @@ int main(int argc, char* argv[]) << " SampleserPixel=" << sPP << " PlanarConfiguration=" << planarConfig << " PhotometricInterpretation=" - << e1->GetEntryByNumber(0x0028,0x0004) + << e1->GetEntryValue(0x0028,0x0004) << std::endl; int numberOfScalarComponents=e1->GetNumberOfScalarComponents(); std::cout << "NumberOfScalarComponents " << numberOfScalarComponents <GetTransfertSyntaxName(); + transferSyntaxName = e1->GetTransferSyntaxName(); std::cout << " TransferSyntaxName= [" << transferSyntaxName << "]" << std::endl; /* if ( transferSyntaxName != "Implicit VR - Little Endian" @@ -119,7 +118,7 @@ int main(int argc, char* argv[]) { case 'a' : // ecriture d'un fichier ACR - // à partir d'un dcmHeader correct. + // à partir d'un dcmFile correct. zozo = toto + ".ACR"; std::cout << "WriteACR" << std::endl; @@ -129,7 +128,7 @@ int main(int argc, char* argv[]) case 'd' : // Not document in the 'usage', because the method is knowed to be bugged. // ecriture d'un fichier DICOM Implicit VR - // à partir d'un dcmHeader correct. + // à partir d'un dcmFile correct. zozo = toto + ".DCM"; std::cout << "WriteDCM Implicit VR" << std::endl; @@ -138,7 +137,7 @@ int main(int argc, char* argv[]) case 'x' : // ecriture d'un fichier DICOM Explicit VR - // à partir d'un dcmHeader correct. + // à partir d'un dcmFile correct. zozo = toto + ".XDCM"; std::cout << "WriteDCM Explicit VR" << std::endl; @@ -156,7 +155,7 @@ int main(int argc, char* argv[]) case 'v' : - if ( f1->GetHeader()->GetBitsAllocated() == 8) + if ( f1->GetFile()->GetBitsAllocated() == 8) { std::cout << "videoinv for 8 bits" << std::endl; for (int i=0; i