| 701 | } |
| 702 | |
| 703 | void 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 |