X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFileHelper.cxx;h=9090bda676dbad24a53bec329325a21042acb199;hb=21d241b3fdcf675d8d91a6daf6dfd6f448b68195;hp=1d16fbf801e7b2685e4363be2c018c88596287e4;hpb=c4fa2e74a4ce56a0a8db54e4a70d404bec9fc8dd;p=gdcm.git diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 1d16fbf8..9090bda6 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/08/30 14:40:33 $ - Version: $Revision: 1.55 $ + Date: $Date: 2005/10/07 09:54:53 $ + Version: $Revision: 1.59 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -100,7 +100,7 @@ fh1->Write(newFileName); (checks user given pixels length) FileInternal->Write(fileName,WriteType) fp = opens file(fileName); - ComputeGroup0002Length(writetype); + ComputeGroup0002Length( ); BitsAllocated 12->16 RemoveEntryNoDestroy(palettes, etc) Document::WriteContent(fp, writetype); @@ -1243,7 +1243,7 @@ void FileHelper::CheckMandatoryElements() ValEntry *e_0002_0013 = CopyValEntry(0x0002,0x0013); std::string version = "GDCM "; version += Util::GetVersion(); - e_0002_0013->SetValue("GDCM 1.1"); + e_0002_0013->SetValue(version); Archive->Push(e_0002_0013); //'Source Application Entity Title' Not Mandatory @@ -1485,7 +1485,17 @@ void FileHelper::CheckMandatoryElements() e_0008_0090->SetValue(""); Archive->Push(e_0008_0090); } - + + // Pixel Spacing : defaulted to 1.0\1.0 + ValEntry *e_0028_0030 = FileInternal->GetValEntry(0x0028, 0x0030); + if ( !e_0028_0030 ) + { + e_0028_0030 = new ValEntry( + Global::GetDicts()->GetDefaultPubDict()->GetEntry(0x0028, 0x0030) ); + e_0028_0030->SetValue("1.0\\1.0"); + Archive->Push(e_0028_0030); + } + // Remove some inconstencies (probably some more will be added) // if (0028 0008)Number of Frames exists @@ -1591,8 +1601,11 @@ void FileHelper::Print(std::ostream &os, std::string const &) FileInternal->SetPrintLevel(PrintLevel); FileInternal->Print(os); - PixelReadConverter->SetPrintLevel(PrintLevel); - PixelReadConverter->Print(os); + if ( FileInternal->IsReadable() ) + { + PixelReadConverter->SetPrintLevel(PrintLevel); + PixelReadConverter->Print(os); + } } //-----------------------------------------------------------------------------