| 109 | } |
| 110 | |
| 111 | bool DICOMParser::ReadHeader() |
| 112 | { |
| 113 | bool dicom = DICOMParser::IsDICOMFile(this->DataFile); |
| 114 | if (!dicom) |
| 115 | { |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | this->TransferSyntaxCB->SetCallbackFunction(this, &DICOMParser::TransferSyntaxCallback); |
| 120 | this->AddDICOMTagCallback(0x0002, 0x0010, DICOMParser::VR_UI, this->TransferSyntaxCB); |
| 121 | |
| 122 | this->ToggleByteSwapImageData = false; |
| 123 | |
| 124 | doublebyte group = 0; |
| 125 | doublebyte element = 0; |
| 126 | DICOMParser::VRTypes datatype = DICOMParser::VR_UNKNOWN; |
| 127 | |
| 128 | this->Implementation->Groups.clear(); |
| 129 | this->Implementation->Elements.clear(); |
| 130 | this->Implementation->Datatypes.clear(); |
| 131 | |
| 132 | long fileSize = DataFile->GetSize(); |
| 133 | do |
| 134 | { |
| 135 | this->ReadNextRecord(group, element, datatype); |
| 136 | |
| 137 | this->Implementation->Groups.push_back(group); |
| 138 | this->Implementation->Elements.push_back(element); |
| 139 | this->Implementation->Datatypes.push_back(datatype); |
| 140 | |
| 141 | } while ((DataFile->Tell() >= 0) && (DataFile->Tell() < fileSize)); |
| 142 | |
| 143 | return true; |
| 144 | } |
| 145 | |
| 146 | // |
| 147 | // read magic number from file |
nothing calls this directly
no test coverage detected