2 //-----------------------------------------------------------------------------
3 #include "gdcmHeader.h"
7 #include <cctype> // for isalpha
13 //-----------------------------------------------------------------------------
14 // Constructor / Destructor
19 * @param exception_on_error
20 * @param enable_sequences = true to allow the header
21 * to be parsed *inside* the SeQuences,
22 * when they have an actual length
23 * @param ignore_shadow = true if user wants to skip shadow groups
24 during parsing, to save memory space
25 *\TODO : may be we need one more bool,
26 * to allow skipping the private elements while parsing the header
27 * in order to save space
29 gdcmHeader::gdcmHeader(const char *InFilename,
30 bool exception_on_error,
31 bool enable_sequences,
33 gdcmParser(InFilename,exception_on_error,enable_sequences,ignore_shadow)
36 // for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010
37 // We may encounter the 'RETired' (0x0028, 0x0200) tag
38 // (Image Location") . This Element contains the number of
39 // the group that contains the pixel data (hence the "Pixel Data"
40 // is found by indirection through the "Image Location").
41 // Inside the group pointed by "Image Location" the searched element
42 // is conventionally the element 0x0010 (when the norm is respected).
43 // When the "Image Location" is absent we default to group 0x7fe0.
45 // This IS the right place for the code
47 std::string ImageLocation = GetEntryByNumber(0x0028, 0x0200);
48 if ( ImageLocation == GDCM_UNFOUND ) { // Image Location
49 GrPixel = 0x7fe0; // default value
51 GrPixel = (guint16) atoi( ImageLocation.c_str() );
53 if (GrPixel == 0xe07f) // sometimes Image Location value doesn't follow
54 GrPixel = 0x7fe0; // the supposed processor endianity.
55 // see gdcmData/cr172241.dcm
56 if (GrPixel != 0x7fe0)
57 // This is a kludge for old dirty Philips imager.
62 TagKey key = gdcmDictEntry::TranslateToKey(GrPixel, NumPixel);
63 countGrPixel = GetEntry().count(key);
69 * @param exception_on_error
71 gdcmHeader::gdcmHeader(bool exception_on_error) :
72 gdcmParser(exception_on_error)
78 * \brief Canonical destructor.
80 gdcmHeader::~gdcmHeader (void) {
83 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
91 * \brief This predicate, based on hopefully reasonable heuristics,
92 * decides whether or not the current gdcmParser was properly parsed
93 * and contains the mandatory information for being considered as
94 * a well formed and usable Dicom/Acr File.
95 * @return true when gdcmParser is the one of a reasonable Dicom/Acr file,
98 bool gdcmHeader::IsReadable(void) {
99 if(!gdcmParser::IsReadable()) {
102 std::string res = GetEntryByNumber(0x0028, 0x0005);
103 if ( res != GDCM_UNFOUND && atoi(res.c_str()) > 4 )
104 return false; // Image Dimensions
105 if ( !GetHeaderEntryByNumber(0x0028, 0x0100) )
106 return false; // "Bits Allocated"
107 if ( !GetHeaderEntryByNumber(0x0028, 0x0101) )
108 return false; // "Bits Stored"
109 if ( !GetHeaderEntryByNumber(0x0028, 0x0102) )
110 return false; // "High Bit"
111 if ( !GetHeaderEntryByNumber(0x0028, 0x0103) )
112 return false; // "Pixel Representation"
117 * \ingroup gdcmHeader
118 * \brief Determines if the Transfer Syntax was already encountered
119 * and if it corresponds to a JPEGBaseLineProcess1 one.
121 * @return True when JPEGBaseLineProcess1found. False in all other cases.
123 bool gdcmHeader::IsJPEGBaseLineProcess1TransferSyntax(void) {
124 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
127 LoadHeaderEntrySafe(Element);
129 std::string Transfer = Element->GetValue();
130 if ( Transfer == "1.2.840.10008.1.2.4.50" )
136 * \ingroup gdcmHeader
137 * \brief Determines if the Transfer Syntax was already encountered
138 * and if it corresponds to a JPEGExtendedProcess2-4 one.
140 * @return True when JPEGExtendedProcess2-4 found. False in all other cases.
142 bool gdcmHeader::IsJPEGExtendedProcess2_4TransferSyntax(void) {
143 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
146 LoadHeaderEntrySafe(Element);
147 return ( Element->GetValue() == "1.2.840.10008.1.2.4.51" );
151 * \ingroup gdcmHeader
152 * \brief Determines if the Transfer Syntax was already encountered
153 * and if it corresponds to a JPEGExtendeProcess3-5 one.
155 * @return True when JPEGExtendedProcess3-5 found. False in all other cases.
157 bool gdcmHeader::IsJPEGExtendedProcess3_5TransferSyntax(void) {
158 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
161 LoadHeaderEntrySafe(Element);
163 std::string Transfer = Element->GetValue();
164 if ( Transfer == "1.2.840.10008.1.2.4.52" )
170 * \ingroup gdcmHeader
171 * \brief Determines if the Transfer Syntax was already encountered
172 * and if it corresponds to a JPEGSpectralSelectionProcess6-8 one.
174 * @return True when JPEGSpectralSelectionProcess6-8 found. False in all
177 bool gdcmHeader::IsJPEGSpectralSelectionProcess6_8TransferSyntax(void) {
178 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
181 LoadHeaderEntrySafe(Element);
183 std::string Transfer = Element->GetValue();
184 if ( Transfer == "1.2.840.10008.1.2.4.53" )
190 * \ingroup gdcmHeader
191 * \brief Determines if the Transfer Syntax was already encountered
192 * and if it corresponds to a RLE Lossless one.
194 * @return True when RLE Lossless found. False in all
197 bool gdcmHeader::IsRLELossLessTransferSyntax(void) {
198 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
201 LoadHeaderEntrySafe(Element);
203 std::string Transfer = Element->GetValue();
204 if ( Transfer == "1.2.840.10008.1.2.5" ) {
211 * \ingroup gdcmHeader
212 * \brief Determines if Transfer Syntax was already encountered
213 * and if it corresponds to a JPEG Lossless one.
215 * @return True when RLE Lossless found. False in all
218 bool gdcmHeader::IsJPEGLossless(void) {
219 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
220 // faire qq chose d'intelligent a la place de ça
223 LoadHeaderEntrySafe(Element);
225 const char * Transfert = Element->GetValue().c_str();
226 if ( memcmp(Transfert+strlen(Transfert)-2 ,"70",2)==0) return true;
227 if ( memcmp(Transfert+strlen(Transfert)-2 ,"55",2)==0) return true;
228 if (Element->GetValue() == "1.2.840.10008.1.2.4.57") return true;
234 * \ingroup gdcmHeader
235 * \brief Determines if the Transfer Syntax was already encountered
236 * and if it corresponds to a JPEG200 one.0
238 * @return True when JPEG2000 (Lossly or LossLess) found. False in all
241 bool gdcmHeader::IsJPEG2000(void) {
242 gdcmHeaderEntry* Element = GetHeaderEntryByNumber(0x0002, 0x0010);
245 LoadHeaderEntrySafe(Element);
247 std::string Transfer = Element->GetValue();
248 if ( (Transfer == "1.2.840.10008.1.2.4.90")
249 || (Transfer == "1.2.840.10008.1.2.4.91") )
255 * \ingroup gdcmHeader
256 * \brief Predicate for dicom version 3 file.
257 * @return True when the file is a dicom version 3.
259 bool gdcmHeader::IsDicomV3(void) {
260 // Checking if Transfert Syntax exists is enough
261 return (GetHeaderEntryByNumber(0x0002, 0x0010) != NULL);
265 * \ingroup gdcmHeader
266 * \brief Retrieve the number of columns of image.
267 * @return The encountered size when found, 0 by default.
268 * 0 means the file is NOT USABLE. The caller will have to check
270 int gdcmHeader::GetXSize(void) {
272 StrSize = GetEntryByNumber(0x0028,0x0011);
273 if (StrSize == GDCM_UNFOUND)
275 return atoi(StrSize.c_str());
279 * \ingroup gdcmHeader
280 * \brief Retrieve the number of lines of image.
281 * \warning The defaulted value is 1 as opposed to gdcmHeader::GetXSize()
282 * @return The encountered size when found, 1 by default
283 * (The file contains a Signal, not an Image).
285 int gdcmHeader::GetYSize(void) {
286 std::string StrSize = GetEntryByNumber(0x0028,0x0010);
287 if (StrSize != GDCM_UNFOUND)
288 return atoi(StrSize.c_str());
292 // The Rows (0028,0010) entry was optional for ACR/NEMA. It might
293 // hence be a signal (1d image). So we default to 1:
298 * \ingroup gdcmHeader
299 * \brief Retrieve the number of planes of volume or the number
300 * of frames of a multiframe.
301 * \warning When present we consider the "Number of Frames" as the third
302 * dimension. When absent we consider the third dimension as
303 * being the "Planes" tag content.
304 * @return The encountered size when found, 1 by default (single image).
306 int gdcmHeader::GetZSize(void) {
307 // Both DicomV3 and ACR/Nema consider the "Number of Frames"
308 // as the third dimension.
309 std::string StrSize = GetEntryByNumber(0x0028,0x0008);
310 if (StrSize != GDCM_UNFOUND)
311 return atoi(StrSize.c_str());
313 // We then consider the "Planes" entry as the third dimension [we
314 // cannot retrieve by name since "Planes tag is present both in
315 // IMG (0028,0012) and OLY (6000,0012) sections of the dictionary].
316 StrSize = GetEntryByNumber(0x0028,0x0012);
317 if (StrSize != GDCM_UNFOUND)
318 return atoi(StrSize.c_str());
323 * \ingroup gdcmHeader
324 * \brief Retrieve the number of Bits Stored (actually used)
325 * (as opposite to number of Bits Allocated)
327 * @return The encountered number of Bits Stored, 0 by default.
328 * 0 means the file is NOT USABLE. The caller has to check it !
330 int gdcmHeader::GetBitsStored(void) {
331 std::string StrSize = GetEntryByNumber(0x0028,0x0101);
332 if (StrSize == GDCM_UNFOUND)
333 return 0; // It's supposed to be mandatory
334 // the caller will have to check
335 return atoi(StrSize.c_str());
339 * \ingroup gdcmHeader
340 * \brief Retrieve the number of Bits Allocated
341 * (8, 12 -compacted ACR-NEMA files, 16, ...)
343 * @return The encountered number of Bits Allocated, 0 by default.
344 * 0 means the file is NOT USABLE. The caller has to check it !
346 int gdcmHeader::GetBitsAllocated(void) { // TODO : move to gdcmFile
347 std::string StrSize = GetEntryByNumber(0x0028,0x0100);
348 if (StrSize == GDCM_UNFOUND)
349 return 0; // It's supposed to be mandatory
350 // the caller will have to check
351 return atoi(StrSize.c_str());
355 * \ingroup gdcmHeader
356 * \brief Retrieve the number of Samples Per Pixel
357 * (1 : gray level, 3 : RGB -1 or 3 Planes-)
359 * @return The encountered number of Samples Per Pixel, 1 by default.
360 * (Gray level Pixels)
362 int gdcmHeader::GetSamplesPerPixel(void) { // TODO : move to gdcmFile
363 std::string StrSize = GetEntryByNumber(0x0028,0x0002);
364 if (StrSize == GDCM_UNFOUND)
365 return 1; // Well, it's supposed to be mandatory ...
366 // but sometimes it's missing : we assume Gray pixels
367 return atoi(StrSize.c_str());
371 * \ingroup gdcmHeader
372 * \brief Retrieve the Planar Configuration for RGB images
373 * (0 : RGB Pixels , 1 : R Plane + G Plane + B Plane)
375 * @return The encountered Planar Configuration, 0 by default.
377 int gdcmHeader::GetPlanarConfiguration(void) {
378 std::string StrSize = GetEntryByNumber(0x0028,0x0006);
379 if (StrSize == GDCM_UNFOUND)
381 return atoi(StrSize.c_str());
385 * \ingroup gdcmHeader
386 * \brief Return the size (in bytes) of a single pixel of data.
387 * @return The size in bytes of a single pixel of data; 0 by default
388 * 0 means the file is NOT USABLE; the caller will have to check
390 int gdcmHeader::GetPixelSize(void) {
391 std::string PixelType = GetPixelType();
392 if (PixelType == "8U" || PixelType == "8S")
394 if (PixelType == "16U" || PixelType == "16S")
396 if (PixelType == "32U" || PixelType == "32S")
398 dbg.Verbose(0, "gdcmHeader::GetPixelSize: Unknown pixel type");
403 * \ingroup gdcmHeader
404 * \brief Build the Pixel Type of the image.
405 * Possible values are:
406 * - 8U unsigned 8 bit,
408 * - 16U unsigned 16 bit,
409 * - 16S signed 16 bit,
410 * - 32U unsigned 32 bit,
411 * - 32S signed 32 bit,
412 * \warning 12 bit images appear as 16 bit.
413 * \ 24 bit images appear as 8 bit
414 * @return 0S if nothing found. NOT USABLE file. The caller has to check
416 std::string gdcmHeader::GetPixelType(void) {
417 std::string BitsAlloc = GetEntryByNumber(0x0028, 0x0100); // Bits Allocated
418 if (BitsAlloc == GDCM_UNFOUND) {
419 dbg.Verbose(0, "gdcmHeader::GetPixelType: unfound Bits Allocated");
420 BitsAlloc = std::string("16");
422 if (BitsAlloc == "12") // It will be unpacked
423 BitsAlloc = std::string("16");
424 else if (BitsAlloc == "24") // (in order no to be messed up
425 BitsAlloc = std::string("8"); // by old RGB images)
427 std::string Signed = GetEntryByNumber(0x0028, 0x0103); // "Pixel Representation"
428 if (Signed == GDCM_UNFOUND) {
429 dbg.Verbose(0, "gdcmHeader::GetPixelType: unfound Pixel Representation");
430 BitsAlloc = std::string("0");
433 Signed = std::string("U");
435 Signed = std::string("S");
437 return( BitsAlloc + Signed);
442 * \ingroup gdcmHeader
443 * \brief Recover the offset (from the beginning of the file)
444 * \ of *image* pixels (not *icone image* pixels, if any !)
446 size_t gdcmHeader::GetPixelOffset(void) {
448 // If the element (0x0088,0x0200) 'icone image sequence' is found
449 // (grPixel,numPixel) is stored twice : the first one for the icon
450 // the second one for the image ...
451 // pb : sometimes , (0x0088,0x0200) exists, but doesn't contain *anything*
452 // see gdcmData/MxTwinLossLess.dcm ...
454 //std::string icone = GetEntryByNumber(0x0088,0x0200); //icone image sequence
456 IterHT it = GetHeaderEntrySameNumber(GrPixel,NumPixel);
457 TagKey key = gdcmDictEntry::TranslateToKey(GrPixel,NumPixel);
458 gdcmHeaderEntry* PixelElement;
459 if (countGrPixel == 1)
460 PixelElement = (it.first)->second;
462 PixelElement = (++it.first)->second; // hope there are no more than 2 !
465 return PixelElement->GetOffset();
468 std::cout << "Big trouble : Pixel Element ("
469 << std::hex << GrPixel<<","<< NumPixel<< ") NOT found"
473 // TODO : unify those two (previous one and next one)
475 * \ingroup gdcmHeader
476 * \brief Recover the pixel area length (in Bytes)
477 * @return Pixel Element Length, as stored in the header
478 * (NOT the memory space necessary to hold the Pixels
479 * - in case of embeded compressed image-)
480 * 0 : NOT USABLE file. The caller has to check.
482 size_t gdcmHeader::GetPixelAreaLength(void) {
484 IterHT it = GetHeaderEntrySameNumber(GrPixel,NumPixel);
485 TagKey key = gdcmDictEntry::TranslateToKey(GrPixel,NumPixel);
486 gdcmHeaderEntry* PixelElement;
489 PixelElement = (it.first)->second;
491 PixelElement = (++it.first)->second;
494 return PixelElement->GetLength();
496 std::cout << "Big trouble : Pixel Element ("
497 << std::hex << GrPixel<<","<< NumPixel<< ") NOT found"
504 * \ingroup gdcmHeader
505 * \brief tells us if LUT are used
506 * \warning Right now, 'Segmented xxx Palette Color Lookup Table Data'
507 * \ are NOT considered as LUT, since nobody knows
508 * \ how to deal with them
511 bool gdcmHeader::HasLUT(void) {
513 // Check the presence of the LUT Descriptors
516 if ( !GetHeaderEntryByNumber(0x0028,0x1101) )
518 // LutDescriptorGreen
519 if ( !GetHeaderEntryByNumber(0x0028,0x1102) )
522 if ( !GetHeaderEntryByNumber(0x0028,0x1103) )
525 // It is not enough :
528 // Red Palette Color Lookup Table Data
529 if ( !GetHeaderEntryByNumber(0x0028,0x1201) )
531 // Green Palette Color Lookup Table Data
532 if ( !GetHeaderEntryByNumber(0x0028,0x1202) )
534 // Blue Palette Color Lookup Table Data
535 if ( !GetHeaderEntryByNumber(0x0028,0x1203) )
541 * \ingroup gdcmHeader
542 * \brief gets the info from 0028,1101 : Lookup Table Desc-Red
544 * @return Lookup Table number of Bits , 0 by default
545 * \ when (0028,0004),Photometric Interpretation = [PALETTE COLOR ]
547 int gdcmHeader::GetLUTNbits(void) {
548 std::vector<std::string> tokens;
552 //Just hope Lookup Table Desc-Red = Lookup Table Desc-Red = Lookup Table Desc-Blue
553 // Consistency already checked in GetLUTLength
554 std::string LutDescription = GetEntryByNumber(0x0028,0x1101);
555 if (LutDescription == GDCM_UNFOUND)
557 tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
558 Tokenize (LutDescription, tokens, "\\");
559 //LutLength=atoi(tokens[0].c_str());
560 //LutDepth=atoi(tokens[1].c_str());
561 LutNbits=atoi(tokens[2].c_str());
567 * \ingroup gdcmHeader
568 * \brief builts Red/Green/Blue/Alpha LUT from Header
569 * \ when (0028,0004),Photometric Interpretation = [PALETTE COLOR ]
570 * \ and (0028,1101),(0028,1102),(0028,1102)
571 * \ - xxx Palette Color Lookup Table Descriptor - are found
572 * \ and (0028,1201),(0028,1202),(0028,1202)
573 * \ - xxx Palette Color Lookup Table Data - are found
574 * \warning does NOT deal with :
575 * \ 0028 1100 Gray Lookup Table Descriptor (Retired)
576 * \ 0028 1221 Segmented Red Palette Color Lookup Table Data
577 * \ 0028 1222 Segmented Green Palette Color Lookup Table Data
578 * \ 0028 1223 Segmented Blue Palette Color Lookup Table Data
579 * \ no known Dicom reader deals with them :-(
580 * @return a RGBA Lookup Table
582 unsigned char * gdcmHeader::GetLUTRGBA(void) {
584 // http://www.barre.nom.fr/medical/dicom2/limitations.html#Color%20Lookup%20Tables
586 // if Photometric Interpretation # PALETTE COLOR, no LUT to be done
587 if (GetEntryByNumber(0x0028,0x0004) != "PALETTE COLOR ") {
590 int lengthR, debR, nbitsR;
591 int lengthG, debG, nbitsG;
592 int lengthB, debB, nbitsB;
594 // Get info from Lut Descriptors
595 // (the 3 LUT descriptors may be different)
596 std::string LutDescriptionR = GetEntryByNumber(0x0028,0x1101);
597 if (LutDescriptionR == GDCM_UNFOUND)
599 std::string LutDescriptionG = GetEntryByNumber(0x0028,0x1102);
600 if (LutDescriptionG == GDCM_UNFOUND)
602 std::string LutDescriptionB = GetEntryByNumber(0x0028,0x1103);
603 if (LutDescriptionB == GDCM_UNFOUND)
606 std::vector<std::string> tokens;
608 tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
609 Tokenize (LutDescriptionR, tokens, "\\");
610 lengthR=atoi(tokens[0].c_str()); // Red LUT length in Bytes
611 debR =atoi(tokens[1].c_str()); // subscript of the first Lut Value
612 nbitsR =atoi(tokens[2].c_str()); // Lut item size (in Bits)
615 tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
616 Tokenize (LutDescriptionG, tokens, "\\");
617 lengthG=atoi(tokens[0].c_str()); // Green LUT length in Bytes
618 debG =atoi(tokens[1].c_str()); // subscript of the first Lut Value
619 nbitsG =atoi(tokens[2].c_str()); // Lut item size (in Bits)
622 tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
623 Tokenize (LutDescriptionB, tokens, "\\");
624 lengthB=atoi(tokens[0].c_str()); // Blue LUT length in Bytes
625 debB =atoi(tokens[1].c_str()); // subscript of the first Lut Value
626 nbitsB =atoi(tokens[2].c_str()); // Lut item size (in Bits)
629 // Load LUTs into memory, (as they were stored on disk)
630 unsigned char *lutR = (unsigned char *)
631 GetEntryVoidAreaByNumber(0x0028,0x1201);
632 unsigned char *lutG = (unsigned char *)
633 GetEntryVoidAreaByNumber(0x0028,0x1202);
634 unsigned char *lutB = (unsigned char *)
635 GetEntryVoidAreaByNumber(0x0028,0x1203);
637 if (!lutR || !lutG || !lutB ) {
640 // forge the 4 * 8 Bits Red/Green/Blue/Alpha LUT
642 unsigned char *LUTRGBA = (unsigned char *)calloc(1024,1); // 256 * 4 (R, G, B, Alpha)
646 memset(LUTRGBA, 0, 1024);
649 std::string str_nb = GetEntryByNumber(0x0028,0x0100);
650 if (str_nb == GDCM_UNFOUND ) {
653 nb = atoi(str_nb.c_str() );
657 if (nbitsR==16 && nb==8) // when LUT item size is different than pixel size
658 mult=2; // high byte must be = low byte
659 else // See PS 3.3-2003 C.11.1.1.2 p 619
662 // if we get a black image, let's just remove the '+1'
663 // from 'i*mult+1' and check again
664 // if it works, we shall have to check the 3 Palettes
665 // to see which byte is ==0 (first one, or second one)
667 // We give up the checking to avoid some (useless ?)overhead
668 // (optimistic asumption)
673 for(i=0;i<lengthR;i++) {
678 for(i=0;i<lengthG;i++) {
683 for(i=0;i<lengthB;i++) {
689 *a = 1; // Alpha component
693 //How to free the now useless LUTs?
694 //free(LutR); free(LutB); free(LutG); // Seg Fault when used
699 * \ingroup gdcmHeader
700 * \brief gets the info from 0002,0010 : Transfert Syntax
702 * @return Transfert Syntax Name (as oposite to Transfert Syntax UID)
704 std::string gdcmHeader::GetTransfertSyntaxName(void) {
705 // use the gdcmTS (TS : Transfert Syntax)
706 std::string TransfertSyntax = GetEntryByNumber(0x0002,0x0010);
707 if (TransfertSyntax == GDCM_UNFOUND) {
708 dbg.Verbose(0, "gdcmHeader::GetTransfertSyntaxName: unfound Transfert Syntax (0002,0010)");
709 return "Uncompressed ACR-NEMA";
711 // we do it only when we need it
712 gdcmTS * ts = gdcmGlobal::GetTS();
713 std::string tsName=ts->GetValue(TransfertSyntax);
714 //delete ts; // Seg Fault when deleted ?!
720 * \brief Sets the Pixel Area size in the Header
721 * --> not-for-rats function
723 * \warning WARNING doit-etre etre publique ?
724 * TODO : y aurait il un inconvenient à fusionner ces 2 fonctions
726 * @param ImageDataSize new Pixel Area Size
727 * warning : nothing else is checked
729 void gdcmHeader::SetImageDataSize(size_t ImageDataSize) {
730 std::string content1;
733 // Assumes HeaderEntry (GrPixel, NumPixel) is unique ...
734 // TODO deal with multiplicity (see gdcmData/icone.dcm)
735 sprintf(car,"%d",ImageDataSize);
737 gdcmHeaderEntry *a = GetHeaderEntryByNumber(GrPixel, NumPixel);
738 a->SetLength(ImageDataSize);
741 sprintf(car,"%d",ImageDataSize);
743 SetEntryByNumber(content1, GrPixel, NumPixel);
746 bool gdcmHeader::operator<(gdcmHeader &header)
751 s1=this->GetEntryByNumber(0x0010,0x0010);
752 s2=header.GetEntryByNumber(0x0010,0x0010);
760 s1=this->GetEntryByNumber(0x0010,0x0020);
761 s2=header.GetEntryByNumber(0x0010,0x0020);
768 // Study Instance UID
769 s1=this->GetEntryByNumber(0x0020,0x000d);
770 s2=header.GetEntryByNumber(0x0020,0x000d);
777 // Serie Instance UID
778 s1=this->GetEntryByNumber(0x0020,0x000e);
779 s2=header.GetEntryByNumber(0x0020,0x000e);
790 //-----------------------------------------------------------------------------
793 //-----------------------------------------------------------------------------
796 //-----------------------------------------------------------------------------