MCPcopy Create free account
hub / github.com/DentonW/DevIL / SkipElement

Function SkipElement

DevIL/src-IL/src/il_dicom.cpp:259–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258
259ILboolean SkipElement(DICOMHEAD *Header, ILushort GroupNum, ILushort ElementNum)
260{
261 ILubyte VR1, VR2;
262 ILuint ValLen;
263
264 // 2 byte character string telling what type this element is ('OB', 'UI', etc.)
265 VR1 = igetc();
266 VR2 = igetc();
267
268 if ((VR1 == 'O' && VR2 == 'B') || (VR1 == 'O' && VR2 == 'W') || (VR1 == 'O' && VR2 == 'F') ||
269 (VR1 == 'S' && VR2 == 'Q') || (VR1 == 'U' && VR2 == 'T') || (VR1 == 'U' && VR2 == 'N')) {
270 // These all have a different format than the other formats, since they can be up to 32 bits long.
271 GetLittleUShort(); // Values reserved, we do not care about them.
272 ValLen = GetInt(Header, GroupNum);//GetLittleUInt(); // Length of the rest of the element
273 if (ValLen % 2) // This length must be even, according to the specs.
274 return IL_FALSE;
275 if (ElementNum != 0x00) // Element numbers of 0 tell the size of the full group, so we do not skip this.
276 // @TODO: We could use this to skip groups that we do not care about.
277 if (iseek(ValLen, IL_SEEK_CUR))
278 return IL_FALSE;
279 }
280 else {
281 // These have a length of 16 bits.
282 ValLen = GetShort(Header, GroupNum);//GetLittleUShort();
283 //if (ValLen % 2) // This length must be even, according to the specs.
284 // ValLen++; // Add the extra byte to seek.
285 //if (ElementNum != 0x00) // Element numbers of 0 tell the size of the full group, so we do not skip this.
286 // @TODO: We could use this to skip groups that we do not care about.
287 if (iseek(ValLen, IL_SEEK_CUR))
288 return IL_FALSE;
289 }
290
291 return IL_TRUE;
292}
293
294
295ILuint GetGroupNum(DICOMHEAD *Header)

Callers 1

iGetDicomHeadFunction · 0.85

Calls 3

GetLittleUShortFunction · 0.85
GetIntFunction · 0.85
GetShortFunction · 0.85

Tested by

no test coverage detected