Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
Medical Imaging Interaction Toolkit
mitkSemanticRelationsInference.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 // semantic relations module
17 #include "mitkDICOMHelper.h"
18 #include "mitkNodePredicates.h"
19 #include "mitkRelationStorage.h"
21 
22 /************************************************************************/
23 /* functions to get instances / attributes */
24 /************************************************************************/
25 
27 {
29  SemanticTypes::LesionClassVector allLesionClassesOfCase;
30 
31  for (const auto& lesion : allLesionsOfCase)
32  {
33  allLesionClassesOfCase.push_back(lesion.lesionClass);
34  }
35 
36  // remove duplicate entries
37  auto lessThan = [](const SemanticTypes::LesionClass& lesionClassLeft, const SemanticTypes::LesionClass& lesionClassRight)
38  {
39  return lesionClassLeft.UID < lesionClassRight.UID;
40  };
41 
42  auto equal = [](const SemanticTypes::LesionClass& lesionClassLeft, const SemanticTypes::LesionClass& lesionClassRight)
43  {
44  return lesionClassLeft.UID == lesionClassRight.UID;
45  };
46 
47  std::sort(allLesionClassesOfCase.begin(), allLesionClassesOfCase.end(), lessThan);
48  allLesionClassesOfCase.erase(std::unique(allLesionClassesOfCase.begin(), allLesionClassesOfCase.end(), equal), allLesionClassesOfCase.end());
49 
50  return allLesionClassesOfCase;
51 }
52 
54 {
55  if (nullptr == segmentationNode)
56  {
57  mitkThrowException(SemanticRelationException) << "Not a valid segmentation data node.";
58  }
59 
60  SemanticTypes::CaseID caseID = "";
61  SemanticTypes::ID segmentationID = "";
62  try
63  {
64  caseID = GetCaseIDFromDataNode(segmentationNode);
65  segmentationID = GetIDFromDataNode(segmentationNode);
66  }
67  catch (SemanticRelationException& e)
68  {
69  mitkReThrow(e) << "Cannot get the lesion of the given segmentation data node.";
70  }
71 
72  return RelationStorage::GetLesionOfSegmentation(caseID, segmentationID);
73 }
74 
76 {
77  if (nullptr == imageNode)
78  {
79  mitkThrowException(SemanticRelationException) << "Not a valid image data node.";
80  }
81 
82  SemanticTypes::CaseID caseID = "";
83  SemanticTypes::ID imageID = "";
84  try
85  {
86  caseID = GetCaseIDFromDataNode(imageNode);
87  imageID = GetIDFromDataNode(imageNode);
88  }
89  catch (SemanticRelationException& e)
90  {
91  mitkReThrow(e) << "Cannot get all lesions of the given image data node.";
92  }
93 
94  SemanticTypes::LesionVector allLesionsOfImage;
95  // 1. get all segmentations that are connected to the given image
96  // 2. get the lesion of each segmentation
97  // 3. guarantee uniqueness of lesions
98  SemanticTypes::IDVector allSegmentationIDsOfImage = RelationStorage::GetAllSegmentationIDsOfImage(caseID, imageID);
99  for (const auto& segmentationID : allSegmentationIDsOfImage)
100  {
101  // get represented lesion of the current segmentation
102  SemanticTypes::Lesion representedLesion = RelationStorage::GetLesionOfSegmentation(caseID, segmentationID);
103  if (!representedLesion.UID.empty())
104  {
105  allLesionsOfImage.push_back(representedLesion);
106  }
107  }
108 
109  // remove duplicate entries
110  auto lessThan = [](const SemanticTypes::Lesion& lesionLeft, const SemanticTypes::Lesion& lesionRight)
111  {
112  return lesionLeft.UID < lesionRight.UID;
113  };
114 
115  auto equal = [](const SemanticTypes::Lesion& lesionLeft, const SemanticTypes::Lesion& lesionRight)
116  {
117  return lesionLeft.UID == lesionRight.UID;
118  };
119 
120  std::sort(allLesionsOfImage.begin(), allLesionsOfImage.end(), lessThan);
121  allLesionsOfImage.erase(std::unique(allLesionsOfImage.begin(), allLesionsOfImage.end(), equal), allLesionsOfImage.end());
122 
123  return allLesionsOfImage;
124 }
125 
127 {
129 
130  // filter the lesions: use only those, where the associated data is connected to image data that refers to the given control point using a lambda function
131  auto lambda = [&caseID, &controlPoint](const SemanticTypes::Lesion& lesion)
132  {
133  return !SpecificImageExists(caseID, lesion, controlPoint);
134  };
135 
136  allLesions.erase(std::remove_if(allLesions.begin(), allLesions.end(), lambda), allLesions.end());
137 
138  return allLesions;
139 }
140 
142 {
144 
145  // filter the lesions: use only those, where the associated data is connected to image data that refers to the given information type using a lambda function
146  auto lambda = [&caseID, &informationType](const SemanticTypes::Lesion& lesion)
147  {
148  return !SpecificImageExists(caseID, lesion, informationType);
149  };
150 
151  allLesions.erase(std::remove_if(allLesions.begin(), allLesions.end(), lambda), allLesions.end());
152 
153  return allLesions;
154 }
155 
157 {
158  auto allLesionsOfControlPoint = GetAllLesionsOfControlPoint(caseID, controlPoint);
159  auto allLesionsOfInformationType = GetAllLesionsOfInformationType(caseID, informationType);
160  SemanticTypes::LesionVector allLesionsIntersection;
161 
162  auto lessThan = [](const SemanticTypes::Lesion& lesionLeft, const SemanticTypes::Lesion& lesionRight)
163  {
164  return lesionLeft.UID < lesionRight.UID;
165  };
166 
167  auto equal = [](const SemanticTypes::Lesion& lesionLeft, const SemanticTypes::Lesion& lesionRight)
168  {
169  return lesionLeft.UID == lesionRight.UID;
170  };
171 
172  std::sort(allLesionsOfControlPoint.begin(), allLesionsOfControlPoint.end(), lessThan);
173  std::sort(allLesionsOfInformationType.begin(), allLesionsOfInformationType.end(), lessThan);
174  SemanticTypes::IDVector allImageIDsIntersection;
175  // set_intersection removes duplicated nodes
176  std::set_intersection(allLesionsOfControlPoint.begin(), allLesionsOfControlPoint.end(),
177  allLesionsOfInformationType.begin(), allLesionsOfInformationType.end(),
178  std::back_inserter(allLesionsIntersection), equal);
179 
180  return allLesionsIntersection;
181 }
182 
184 {
185  SemanticTypes::Lesion representedLesion;
186  try
187  {
188  representedLesion = GetLesionOfSegmentation(segmentationNode);
189  }
190  catch (const SemanticRelationException&)
191  {
192  return false;
193  }
194 
195  return !representedLesion.UID.empty();
196 }
197 
199 {
200  SemanticTypes::Lesion representedLesion = RelationStorage::GetLesionOfSegmentation(caseID, segmentationID);
201  return !representedLesion.UID.empty();
202 }
203 
205 {
206  SemanticTypes::CaseID caseID = "";
207  SemanticTypes::ID dataNodeID = "";
208  try
209  {
210  caseID = GetCaseIDFromDataNode(dataNode);
211  dataNodeID = GetIDFromDataNode(dataNode);
212  }
213  catch (const SemanticRelationException&)
214  {
215  return false;
216  }
217 
218  if (NodePredicates::GetImagePredicate()->CheckNode(dataNode))
219  {
220  return IsLesionPresentOnImage(caseID, lesion, dataNodeID);
221  }
222 
223  if (NodePredicates::GetSegmentationPredicate()->CheckNode(dataNode))
224  {
225  return IsLesionPresentOnSegmentation(caseID, lesion, dataNodeID);
226  }
227 
228  return false;
229 }
230 
232 {
233  SemanticTypes::IDVector allImageIDsOfLesion;
234  try
235  {
236  allImageIDsOfLesion = GetAllImageIDsOfLesion(caseID, lesion);
237  }
238  catch (SemanticRelationException& e)
239  {
240  mitkReThrow(e) << "Cannot get all image IDs of the given lesion to determine the lesion presence.";
241  }
242 
243  for (const auto& imageIDOfLesion : allImageIDsOfLesion)
244  {
245  if (imageIDOfLesion == imageID)
246  {
247  return true;
248  }
249  }
250 
251  return false;
252 }
253 
255 {
256  const auto representedLesion = RelationStorage::GetLesionOfSegmentation(caseID, segmentationID);
257  return lesion.UID == representedLesion.UID;
258 }
259 
261 {
262  SemanticTypes::IDVector allImageIDsOfLesion;
263  try
264  {
265  allImageIDsOfLesion = GetAllImageIDsOfLesion(caseID, lesion);
266  }
267  catch (SemanticRelationException& e)
268  {
269  mitkReThrow(e) << "Cannot get all image IDs of the given lesion to determine the lesion presence.";
270  }
271 
272  for (const auto& imageIDOfLesion : allImageIDsOfLesion)
273  {
274  auto imageControlPoint = RelationStorage::GetControlPointOfImage(caseID, imageIDOfLesion);
275  if (imageControlPoint.date == controlPoint.date)
276  {
277  return true;
278  }
279  }
280 
281  return false;
282 }
283 
285 {
286  SemanticTypes::CaseID caseID = "";
287  SemanticTypes::ID dataNodeID = "";
288  try
289  {
290  caseID = GetCaseIDFromDataNode(dataNode);
291  dataNodeID = GetIDFromDataNode(dataNode);
292  }
293  catch (const SemanticRelationException&)
294  {
295  return false;
296  }
297 
298  if (NodePredicates::GetImagePredicate()->CheckNode(dataNode))
299  {
301  return std::find(allImageIDsOfCase.begin(), allImageIDsOfCase.end(), dataNodeID) != allImageIDsOfCase.end();
302  }
303 
304  if (NodePredicates::GetSegmentationPredicate()->CheckNode(dataNode))
305  {
307  return std::find(allSegmentationIDsOfCase.begin(), allSegmentationIDsOfCase.end(), dataNodeID) != allSegmentationIDsOfCase.end();
308  }
309 
310  return false;
311 }
312 
314 {
316 
317  // filter all lesions: check for equality with the given lesion using a lambda function
318  auto lambda = [&lesion](const SemanticTypes::Lesion& currentLesion)
319  {
320  return currentLesion.UID == lesion.UID;
321  };
322 
323  const auto existingLesion = std::find_if(allLesions.begin(), allLesions.end(), lambda);
324 
325  return existingLesion != allLesions.end();
326 }
327 
329 {
330  if (!InstanceExists(caseID, lesion))
331  {
332  mitkThrowException(SemanticRelationException) << "Could not find an existing lesion instance for the given caseID " << caseID << " and lesion " << lesion.UID << ".";
333  }
334 
335  SemanticTypes::IDVector allImageIDsOfLesion;
336  // 1. get all segmentations that define the lesion
337  // 2. get the parentID (imageID) of each segmentation
338  // 3. guarantee uniqueness of image IDs
339  SemanticTypes::IDVector allSegmentationIDsOfLesion = RelationStorage::GetAllSegmentationIDsOfLesion(caseID, lesion);
340  for (const auto& segmentationID : allSegmentationIDsOfLesion)
341  {
342  // get parent ID of the current segmentation ID
343  SemanticTypes::ID imageID = RelationStorage::GetImageIDOfSegmentation(caseID, segmentationID);
344  if(!imageID.empty())
345  {
346  allImageIDsOfLesion.push_back(imageID);
347  }
348  }
349 
350  std::sort(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end());
351  allImageIDsOfLesion.erase(std::unique(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end()), allImageIDsOfLesion.end());
352 
353  return allImageIDsOfLesion;
354 }
355 
357 {
358  if (!InstanceExists(caseID, examinationPeriod))
359  {
360  mitkThrowException(SemanticRelationException) << "Could not find an existing examination period for the given caseID " << caseID << " and examination period " << examinationPeriod.name << ".";
361  }
362 
363  SemanticTypes::IDVector allImageIDsOfExaminationPeriod;
364  // 1. get all control point UIDs of the examination period
365  // 2. get all images of each control points to find all images of the examination period
366  SemanticTypes::ControlPoint controlPoint;
367  for (const auto& controlPointUID : examinationPeriod.controlPointUIDs)
368  {
369  controlPoint = GetControlPointByUID(caseID, controlPointUID);
370  auto allImageIDsOfControlPoint = RelationStorage::GetAllImageIDsOfControlPoint(caseID, controlPoint);
371  allImageIDsOfExaminationPeriod.insert(allImageIDsOfExaminationPeriod.end(), allImageIDsOfControlPoint.begin(), allImageIDsOfControlPoint.end());
372  }
373 
374  return allImageIDsOfExaminationPeriod;
375 }
376 
378 {
379  if (nullptr == imageNode)
380  {
381  mitkThrowException(SemanticRelationException) << "Not a valid data node.";
382  }
383 
384  SemanticTypes::CaseID caseID = "";
385  SemanticTypes::ID imageID = "";
386  try
387  {
388  caseID = GetCaseIDFromDataNode(imageNode);
389  imageID = GetIDFromDataNode(imageNode);
390  }
391  catch (SemanticRelationException& e)
392  {
393  mitkReThrow(e) << "Cannot get the control point of the given image data node.";
394  }
395 
396  return RelationStorage::GetControlPointOfImage(caseID, imageID);
397 }
398 
400 {
402 
403  // filter the control points: use only those, where the associated image data has a segmentation that refers to the given lesion using a lambda function
404  auto lambda = [&caseID, &lesion](const SemanticTypes::ControlPoint& controlPoint)
405  {
406  return !SpecificImageExists(caseID, lesion, controlPoint);
407  };
408 
409  allControlPoints.erase(std::remove_if(allControlPoints.begin(), allControlPoints.end(), lambda), allControlPoints.end());
410 
411  return allControlPoints;
412 }
413 
415 {
417 
418  // filter the control points: use only those, where the associated image data refers to the given information type using a lambda function
419  auto lambda = [&caseID, &informationType](const SemanticTypes::ControlPoint& controlPoint)
420  {
421  return !SpecificImageExists(caseID, informationType, controlPoint);
422  };
423 
424  allControlPoints.erase(std::remove_if(allControlPoints.begin(), allControlPoints.end(), lambda), allControlPoints.end());
425 
426  return allControlPoints;
427 }
428 
430 {
432 
433  // filter all control points: check for equality with the given control point using a lambda function
434  auto lambda = [&controlPoint](const SemanticTypes::ControlPoint& currentControlPoint) { return currentControlPoint.UID == controlPoint.UID; };
435  const auto existingControlPoint = std::find_if(allControlPoints.begin(), allControlPoints.end(), lambda);
436 
437  if (existingControlPoint != allControlPoints.end())
438  {
439  return true;
440  }
441  else
442  {
443  return false;
444  }
445 }
446 
448 {
450 
451  // filter all examination periods: check for equality with the given examination period using a lambda function
452  auto lambda = [&examinationPeriod](const SemanticTypes::ExaminationPeriod& currentExaminationPeriod) { return currentExaminationPeriod.UID == examinationPeriod.UID; };
453  const auto existingExaminationPeriod = std::find_if(allExaminationPeriods.begin(), allExaminationPeriods.end(), lambda);
454 
455  if (existingExaminationPeriod != allExaminationPeriods.end())
456  {
457  return true;
458  }
459  else
460  {
461  return false;
462  }
463 }
464 
466 {
467  if (nullptr == imageNode)
468  {
469  mitkThrowException(SemanticRelationException) << "Not a valid image data node.";
470  }
471 
472  SemanticTypes::CaseID caseID = "";
473  SemanticTypes::ID imageID = "";
474  try
475  {
476  caseID = GetCaseIDFromDataNode(imageNode);
477  imageID = GetIDFromDataNode(imageNode);
478  }
479  catch (SemanticRelationException& e)
480  {
481  mitkReThrow(e) << "Cannot get the information type of the given image data node.";
482  }
483 
484  return RelationStorage::GetInformationTypeOfImage(caseID, imageID);
485 }
486 
488 {
490 
491  // filter the information types: use only those, where the associated data refers to the given control point using a lambda function
492  auto lambda = [&caseID, &controlPoint](const SemanticTypes::InformationType& informationType)
493  {
494  return !SpecificImageExists(caseID, informationType, controlPoint);
495  };
496 
497  allInformationTypes.erase(std::remove_if(allInformationTypes.begin(), allInformationTypes.end(), lambda), allInformationTypes.end());
498 
499  return allInformationTypes;
500 }
501 
503 {
505 
506  // filter all information types: check for equality with the given information type using a lambda function
507  auto lambda = [&informationType](const SemanticTypes::InformationType& currentInformationType) { return currentInformationType == informationType; };
508  const auto existingInformationType = std::find_if(allInformationTypes.begin(), allInformationTypes.end(), lambda);
509 
510  if (existingInformationType != allInformationTypes.end())
511  {
512  return true;
513  }
514  else
515  {
516  return false;
517  }
518 }
519 
521 {
522  SemanticTypes::IDVector allImageIDsOfLesion;
523  try
524  {
525  allImageIDsOfLesion = GetAllImageIDsOfLesion(caseID, lesion);
526  }
527  catch (const SemanticRelationException&)
528  {
529  return false;
530  }
531 
532  SemanticTypes::IDVector allImageIDsOfInformationType = RelationStorage::GetAllImageIDsOfInformationType(caseID, informationType);
533 
534  std::sort(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end());
535  std::sort(allImageIDsOfInformationType.begin(), allImageIDsOfInformationType.end());
536  SemanticTypes::IDVector allImageIDsIntersection;
537  // set_intersection removes duplicated nodes, since 'GetAllImageIDsOfInformationType' only contains at most one of each node
538  std::set_intersection(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end(),
539  allImageIDsOfInformationType.begin(), allImageIDsOfInformationType.end(),
540  std::back_inserter(allImageIDsIntersection));
541 
542  // if the vector of intersecting image IDs is empty, the information type does not contain the lesion
543  return !allImageIDsIntersection.empty();
544 }
545 
547 {
548  SemanticTypes::IDVector allImageIDsOfLesion;
549  try
550  {
551  allImageIDsOfLesion = GetAllImageIDsOfLesion(caseID, lesion);
552  }
553  catch (const SemanticRelationException&)
554  {
555  return false;
556  }
557 
558  SemanticTypes::IDVector allImageIDsOfControlPoint = RelationStorage::GetAllImageIDsOfControlPoint(caseID, controlPoint);
559 
560  std::sort(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end());
561  std::sort(allImageIDsOfControlPoint.begin(), allImageIDsOfControlPoint.end());
562  SemanticTypes::IDVector allImageIDsIntersection;
563  // set_intersection removes duplicated nodes, since 'GetAllImageIDsOfControlPoint' only contains at most one of each node
564  std::set_intersection(allImageIDsOfLesion.begin(), allImageIDsOfLesion.end(),
565  allImageIDsOfControlPoint.begin(), allImageIDsOfControlPoint.end(),
566  std::back_inserter(allImageIDsIntersection));
567 
568  // if the vector of intersecting image IDs is empty, the control point does not contain the lesion
569  return !allImageIDsIntersection.empty();
570 }
571 
573 {
574  SemanticTypes::IDVector allImageIDsOfInformationType = RelationStorage::GetAllImageIDsOfInformationType(caseID, informationType);
575  SemanticTypes::IDVector allImageIDsOfControlPoint = RelationStorage::GetAllImageIDsOfControlPoint(caseID, controlPoint);
576 
577  std::sort(allImageIDsOfInformationType.begin(), allImageIDsOfInformationType.end());
578  std::sort(allImageIDsOfControlPoint.begin(), allImageIDsOfControlPoint.end());
579  SemanticTypes::IDVector allImageIDsIntersection;
580  // set_intersection removes duplicated nodes
581  std::set_intersection(allImageIDsOfInformationType.begin(), allImageIDsOfInformationType.end(),
582  allImageIDsOfControlPoint.begin(), allImageIDsOfControlPoint.end(),
583  std::back_inserter(allImageIDsIntersection));
584 
585  // if the vector of intersecting image IDs is empty no image exists for the given information type and control point
586  return !allImageIDsIntersection.empty();
587 }
SemanticTypes::InformationType GetInformationTypeOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresent(const SemanticTypes::Lesion &lesion, const DataNode *dataNode)
Check if the given lesion is present on the given data node. The function receives the case- and the ...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationType GetInformationTypeOfImage(const DataNode *imageNode)
Return the information type of the given image. If the image does not contain any information type...
std::vector< ID > IDVector
std::vector< LesionClass > LesionClassVector
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionClassVector GetAllLesionClassesOfCase(const SemanticTypes::CaseID &caseID)
Return a vector of lesion classes that are currently available for the given case.
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
Returns a vector of all lesions that are valid for the given case, given a specific control point...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfInformationType(const SemanticTypes::CaseID &caseID, const SemanticTypes::InformationType &informationType)
Returns a vector of all lesions that are valid for the given case, given a specific information type...
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetImagePredicate()
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
Return a vector of all control points that are valid for the given case, given a specific lesion...
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfInformationType(const SemanticTypes::CaseID &caseID, const SemanticTypes::InformationType &informationType)
Return a vector of all control points that are valid for the given case, given a specific information...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfImage(const DataNode *imageNode)
Returns a vector of all lesions that are currently available for the current case and are connected t...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationTypeVector GetAllInformationTypesOfCase(const SemanticTypes::CaseID &caseID)
#define mitkReThrow(mitkexception)
MITKSEMANTICRELATIONS_EXPORT bool IsRepresentingALesion(const DataNode *segmentationNode)
Check if the given segmentation refers to an existing lesion instance. This function can be used befo...
MITKSEMANTICRELATIONS_EXPORT bool SpecificImageExists(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion, const SemanticTypes::InformationType &informationType)
Determine if the given information type contains images, which are connected to segmentations that re...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
std::vector< Lesion > LesionVector
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetControlPointOfImage(const DataNode *dataNode)
Return the control point of a data node. If the data node is not linked to a control point or the dat...
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentOnImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion, const SemanticTypes::ID &imageID)
Check if the given lesion is related to the image identified by the given image ID. Each lesion is represented by a segmentation which is connected to its parent image.
SemanticTypes::ControlPoint GetControlPointOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetSegmentationPredicate()
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::CaseID GetCaseIDFromDataNode(const mitk::DataNode *dataNode)
std::vector< ControlPoint > ControlPointVector
SemanticTypes::Lesion GetLesionOfSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
Return a vector of all image IDs that identify images that are related to the given examination perio...
The concept of an examination period. An examination period holds a vector of control point UIDs...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfInformationType(const SemanticTypes::CaseID &caseID, const SemanticTypes::InformationType &informationType)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ID GetIDFromDataNode(const mitk::DataNode *dataNode)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllSpecificLesions(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::InformationType &informationType)
Returns a vector of all lesions that are valid for the given case, given a specific control point and...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfCase(const SemanticTypes::CaseID &caseID)
#define mitkThrowException(classname)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentOnSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion, const SemanticTypes::ID &segmentationID)
Check if the given lesion is present on the segmentation identified by the given segmentation ID...
std::string InformationType
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriodVector GetAllExaminationPeriodsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfCase(const SemanticTypes::CaseID &caseID)
std::vector< InformationType > InformationTypeVector
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationTypeVector GetAllInformationTypesOfControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
Return a vector of all information types that are valid for the given case, given a specific control ...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::Lesion GetLesionOfSegmentation(const DataNode *segmentationNode)
Return the lesion that is defined by the given segmentation.
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentAtControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion, const SemanticTypes::ControlPoint &controlPoint)
Check if the given lesion is present at the given control point.
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetControlPointByUID(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &controlPointUID)
Find and return a whole control point including its date given a specific control point UID...
std::vector< ExaminationPeriod > ExaminationPeriodVector
SemanticTypes::ID GetImageIDOfSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
Return a vector of all image IDs that identify images that are related to the given lesion...
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const DataNode *dataNode)
Check if the given data node exists in the relation storage. The function receives the case- and the ...