X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FReWrite.cxx;h=bde09d1e0afedd0610737ff3a09ff00956f0bee4;hb=a981c86aa591c214ea7491162427b7a73d7d8701;hp=37d15073272714258874b4ce6f42d2fe27111ebc;hpb=ac2e8ecc8319069451f1fe5a4413915d56f9cbdc;p=gdcm.git diff --git a/Example/ReWrite.cxx b/Example/ReWrite.cxx index 37d15073..bde09d1e 100644 --- a/Example/ReWrite.cxx +++ b/Example/ReWrite.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: ReWrite.cxx,v $ Language: C++ - Date: $Date: 2005/07/21 04:55:50 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/10/21 08:39:31 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -68,15 +68,15 @@ int main(int argc, char *argv[]) char *mode = am->ArgMgrGetString("mode",(char *)"X"); - int loadMode = 0x00000000; + int loadMode = gdcm::LD_ALL; if ( am->ArgMgrDefined("noshadowseq") ) - loadMode |= NO_SHADOWSEQ; + loadMode |= gdcm::LD_NOSHADOWSEQ; else { if ( am->ArgMgrDefined("noshadow") ) - loadMode |= NO_SHADOW; + loadMode |= gdcm::LD_NOSHADOW; if ( am->ArgMgrDefined("noseq") ) - loadMode |= NO_SEQ; + loadMode |= gdcm::LD_NOSEQ; } bool rgb = ( 0 != am->ArgMgrDefined("RGB") ); @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) << " SampleserPixel=" << sPP << " PlanarConfiguration=" << planarConfig << " PhotometricInterpretation=" - << f->GetEntryValue(0x0028,0x0004) + << f->GetEntryString(0x0028,0x0004) << std::endl; int numberOfScalarComponents=f->GetNumberOfScalarComponents(); @@ -173,8 +173,8 @@ int main(int argc, char *argv[]) case 'D' : // Not documented in the 'usage', because the method case 'd' : // is known to be bugged. - // Writting a DICOM Implicit VR file - // from a full gdcm readable File + // Writting a DICOM Implicit VR file + // from a full gdcm readable File std::cout << "WriteDCM Implicit VR" << std::endl; fh->WriteDcmImplVR(outputFileName); @@ -186,7 +186,10 @@ int main(int argc, char *argv[]) // from a full gdcm readable File std::cout << "WriteDCM Explicit VR" << std::endl; - fh->WriteDcmExplVR(outputFileName); + // fh->WriteDcmExplVR(outputFileName); + // Try this one : + fh->SetWriteTypeToDcmExplVR(); + fh->Write(outputFileName); break; case 'R' : @@ -196,6 +199,33 @@ int main(int argc, char *argv[]) std::cout << "WriteRaw" << std::endl; fh->WriteRawData(outputFileName); break; + + // Just for fun : + // Write a 'Video inverse' version of the file. + // *Not* described, on purpose, in the USAGE + + case 'V' : + case 'v' : + + if ( fh->GetFile()->GetBitsAllocated() == 8) + { + std::cout << "videoinv for 8 bits" << std::endl; + for (int i=0; iWriteDcmExplVR(outputFileName); + break; } delete f;