comparison Framework/Inputs/DicomPyramidInstance.cpp @ 269:30fb01ce97a3 iiif

integration mainline->iiif
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Jul 2023 16:23:46 +0200
parents dab414e5b520 a6e4834ac141
children 7020852a8fa9
comparison
equal deleted inserted replaced
266:ca605878dc73 269:30fb01ce97a3
188 { 188 {
189 LOG(ERROR) << "Mismatch between the number of frames in instance: " << instanceId; 189 LOG(ERROR) << "Mismatch between the number of frames in instance: " << instanceId;
190 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); 190 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
191 } 191 }
192 192
193 frames_.resize(countFrames); 193 frames_.reserve(countFrames);
194 194
195 for (size_t i = 0; i < countFrames; i++) 195 for (size_t i = 0; i < countFrames; i++)
196 { 196 {
197 Orthanc::DicomPath pathX(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i, 197 Orthanc::DicomPath pathX(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
198 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0, 198 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
223 x >= totalWidth_ || 223 x >= totalWidth_ ||
224 y >= totalHeight_) 224 y >= totalHeight_)
225 { 225 {
226 LOG(ERROR) << "Frame " << i << " with unexpected tile location (" 226 LOG(ERROR) << "Frame " << i << " with unexpected tile location ("
227 << x << "," << y << ") in instance: " << instanceId; 227 << x << "," << y << ") in instance: " << instanceId;
228 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
229 } 228 }
230 229 else
231 frames_[i].first = x / tileWidth_; 230 {
232 frames_[i].second = y / tileHeight_; 231 frames_.push_back(std::make_pair(x / tileWidth_, y / tileHeight_));
232 }
233 } 233 }
234 } 234 }
235 else 235 else
236 { 236 {
237 // No "Per frame functional groups sequence" tag. Assume regular grid. 237 // No "Per frame functional groups sequence" tag. Assume regular grid.