comparison Framework/Toolbox/DicomStructureSet.cpp @ 121:e66b2c757790 wasm

displaying rt-struct
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Oct 2017 17:53:47 +0200
parents a4d0b6c82b29
children e3433dabfb8d
comparison
equal deleted inserted replaced
120:063f7f3d9f14 121:e66b2c757790
230 230
231 size_t countSlices; 231 size_t countSlices;
232 if (!tags.GetSequenceSize(countSlices, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i, 232 if (!tags.GetSequenceSize(countSlices, DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
233 DICOM_TAG_CONTOUR_SEQUENCE))) 233 DICOM_TAG_CONTOUR_SEQUENCE)))
234 { 234 {
235 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); 235 countSlices = 0;
236 } 236 }
237 237
238 LOG(WARNING) << "New RT structure: \"" << structures_[i].name_ 238 LOG(WARNING) << "New RT structure: \"" << structures_[i].name_
239 << "\" with interpretation \"" << structures_[i].interpretation_ 239 << "\" with interpretation \"" << structures_[i].interpretation_
240 << "\" containing " << countSlices << " slices (color: " 240 << "\" containing " << countSlices << " slices (color: "
251 DICOM_TAG_NUMBER_OF_CONTOUR_POINTS))) 251 DICOM_TAG_NUMBER_OF_CONTOUR_POINTS)))
252 { 252 {
253 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); 253 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
254 } 254 }
255 255
256 LOG(INFO) << "Parsing slice containing " << countPoints << " vertices"; 256 //LOG(INFO) << "Parsing slice containing " << countPoints << " vertices";
257 257
258 std::string type = reader.GetMandatoryStringValue(DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i, 258 std::string type = reader.GetMandatoryStringValue(DicomPath(DICOM_TAG_ROI_CONTOUR_SEQUENCE, i,
259 DICOM_TAG_CONTOUR_SEQUENCE, j, 259 DICOM_TAG_CONTOUR_SEQUENCE, j,
260 DICOM_TAG_CONTOUR_GEOMETRIC_TYPE)); 260 DICOM_TAG_CONTOUR_GEOMETRIC_TYPE));
261 if (type != "CLOSED_PLANAR") 261 if (type != "CLOSED_PLANAR")
369 cairo_t* cr = context.GetObject(); 369 cairo_t* cr = context.GetObject();
370 370
371 for (Structures::const_iterator structure = structures_.begin(); 371 for (Structures::const_iterator structure = structures_.begin();
372 structure != structures_.end(); ++structure) 372 structure != structures_.end(); ++structure)
373 { 373 {
374 if (structure->name_ != "SKIN" &&
375 structure->name_ != "HEART" &&
376 //structure->name_ != "CORD" &&
377 structure->name_ != "ESOPHAGUS" &&
378 structure->name_ != "LUNG_LT" &&
379 structure->name_ != "LUNG_RT" &&
380 structure->name_ != "GTV_EXH_PRIMARY" &&
381 structure->name_ != "GTV_INH_PRIMARY" &&
382 structure->name_ != "GTV_PRIMARY")
383 {
384 continue;
385 }
386
374 for (Polygons::const_iterator polygon = structure->polygons_.begin(); 387 for (Polygons::const_iterator polygon = structure->polygons_.begin();
375 polygon != structure->polygons_.end(); ++polygon) 388 polygon != structure->polygons_.end(); ++polygon)
376 { 389 {
377 if (IsPolygonOnSlice(*polygon, slice)) 390 if (IsPolygonOnSlice(*polygon, slice))
378 { 391 {
392 ++p; 405 ++p;
393 } 406 }
394 407
395 slice.ProjectPoint(x, y, *polygon->points_.begin()); 408 slice.ProjectPoint(x, y, *polygon->points_.begin());
396 cairo_line_to(cr, x, y); 409 cairo_line_to(cr, x, y);
410
411 cairo_stroke(cr);
397 } 412 }
398 } 413 }
399 } 414 }
400
401 cairo_stroke(cr);
402 } 415 }
403 } 416 }