X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FWriteDicomAsJPEG.cxx;h=b8d52fbc2371ec7142346c44624329428eb244cd;hb=d0f6827609a499057f4bad725522060590af3d82;hp=9300c7302a0cf084384dc91b098c925c59658267;hpb=6d07e1c5ea5f9199082dc3e6873509a189d4f0f7;p=gdcm.git diff --git a/Example/WriteDicomAsJPEG.cxx b/Example/WriteDicomAsJPEG.cxx index 9300c730..b8d52fbc 100644 --- a/Example/WriteDicomAsJPEG.cxx +++ b/Example/WriteDicomAsJPEG.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: WriteDicomAsJPEG.cxx,v $ Language: C++ - Date: $Date: 2007/08/28 16:49:04 $ - Version: $Revision: 1.19 $ + Date: $Date: 2007/08/29 08:13:40 $ + 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 @@ -57,12 +57,13 @@ int main(int argc, char *argv[]) //tested->Print( std::cout ); int samplesPerPixel = f->GetSamplesPerPixel(); - size_t testedDataSize = tested->GetImageDataSize(); - uint8_t *testedImageData = tested->GetImageData(); + size_t testedDataSize = tested->GetImageDataRawSize(); // Raw : Don't convert gray pixels+LUT to RBG pixels + uint8_t *testedImageData = tested->GetImageDataRaw(); - if( GDCM_NAME_SPACE::Debug::GetDebugFlag() ) + if( GDCM_NAME_SPACE::Debug::GetDebugFlag() ) { tested->Print( std::cout ); - + std::cout << "-------------------------------------------------------------------------------" << std::endl; + } // Step 1 : Create the header of the new file GDCM_NAME_SPACE::File *fileToBuild = GDCM_NAME_SPACE::File::New(); std::ostringstream str; @@ -145,9 +146,10 @@ int main(int argc, char *argv[]) // Consider that pixels are unmodified fileH->SetContentType(GDCM_NAME_SPACE::UNMODIFIED_PIXELS_IMAGE); - + std::cerr << "xsize " << xsize << " ysize " << ysize << " zsize " << zsize << " samplesPerPixel " << samplesPerPixel + << " bitsallocated " << bitsallocated << std::endl; std::cerr << "size " << size << " testedDataSize " << testedDataSize << - std::endl; + std::endl; assert(abs (size-testedDataSize) <= 1 ); fileH->SetWriteTypeToJPEG( ); //fileH->SetImageData(testedImageData, testedDataSize);