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

Method ToggleSwapBytesCallback

Utilities/DICOMParser/DICOMAppHelper.cxx:703–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703void DICOMAppHelper::ToggleSwapBytesCallback(
704 DICOMParser* parser, doublebyte, doublebyte, DICOMParser::VRTypes, unsigned char*, quadbyte len)
705{
706#ifdef DEBUG_DICOM_APP_HELPER
707 std::cout << "ToggleSwapBytesCallback" << std::endl;
708#endif
709 bool bs = parser->GetDICOMFile()->GetPlatformIsBigEndian();
710 parser->GetDICOMFile()->SetPlatformIsBigEndian(!bs);
711
712#ifdef DEBUG_DICOM_APP_HELPER
713 std::cout << "Set byte swap to: " << parser->GetDICOMFile()->GetPlatformIsBigEndian()
714 << std::endl;
715#endif
716
717 long pos = parser->GetDICOMFile()->Tell();
718
719 //
720 // The +4 is probably a hack, but it's a guess at the length of the previous field.
721 //
722 parser->GetDICOMFile()->SkipToPos(pos - len + 4);
723}
724
725//
726// 0028,0030 is Pixel Spacing, which is NOT the pixel spacing for modality such as US, or X-ray

Callers

nothing calls this directly

Calls 2

SkipToPosMethod · 0.80
TellMethod · 0.45

Tested by

no test coverage detected