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

Method ReadHeader

Utilities/DICOMParser/DICOMParser.cxx:111–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bool 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

Callers

nothing calls this directly

Calls 8

AddDICOMTagCallbackMethod · 0.95
ReadNextRecordMethod · 0.95
IsDICOMFileFunction · 0.85
SetCallbackFunctionMethod · 0.80
clearMethod · 0.45
GetSizeMethod · 0.45
push_backMethod · 0.45
TellMethod · 0.45

Tested by

no test coverage detected