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

Method TransferSyntaxCallback

Utilities/DICOMParser/DICOMAppHelper.cxx:658–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658void DICOMAppHelper::TransferSyntaxCallback(
659 DICOMParser* parser, doublebyte, doublebyte, DICOMParser::VRTypes, unsigned char* val, quadbyte)
660{
661
662#ifdef DEBUG_DICOM_APP_HELPER
663#ifdef _WIN32
664 char platformByteOrder = 'L';
665#else
666 char platformByteOrder = 'B';
667#endif
668 std::cout << "Platform byte order: " << platformByteOrder << std::endl;
669#endif
670
671 static const char* TRANSFER_UID_EXPLICIT_BIG_ENDIAN = "1.2.840.10008.1.2.2";
672
673 // Only add the ToggleSwapBytes callback when we need it.
674 if (strcmp(TRANSFER_UID_EXPLICIT_BIG_ENDIAN, reinterpret_cast<char*>(val)) == 0)
675 {
676 this->ByteSwapData = true;
677 parser->AddDICOMTagCallback(0x0800, 0x0000, DICOMParser::VR_UNKNOWN, ToggleSwapBytesCB);
678#ifdef DEBUG_DICOM_APP_HELPER
679 std::cerr << "Registering callback for swapping bytes." << std::endl;
680#endif
681 }
682
683 delete this->TransferSyntaxUID;
684 this->TransferSyntaxUID = new std::string(reinterpret_cast<char*>(val));
685
686#ifdef DEBUG_DICOM_APP_HELPER
687 std::cout << "Transfer Syntax UID: " << *this->TransferSyntaxUID;
688 std::cout << " " << this->TransferSyntaxUIDDescription(this->TransferSyntaxUID->c_str())
689 << std::endl;
690#endif
691}
692
693void DICOMAppHelper::BitsAllocatedCallback(
694 DICOMParser* parser, doublebyte, doublebyte, DICOMParser::VRTypes, unsigned char* val, quadbyte)

Callers

nothing calls this directly

Calls 3

AddDICOMTagCallbackMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected