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

Method SliceNumberCallback

Utilities/DICOMParser/DICOMAppHelper.cxx:462–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462void DICOMAppHelper::SliceNumberCallback(
463 DICOMParser* parser, doublebyte, doublebyte, DICOMParser::VRTypes, unsigned char* val, quadbyte)
464{
465 // Look for the current file in the map of slice ordering data
466 std::map<std::string, DICOMOrderingElements, ltstdstr>::iterator it;
467 it = this->Implementation->SliceOrderingMap.find(parser->GetFileName());
468 if (it == Implementation->SliceOrderingMap.end())
469 {
470 // file not found, create a new entry
471 DICOMOrderingElements ord;
472 if (val)
473 {
474 ord.SliceNumber =
475 vtk::scan_int<int>(std::string_view(reinterpret_cast<const char*>(val)))->value();
476 }
477 else // Slice Number present but empty
478 {
479 ord.SliceNumber = 0;
480 }
481
482 // insert into the map
483 this->Implementation->SliceOrderingMap.insert(
484 std::pair<const std::string, DICOMOrderingElements>(parser->GetFileName(), ord));
485 }
486 else
487 {
488 // file found, add new values
489 if (val)
490 {
491 (*it).second.SliceNumber =
492 vtk::scan_int<int>(std::string_view(reinterpret_cast<const char*>(val)))->value();
493 }
494 else // Slice Number present but empty
495 {
496 (*it).second.SliceNumber = 0;
497 }
498 }
499
500 // cache the slice number
501 if (val)
502 {
503 this->SliceNumber =
504 vtk::scan_int<int>(std::string_view(reinterpret_cast<const char*>(val)))->value();
505 }
506 else // Slice Number present but empty
507 {
508 this->SliceNumber = 0;
509 }
510}
511
512void DICOMAppHelper::SliceLocationCallback(
513 DICOMParser* parser, doublebyte, doublebyte, DICOMParser::VRTypes, unsigned char* val, quadbyte)

Callers

nothing calls this directly

Calls 5

findMethod · 0.45
GetFileNameMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected