From: jpr Date: Tue, 4 Jul 2006 07:58:50 +0000 (+0000) Subject: Port Mathieu'a modif in gdcm1.2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b2ff16e348984419acef46d369168e6a1dd9f8c6;p=gdcm.git Port Mathieu'a modif in gdcm1.2 ENH: More work toward JPEG support --- diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index 1760277a..dac8355c 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.cxx,v $ Language: C++ - Date: $Date: 2006/04/11 16:03:26 $ - Version: $Revision: 1.83 $ + Date: $Date: 2006/07/04 07:58:50 $ + Version: $Revision: 1.84 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -139,7 +139,12 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype) || (vr == "UN") || (vr == "UT") ) { binary_write(*fp, zero); - if (vr == "SQ") + if (filetype == JPEG && GetGroup() == 0x7fe0 && GetElement() == 0x0010) + { + gdcmAssertMacro( GetVR() == "OW" ); + binary_write(*fp, ffff); + } + else if (vr == "SQ") { // we set SQ length to ffffffff // and we shall write a Sequence Delimitor Item diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 40d1a83c..c47cee38 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2006/06/29 13:27:28 $ - Version: $Revision: 1.105 $ + Date: $Date: 2006/07/04 07:58:51 $ + Version: $Revision: 1.106 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -874,6 +874,11 @@ void FileHelper::SetWriteToRaw() vr = "OW"; if ( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files vr = "OB"; + // For non RAW data. Mainly JPEG + if( WriteType == JPEG ) + { + vr = "OW"; + } DataEntry *pixel = CopyDataEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel(),vr); pixel->SetFlag(DataEntry::FLAG_PIXELDATA);