MCPcopy Create free account
hub / github.com/Kitware/VTK / ArrayCallback

Method ArrayCallback

Utilities/DICOMParser/DICOMAppHelper.cxx:347–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void DICOMAppHelper::ArrayCallback(DICOMParser* parser, doublebyte group, doublebyte element,
348 DICOMParser::VRTypes datatype, unsigned char* val, quadbyte len)
349{
350 const char* desc = "No description";
351
352 TagMapType::iterator iter =
353 this->Implementation->TagMap.find(std::pair<doublebyte, doublebyte>(group, element));
354 if (iter != this->Implementation->TagMap.end())
355 {
356 desc = (*iter).second.description;
357 }
358
359 int t2 = (0x0000FF00 & datatype) >> 8;
360 int t1 = int((0x000000FF & datatype));
361
362 char ct2 = static_cast<char>(t2);
363 char ct1 = static_cast<char>(t1);
364
365 *this->HeaderFile << "(0x";
366
367 this->HeaderFile->width(4);
368 char prev = this->HeaderFile->fill('0');
369
370 *this->HeaderFile << std::hex << group;
371 *this->HeaderFile << ",0x";
372
373 this->HeaderFile->width(4);
374 this->HeaderFile->fill('0');
375
376 *this->HeaderFile << std::hex << element;
377 *this->HeaderFile << ") ";
378
379 this->HeaderFile->fill(prev);
380 *this->HeaderFile << std::dec;
381 *this->HeaderFile << " " << ct1 << ct2 << " ";
382 *this->HeaderFile << "[" << len << " bytes] ";
383
384 *this->HeaderFile << desc << " : ";
385
386 unsigned int uival = 0;
387 float fval = 0;
388 double dval = 0;
389 int ival = 0;
390
391 if (val)
392 {
393 switch (datatype)
394 {
395 case DICOMParser::VR_AE:
396 case DICOMParser::VR_AS:
397 case DICOMParser::VR_CS:
398 case DICOMParser::VR_UI:
399 case DICOMParser::VR_DA:
400 case DICOMParser::VR_DS:
401 case DICOMParser::VR_DT:
402 case DICOMParser::VR_LO:
403 case DICOMParser::VR_LT:
404 case DICOMParser::VR_OB: // ordered bytes

Callers

nothing calls this directly

Calls 7

ReturnAsSignedShortFunction · 0.85
ReturnAsUnsignedShortFunction · 0.85
widthMethod · 0.80
findMethod · 0.45
endMethod · 0.45
fillMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected