X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.cxx;h=3fb9cb5c011e67e48846641cb6c826593e359d40;hb=3bfc348942b85891d4f2a36782e0726df4e4b4c3;hp=e1c6c35f9a851e74691bb9b53b8afc7de22ee219;hpb=69d2c65c131c9752b1d64aa9b21de29c3acfe62d;p=gdcm.git diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index e1c6c35f..3fb9cb5c 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/07/24 02:34:41 $ - Version: $Revision: 1.263 $ + Date: $Date: 2005/09/06 15:32:13 $ + Version: $Revision: 1.267 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -38,30 +38,53 @@ // in the images. // // Remember also : -// Patient Position (0018,5100) values : HFP = Head First-Prone -// HFS = Head First-Supine -// HFDR = Head First-Decubitus Right -// HFDL = Head First-Decubitus Left -// FFDR = Feet First-Decubitus Right -// FFDL = Feet First-Decubitus Left -// FFP = Feet First-Prone -// FFS = Feet First-Supine -// can also find SEMIERECT -// SUPINE +// Patient Position (0018,5100) values : + +// HFS = Head First-Supine, where increasing (positive axis direction) : +// X -> to the direction pointed to by the patient's oustretched left arm +// Y -> to the anterior-to-posterior direction in the patient's body +// Z -> to the feet-to-head direction in the patient's body + +// HFP = Head First-Prone, where increasing (positive axis direction) : +// X -> to the direction pointed to by the patient's oustretched left arm +// Y -> to the anterior-to-posterior direction in the patient's body +// Z -> to the feet-to-head direction in the patient's body + +// FFS = Feet First-Supine, where increasing (positive axis direction) : +// X -> to the direction pointed to by the patient's oustretched left arm +// Y -> to the anterior-to-posterion direction in the patient's body +// Z -> to the feet-to-head direction in the patient's body + +// FFP = Feet First-Prone, where increasing (positive axis direction) : +// X -> to the direction pointed to by the patient's oustretched left arm +// Y -> to the posterior-to-anterior direction in the patient's body +// Z -> to the feet-to-head direction in the patient's body + +// HFDR = Head First-Decubitus Right +// HFDL = Head First-Decubitus Left +// FFDR = Feet First-Decubitus Right +// FFDL = Feet First-Decubitus Left + +// we can also find + +// SEMIERECT +// SUPINE + // CS 2 Patient Orientation (0020 0020) -// When the coordinates of the image -// are always present, this field is almost never used. -// Better we don't tust it too much ... -// Found Values are : L\P -// L\FP -// P\F -// L\F -// P\FR -// R\F +// When the coordinates of the image +// are always present, this field is almost never used. +// Better we don't trust it too much ... +// Found Values are : +// L\P +// L\FP +// P\F +// L\F +// P\FR +// R\F // // (0020|0037) [Image Orientation (Patient)] [1\0\0\0\1\0 ] - + // --------------------------------------------------------------- // #include "gdcmFile.h" @@ -76,7 +99,7 @@ #include "gdcmJPEGFragmentsInfo.h" #include -#include //sscanf +#include //sscanf #include // for atoi namespace gdcm @@ -785,8 +808,8 @@ int File::GetBitsStored() /** * \brief Retrieve the number of Bits Allocated - * (8, 12 -compacted ACR-NEMA files-, 16, ...) - * @return The encountered number of Bits Allocated, 0 by default. + * (8, 12 -compacted ACR-NEMA files-, 16, 24 -old RGB ACR-NEMA files-,) + * @return The encountered Number of Bits Allocated, 0 by default. * 0 means the file is NOT USABLE. The caller has to check it ! */ int File::GetBitsAllocated() @@ -920,8 +943,8 @@ std::string File::GetPixelType() } else if ( bitsAlloc == "24" ) { - // (in order no to be messed up - bitsAlloc = "8"; // by old RGB images) + // (in order no to be messed up by old RGB images) + bitsAlloc = "8"; } std::string sign = GetEntryValue(0x0028, 0x0103);//"Pixel Representation" @@ -1289,7 +1312,7 @@ void File::AddAnonymizeElement (uint16_t group, uint16_t elem, el.Group = group; el.Elem = elem; el.Value = value; - AnonymizeList.push_back(el); + UserAnonymizeList.push_back(el); } /** @@ -1305,8 +1328,8 @@ void File::AnonymizeNoLoad() uint32_t lgth; uint32_t valLgth = 0; std::string *spaces; - for (ListElements::iterator it = AnonymizeList.begin(); - it != AnonymizeList.end(); + for (ListElements::iterator it = UserAnonymizeList.begin(); + it != UserAnonymizeList.end(); ++it) { d = GetDocEntry( (*it).Group, (*it).Elem); @@ -1314,11 +1337,11 @@ void File::AnonymizeNoLoad() if ( d == NULL) continue; - if ( dynamic_cast(d) ) - { - gdcmWarningMacro( "You cannot 'Anonymize a SeqEntry "); - continue; - } + if ( dynamic_cast(d) ) + { + gdcmWarningMacro( "You cannot 'Anonymize' a SeqEntry "); + continue; + } offset = d->GetOffset(); lgth = d->GetLength(); @@ -1344,7 +1367,7 @@ void File::AnonymizeNoLoad() bool File::AnonymizeFile() { // If Anonymisation list is empty, let's perform some basic anonymization - if ( AnonymizeList.begin() == AnonymizeList.end() ) + if ( UserAnonymizeList.begin() == UserAnonymizeList.end() ) { // If exist, replace by spaces SetValEntry (" ",0x0010, 0x2154); // Telephone @@ -1362,15 +1385,15 @@ bool File::AnonymizeFile() } else { - SetValEntry("anonymised", 0x0010, 0x0010); + SetValEntry("anonymized", 0x0010, 0x0010); } } } else { gdcm::DocEntry *d; - for (ListElements::iterator it = AnonymizeList.begin(); - it != AnonymizeList.end(); + for (ListElements::iterator it = UserAnonymizeList.begin(); + it != UserAnonymizeList.end(); ++it) { d = GetDocEntry( (*it).Group, (*it).Elem);