X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FexCurveData.cxx;h=f7244b621db468dc9a16065b32676d0bb2503365;hb=3b1f653b219f72d841e3b52ef2ae20d2c7c91220;hp=47ec1b3cdb88380f93e4d0a2bbb6ad3cefc32241;hpb=bc69950a406d06c50f0fb75a96572784965cb534;p=gdcm.git diff --git a/Example/exCurveData.cxx b/Example/exCurveData.cxx index 47ec1b3c..f7244b62 100644 --- a/Example/exCurveData.cxx +++ b/Example/exCurveData.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exCurveData.cxx,v $ Language: C++ - Date: $Date: 2005/10/18 08:35:43 $ - Version: $Revision: 1.4 $ + Date: $Date: 2007/05/23 14:18:05 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -76,12 +76,12 @@ inline size_t PrintCurveData(DataValueRepresentation* data, unsigned short numPt * V 5004|0020 [CS] [Type of Data] [PHYSIO] * V 5004|0022 [LO] [Curve Description] [] * V 5004|0103 [US] [Data Value Representation] [0] x(0) - * B 5004|3000 [OW] [Curve Data] [gdcm::Binary data loaded;length = 1938] + * B 5004|3000 [OW] [Curve Data] [GDCM_NAME_SPACE::Binary data loaded;length = 1938] */ int main(int argc, char *argv[]) { - gdcm::File *f; + GDCM_NAME_SPACE::File *f; std::cout << "------------------------------------------------" << std::endl; std::cout << "Gets the 'Curve Data' from a full gdcm-readable DICOM " << std::endl; @@ -101,13 +101,13 @@ int main(int argc, char *argv[]) // Read the input image. // ============================================================ - f = new gdcm::File( ); + f = GDCM_NAME_SPACE::File::New( ); - f->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW); + f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW); f->SetFileName( fileName ); bool res = f->Load(); - if( gdcm::Debug::GetDebugFlag() ) + if( GDCM_NAME_SPACE::Debug::GetDebugFlag() ) { std::cout << "---------------------------------------------" << std::endl; f->Print(); @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) std::cout << "Sorry, " << fileName <<" not a gdcm-readable " << "DICOM / ACR File" <Delete(); return 1; } std::cout << " ... is readable " << std::endl; @@ -126,12 +126,12 @@ int main(int argc, char *argv[]) // Check whether image contains Overlays ACR-NEMA style. // ============================================================ - //* B 5004|3000 [OW] [Curve Data] [gdcm::Binary data loaded;length = 1938] + //* B 5004|3000 [OW] [Curve Data] [GDCM_NAME_SPACE::Binary data loaded;length = 1938] std::string curve_data_str = f->GetEntryString(0x5004, 0x3000); - if (curve_data_str == gdcm::GDCM_UNFOUND) + if (curve_data_str == GDCM_NAME_SPACE::GDCM_UNFOUND) { std::cout << " Image doesn't contain any Curve Data" << std::endl; - delete f; + f->Delete(); return 1; } std::cout << " File is read! " << std::endl; @@ -169,8 +169,8 @@ int main(int argc, char *argv[]) convert >> data_rep; - gdcm::DocEntry *pCurveDataDoc = f->GetDocEntry(0x5004, 0x3000); - gdcm::DataEntry *pCurveData = dynamic_cast(pCurveDataDoc); + GDCM_NAME_SPACE::DocEntry *pCurveDataDoc = f->GetDocEntry(0x5004, 0x3000); + GDCM_NAME_SPACE::DataEntry *pCurveData = dynamic_cast(pCurveDataDoc); uint8_t *curve_data = pCurveData->GetBinArea(); // From Part3, C.10.2.1.2 Data value representation (p668) @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) break; default: std::cerr << "Error don't know the type: " << data_rep_str << std::endl; - delete f; + f->Delete(); return 1; } // Just to make sure that values read are consistant and we won't read out of bound data: @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) //o.write((char*)curve_data, num_points*sz); //o.close(); - delete f; + f->Delete(); return 0; }