X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.cxx;h=9c55ec89dbe7b06e16f140041949b297a6d1e656;hb=3f244b54d3cff8a8ccbb2f8586ba992618075b41;hp=4ccb1e7ae0b52a14856c7b130a601333be791600;hpb=17ebda2271dd65565f512e835546b22c22ebbbb0;p=gdcm.git diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 4ccb1e7a..9c55ec89 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2006/04/11 16:03:26 $ - Version: $Revision: 1.318 $ + Date: $Date: 2006/06/08 13:37:33 $ + Version: $Revision: 1.321 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -251,8 +251,8 @@ bool File::DoTheLoadingJob( ) } */ VRKey PixelVR; - // 8 bits allocated is a 'O Bytes' , as well as 24 (old ACR-NEMA RGB) - // more than 8 (i.e 12, 16) is a 'O Words' + // 8 bits allocated is a 'OB(ytes)' , as well as 24 (old ACR-NEMA RGB) + // more than 8 (i.e 12, 16) is a 'OW(ords)' if ( GetBitsAllocated() == 8 || GetBitsAllocated() == 24 ) PixelVR = "OB"; else @@ -508,6 +508,36 @@ float File::GetXSpacing() { float xspacing = 1.0; uint32_t nbValue; + +/* +It *SHOULD* first find the IOD and then deduce which tags to read +Eg: Cross section this is in Pixel Spacing (0028,0030) +CR is in Imager Pixel Spacing (0018,1164) +US is in Pixel Ratio (0028,0034) +RT is in : +(3002,0011) Image Plane Pixel Spacing +(3002,0012) RT Image Position +and +(3004,000c) for deducing Z spacing +*/ + + +// std::string SOPClassUID = GetEntryString(0x0008,0x0016); + + /// \todo check the various SOP Class + /// to get the Pixel Spacing at the proper location + + + // Ultrasound Image Storage (Retired) +/* + if (Util::DicomStringEqual( SOPClassUID,"1.2.840.10008.5.1.4.1.1.6") + { + - check if SOPClassUID contains 2 parts (e.g. "4\3") + - guess how to deduce the spacing (FOV ?, ??) + } + else + // go on with old method ... +*/ // To follow David Clunie's advice, we first check ImagerPixelSpacing @@ -1381,6 +1411,10 @@ void File::AnonymizeNoLoad() it != UserAnonymizeList.end(); ++it) { + + //std::cout << "File::AnonymizeNoLoad -------" << std::hex <<(*it).Group <<"|"<< + // (*it).Elem + // << "[" << (*it).Value << "] "<< std::dec << std::endl; d = GetDocEntry( (*it).Group, (*it).Elem); if ( d == NULL) @@ -1391,13 +1425,20 @@ void File::AnonymizeNoLoad() gdcmWarningMacro( "You cannot 'Anonymize' a SeqEntry "); continue; } + + valLgth = (*it).Value.size(); + if (valLgth == 0) + continue; offset = d->GetOffset(); lgth = d->GetLength(); + + //std::cout << "lgth " << lgth << " valLgth " << valLgth << std::endl; if (valLgth < lgth) { spaces = new std::string( lgth-valLgth, ' '); (*it).Value = (*it).Value + *spaces; + //std::cout << "[" << (*it).Value << "] " << lgth << std::endl; delete spaces; } fp->seekp( offset, std::ios::beg ); @@ -1884,7 +1925,7 @@ void File::ReadEncapsulatedBasicOffsetTable() // These are the deprecated method that one day should be removed (after the next release) -#ifndef GDCM_LEGACY_REMOVE +//#ifndef GDCM_LEGACY_REMOVE /* * \ brief Loader. (DEPRECATED : temporaryly kept not to break the API) * @ param fileName file to be open for parsing @@ -1892,6 +1933,7 @@ void File::ReadEncapsulatedBasicOffsetTable() * or no tag was found. * @deprecated Use the Load() [ + SetLoadMode() ] + SetFileName() functions instead */ + /* bool File::Load( std::string const &fileName ) { GDCM_LEGACY_REPLACED_BODY(File::Load(std::string), "1.2", @@ -1903,7 +1945,7 @@ bool File::Load( std::string const &fileName ) return DoTheLoadingJob( ); } #endif - +*/ //----------------------------------------------------------------------------- // Print