Walk the DICOM private-creator block of a private group looking for a creator-string match. Returns the offset shift (creator_element << 8) on hit, or 0xFFFF on miss.
| 103 | // a creator-string match. Returns the offset shift |
| 104 | // (creator_element << 8) on hit, or 0xFFFF on miss. |
| 105 | Uint16 FindPrivateCreatorOffset(DcmDataset* dataset, Uint16 group, const char* creator) |
| 106 | { |
| 107 | for (Uint16 elem = 0x10; elem <= 0xFF; ++elem) |
| 108 | { |
| 109 | OFString value; |
| 110 | if (dataset->findAndGetOFString(DcmTagKey(group, elem), value).good()) |
| 111 | { |
| 112 | if (value == creator) |
| 113 | { |
| 114 | return static_cast<Uint16>(elem << 8); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | return 0xFFFF; |
| 119 | } |
| 120 | |
| 121 | std::string ReadPrivateString(DcmDataset* dataset, Uint16 group, |
| 122 | const char* creator, Uint16 elementOffset) |