X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FexImageLighten.cxx;fp=Example%2FexImageLighten.cxx;h=c0553d12abec6a161080240f2e65950e0c9e63bb;hb=4d992954520d43c6f2fb555b7cd721574978c23a;hp=5797d82d242e50f53bb27102ace339179ee423d4;hpb=fbd2698cb0545343abc2d8aefe92bab1f5b3eaa3;p=gdcm.git diff --git a/Example/exImageLighten.cxx b/Example/exImageLighten.cxx index 5797d82d..c0553d12 100644 --- a/Example/exImageLighten.cxx +++ b/Example/exImageLighten.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exImageLighten.cxx,v $ Language: C++ - Date: $Date: 2005/07/06 15:49:31 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/07/07 17:31:54 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,9 +26,7 @@ #include // for exit int main(int argc, char *argv[]) -{ - gdcm::File *f1; - +{ std::cout << "-----------------------------------------------" << std::endl; std::cout << "Removes from a full gdcm-readable Dicom image" << std::endl; std::cout << " all the 'Shadow groups' and the 'Sequence' entries" @@ -58,8 +56,12 @@ int main(int argc, char *argv[]) std::cout << argv[1] << std::endl; - f1 = new gdcm::File( fileName ); - if (!f1->IsReadable()) { + gdcm::File *f = new gdcm::File(); + f->SetLoadMode( 0x00000000); + f->SetFileName( fileName ); + bool res = f->Load(); + + if (!res) { std::cerr << "Sorry, " << fileName <<" not a gdcm-readable " << "DICOM / ACR File" <GetImageDataRaw(); + uint8_t *imageDataRaw = fh->GetImageDataRaw(); // Get the image data size - size_t dataRawSize = fh1->GetImageDataRawSize(); + size_t dataRawSize = fh->GetImageDataRawSize(); // ============================================================ // Create a new gdcm::Filehelper, to hold new image. @@ -93,9 +95,9 @@ int main(int argc, char *argv[]) // Selective copy of the entries (including Pixel Element). // ============================================================ - gdcm::DocEntry *d = f1->GetFirstEntry(); + gdcm::DocEntry *d = f->GetFirstEntry(); - d = f1->GetFirstEntry(); + d = f->GetFirstEntry(); while(d) { // We skip SeqEntries, since user cannot do much with them @@ -121,7 +123,7 @@ int main(int argc, char *argv[]) // We skip gdcm::SeqEntries } } - d = f1->GetNextEntry(); + d = f->GetNextEntry(); } // User wants to keep the Palette Color -if any- @@ -133,8 +135,8 @@ int main(int argc, char *argv[]) std::cout << std::endl << "------------------------------------------------------------" << std::endl; - delete f1; - delete fh1; + delete f; + delete fh; delete copy; exit (0);