Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
Medical Imaging Interaction Toolkit
mitkRelationStorage.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 
13 #include "mitkRelationStorage.h"
14 
15 // semantic relations module
16 #include "mitkDICOMHelper.h"
17 
18 // multi label module
19 #include <mitkLabelSetImage.h>
20 
21 // mitk core
23 #include <mitkVectorProperty.h>
24 
25 // c++
26 #include <algorithm>
27 #include <iostream>
28 
29 namespace
30 {
31  std::vector<mitk::SemanticTypes::CaseID> GetCaseIDs()
32  {
34  if (nullptr == persistenceService)
35  {
36  MITK_DEBUG << "Persistence service could not be loaded";
37  return std::vector<mitk::SemanticTypes::CaseID>();
38  }
39  // the property list is valid for a certain scenario and contains all the case IDs of the radiological user's MITK session
40  std::string listIdentifier = "caseIDs";
41  mitk::PropertyList::Pointer propertyList = persistenceService->GetPropertyList(listIdentifier);
42  if (nullptr == propertyList)
43  {
44  MITK_DEBUG << "Could not find the property list " << listIdentifier << " for the current MITK workbench / session.";
45  return std::vector<mitk::SemanticTypes::CaseID>();
46  }
47  // retrieve a vector property that contains all case IDs
48  mitk::VectorProperty<std::string>* caseIDsVectorProperty = dynamic_cast<mitk::VectorProperty<std::string>*>(propertyList->GetProperty(listIdentifier));
49  if (nullptr == caseIDsVectorProperty)
50  {
51  MITK_DEBUG << "Could not find the property " << listIdentifier << " for the " << listIdentifier << " property list.";
52  return std::vector<mitk::SemanticTypes::CaseID>();
53  }
54 
55  return caseIDsVectorProperty->GetValue();
56  }
57 
58  bool CaseIDExists(const mitk::SemanticTypes::CaseID& caseID)
59  {
60  auto allCaseIDs = GetCaseIDs();
61  auto existingCase = std::find(allCaseIDs.begin(), allCaseIDs.end(), caseID);
62  if (existingCase == allCaseIDs.end())
63  {
64  return false;
65  }
66 
67  return true;
68  }
69 
70  mitk::PropertyList::Pointer GetStorageData(const mitk::SemanticTypes::CaseID& caseID)
71  {
72  // access the storage
74  if (nullptr == persistenceService)
75  {
76  MITK_DEBUG << "Persistence service could not be loaded";
77  return nullptr;
78  }
79 
80  // The persistence service may create a new property list with the given ID, if no property list is found.
81  // Since we don't want to return a new property list but rather inform the user that the given case
82  // is not a valid, stored case, we will return nullptr in that case.
83  if (CaseIDExists(caseID))
84  {
85  // the property list is valid for a whole case and contains all the properties for the current case
86  return persistenceService->GetPropertyList(const_cast<mitk::SemanticTypes::CaseID&>(caseID));
87  }
88 
89  return nullptr;
90  }
91 
92  mitk::SemanticTypes::Lesion GenerateLesion(const mitk::SemanticTypes::CaseID& caseID, const mitk::SemanticTypes::ID& lesionID)
93  {
94  mitk::PropertyList::Pointer propertyList = GetStorageData(caseID);
95  if (nullptr == propertyList)
96  {
97  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
99  }
100 
101  mitk::VectorProperty<std::string>* lesionDataProperty = dynamic_cast<mitk::VectorProperty<std::string>*>(propertyList->GetProperty(lesionID));
102  if (nullptr == lesionDataProperty)
103  {
104  MITK_DEBUG << "Lesion " << lesionID << " not found. Lesion can not be retrieved.";
106  }
107 
108  std::vector<std::string> lesionData = lesionDataProperty->GetValue();
109  // a lesion date has to have exactly two values (the name of the lesion and the UID of the lesion class)
110  if (lesionData.size() != 2)
111  {
112  MITK_DEBUG << "Incorrect lesion data storage. Not two (2) strings of the lesion name and the lesion UID are stored.";
114  }
115 
116  // the lesion class ID is stored as the second property
117  std::string lesionClassID = lesionData[1];
118  mitk::StringProperty* lesionClassProperty = dynamic_cast<mitk::StringProperty*>(propertyList->GetProperty(lesionClassID));
119  if (nullptr != lesionClassProperty)
120  {
121  mitk::SemanticTypes::LesionClass generatedLesionClass;
122  generatedLesionClass.UID = lesionClassID;
123  generatedLesionClass.classType = lesionClassProperty->GetValue();
124 
125  mitk::SemanticTypes::Lesion generatedLesion;
126  generatedLesion.UID = lesionID;
127  generatedLesion.name = lesionData[0];
128  generatedLesion.lesionClass = generatedLesionClass;
129 
130  return generatedLesion;
131  }
132 
133  MITK_DEBUG << "Incorrect lesion class storage. Lesion " << lesionID << " can not be retrieved.";
135  }
136 
137  mitk::SemanticTypes::ControlPoint GenerateControlpoint(const mitk::SemanticTypes::CaseID& caseID, const mitk::SemanticTypes::ID& controlPointUID)
138  {
139  mitk::PropertyList::Pointer propertyList = GetStorageData(caseID);
140  if (nullptr == propertyList)
141  {
142  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
144  }
145 
146  // retrieve a vector property that contains the integer values of the date of a control point (0. year 1. month 2. day)
147  mitk::VectorProperty<int>* controlPointVectorProperty = dynamic_cast<mitk::VectorProperty<int>*>(propertyList->GetProperty(controlPointUID));
148  if (nullptr == controlPointVectorProperty)
149  {
150  MITK_DEBUG << "Could not find the control point " << controlPointUID << " in the storage.";
152  }
153 
154  std::vector<int> controlPointVectorPropertyValue = controlPointVectorProperty->GetValue();
155  // a control point has to have exactly three integer values (year, month and day)
156  if (controlPointVectorPropertyValue.size() != 3)
157  {
158  MITK_DEBUG << "Incorrect control point storage. Not three (3) values of the date are stored.";
160  }
161 
162  // set the values of the control point
163  mitk::SemanticTypes::ControlPoint generatedControlPoint;
164  generatedControlPoint.UID = controlPointUID;
165  generatedControlPoint.date = boost::gregorian::date(controlPointVectorPropertyValue[0],
166  controlPointVectorPropertyValue[1],
167  controlPointVectorPropertyValue[2]);
168 
169  return generatedControlPoint;
170  }
171 }
172 
174 {
175  PropertyList::Pointer propertyList = GetStorageData(caseID);
176  if (nullptr == propertyList)
177  {
178  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
180  }
181  // retrieve a vector property that contains the valid lesion-IDs for the current case
182  VectorProperty<std::string>* lesionsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
183  if (nullptr == lesionsVectorProperty)
184  {
185  MITK_DEBUG << "Could not find any lesion in the storage.";
187  }
188 
189  std::vector<std::string> lesionsVectorPropertyValue = lesionsVectorProperty->GetValue();
190  SemanticTypes::LesionVector allLesionsOfCase;
191  for (const auto& lesionID : lesionsVectorPropertyValue)
192  {
193  SemanticTypes::Lesion generatedLesion = GenerateLesion(caseID, lesionID);
194  if (!generatedLesion.UID.empty())
195  {
196  allLesionsOfCase.push_back(generatedLesion);
197  }
198  }
199 
200  return allLesionsOfCase;
201 }
202 
204 {
205  PropertyList::Pointer propertyList = GetStorageData(caseID);
206  if (nullptr == propertyList)
207  {
208  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
209  return SemanticTypes::Lesion();
210  }
211 
212  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
213  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
214  if (nullptr == segmentationVectorProperty)
215  {
216  MITK_DEBUG << "Could not find the segmentation " << segmentationID << " in the storage.";
217  return SemanticTypes::Lesion();
218  }
219 
220  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
221  // the lesion ID of a segmentation is the second value in the vector
222  if (segmentationVectorPropertyValue.size() != 2)
223  {
224  MITK_DEBUG << "Incorrect segmentation storage. Not two (2) IDs stored.";
225  return SemanticTypes::Lesion();
226  }
227 
228  std::string lesionID = segmentationVectorPropertyValue[1];
229  if (lesionID.empty())
230  {
231  // segmentation does not refer to any lesion; return empty lesion
232  return SemanticTypes::Lesion();
233  }
234 
235  return GenerateLesion(caseID, lesionID);
236 }
237 
239 {
240  PropertyList::Pointer propertyList = GetStorageData(caseID);
241  if (nullptr == propertyList)
242  {
243  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
245  }
246 
247  // retrieve a vector property that contains the valid control point-IDs for the current case
248  VectorProperty<std::string>* controlPointsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("controlpoints"));
249  if (nullptr == controlPointsVectorProperty)
250  {
251  MITK_DEBUG << "Could not find any control points in the storage.";
253  }
254 
255  std::vector<std::string> controlPointsVectorPropertyValue = controlPointsVectorProperty->GetValue();
256  SemanticTypes::ControlPointVector allControlPointsOfCase;
257  for (const auto& controlPointUID : controlPointsVectorPropertyValue)
258  {
259  SemanticTypes::ControlPoint generatedControlPoint = GenerateControlpoint(caseID, controlPointUID);
260  if (!generatedControlPoint.UID.empty())
261  {
262  allControlPointsOfCase.push_back(generatedControlPoint);
263  }
264  }
265 
266  return allControlPointsOfCase;
267 }
268 
270 {
271  PropertyList::Pointer propertyList = GetStorageData(caseID);
272  if (nullptr == propertyList)
273  {
274  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
276  }
277  // retrieve a vector property that contains the information type and the referenced ID of a control point (0. information type 1. control point ID)
278  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
279  if (nullptr == imageVectorProperty)
280  {
281  MITK_DEBUG << "Could not find the image " << imageID << " in the storage.";
283  }
284 
285  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
286  SemanticTypes::ControlPoint controlPoint;
287  // an image has to have exactly two values (the information type and the ID of the control point)
288  if (imageVectorPropertyValue.size() != 2)
289  {
290  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
292  }
293 
294  // the second value of the image vector is the ID of the referenced control point
295  std::string controlPointID = imageVectorPropertyValue[1];
296  // retrieve a vector property that contains the integer values of the date of a control point (0. year 1. month 2. day)
297  VectorProperty<int>* controlPointVectorProperty = dynamic_cast<VectorProperty<int>*>(propertyList->GetProperty(controlPointID));
298  if (nullptr == controlPointVectorProperty)
299  {
300  MITK_DEBUG << "Could not find the control point " << controlPointID << " in the storage.";
302  }
303 
304  std::vector<int> controlPointVectorPropertyValue = controlPointVectorProperty->GetValue();
305  // a control point has to have exactly three integer values (year, month and day)
306  if (controlPointVectorPropertyValue.size() != 3)
307  {
308  MITK_DEBUG << "Incorrect control point storage. Not three (3) values of the date are stored.";
310  }
311 
312  // set the values of the control point
313  controlPoint.UID = controlPointID;
314  controlPoint.date = boost::gregorian::date(controlPointVectorPropertyValue[0],
315  controlPointVectorPropertyValue[1],
316  controlPointVectorPropertyValue[2]);
317 
318  return controlPoint;
319 }
320 
322 {
323  PropertyList::Pointer propertyList = GetStorageData(caseID);
324  if (nullptr == propertyList)
325  {
326  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
328  }
329 
330  // retrieve a vector property that contains the valid examination period UIDs for the current case
331  VectorProperty<std::string>::Pointer examinationPeriodsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("examinationperiods"));
332  if (nullptr == examinationPeriodsVectorProperty)
333  {
334  MITK_DEBUG << "Could not find any examination periods in the storage.";
336  }
337 
338  std::vector<std::string> examinationPeriodsVectorPropertyValue = examinationPeriodsVectorProperty->GetValue();
339  SemanticTypes::ExaminationPeriodVector allExaminationPeriods;
340  for (const auto& examinationPeriodID : examinationPeriodsVectorPropertyValue)
341  {
342  // retrieve a vector property that contains the represented control point-IDs
343  VectorProperty<std::string>::Pointer examinationPeriodVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(examinationPeriodID));
344  if (nullptr == examinationPeriodVectorProperty)
345  {
346  MITK_DEBUG << "Could not find the examination period " << examinationPeriodID << " in the storage.";
347  continue;
348  }
349 
350  std::vector<std::string> examinationPeriodVectorPropertyValue = examinationPeriodVectorProperty->GetValue();
351  // an examination period has an arbitrary number of vector values (name and control point UIDs) (at least one for the name)
352  if (examinationPeriodVectorPropertyValue.empty())
353  {
354  MITK_DEBUG << "Incorrect examination period storage. At least one (1) value for the examination period name has to be stored.";
355  continue;
356  }
357  else
358  {
359  // set the values of the name and the control points
360  SemanticTypes::ExaminationPeriod generatedExaminationPeriod;
361  generatedExaminationPeriod.UID = examinationPeriodID;
362  generatedExaminationPeriod.name = examinationPeriodVectorPropertyValue[0];
363  for (size_t i = 1; i < examinationPeriodVectorPropertyValue.size(); ++i)
364  {
365  generatedExaminationPeriod.controlPointUIDs.push_back(examinationPeriodVectorPropertyValue[i]);
366  }
367 
368  allExaminationPeriods.push_back(generatedExaminationPeriod);
369  }
370  }
371  return allExaminationPeriods;
372 }
373 
375 {
376  PropertyList::Pointer propertyList = GetStorageData(caseID);
377  if (nullptr == propertyList)
378  {
379  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
381  }
382  // retrieve a vector property that contains the valid information types of the current case
383  VectorProperty<std::string>* informationTypesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("informationtypes"));
384  if (nullptr == informationTypesVectorProperty)
385  {
386  MITK_DEBUG << "Could not find any information types in the storage.";
388  }
389 
390  return informationTypesVectorProperty->GetValue();
391 }
392 
394 {
395  PropertyList::Pointer propertyList = GetStorageData(caseID);
396  if (nullptr == propertyList)
397  {
398  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
400  }
401  // retrieve a vector property that contains the information type and the referenced ID of an image (0. information type 1. control point ID)
402  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
403  if (nullptr == imageVectorProperty)
404  {
405  MITK_DEBUG << "Could not find the image " << imageID << " in the storage.";
407  }
408 
409  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
410  // an image has to have exactly two values (the information type and the ID of the control point)
411  if (imageVectorPropertyValue.size() != 2)
412  {
413  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
415  }
416 
417  // the first value of the image vector is the information type
418  return imageVectorPropertyValue[0];
419 }
420 
422 {
423  PropertyList::Pointer propertyList = GetStorageData(caseID);
424  if (nullptr == propertyList)
425  {
426  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
427  return SemanticTypes::IDVector();
428  }
429  // retrieve a vector property that contains the valid image-IDs of the current case
430  VectorProperty<std::string>* imagesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("images"));
431  if (nullptr == imagesVectorProperty)
432  {
433  MITK_DEBUG << "Could not find any image in the storage.";
434  return SemanticTypes::IDVector();
435  }
436 
437  return imagesVectorProperty->GetValue();
438 }
439 
441 {
442  PropertyList::Pointer propertyList = GetStorageData(caseID);
443  if (nullptr == propertyList)
444  {
445  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
446  return SemanticTypes::IDVector();
447  }
448  // retrieve a vector property that contains the valid image-IDs of the current case
449  VectorProperty<std::string>* imagesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("images"));
450  if (nullptr == imagesVectorProperty)
451  {
452  MITK_DEBUG << "Could not find any image in the storage.";
453  return SemanticTypes::IDVector();
454  }
455 
456  mitk::SemanticTypes::IDVector allImageIDsOfControlPoint;
457  std::vector<std::string> imagesVectorPropertyValue = imagesVectorProperty->GetValue();
458  for (const auto& imageID : imagesVectorPropertyValue)
459  {
460  // retrieve a vector property that contains the referenced ID of an image (0. information type 1. control point ID)
461  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
462  if (nullptr == imageVectorProperty)
463  {
464  continue;
465  }
466 
467  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
468  // an image has to have exactly two values (the information type and the ID of the control point)
469  if (imageVectorPropertyValue.size() != 2)
470  {
471  continue;
472  }
473 
474  // the second value of the image vector is the ID of the referenced control point
475  if (imageVectorPropertyValue[1] == controlPoint.UID)
476  {
477  allImageIDsOfControlPoint.push_back(imageID);
478  }
479  }
480 
481  return allImageIDsOfControlPoint;
482 }
483 
485 {
486  PropertyList::Pointer propertyList = GetStorageData(caseID);
487  if (nullptr == propertyList)
488  {
489  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
490  return SemanticTypes::IDVector();
491  }
492  // retrieve a vector property that contains the valid image-IDs of the current case
493  VectorProperty<std::string>* imagesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("images"));
494  if (nullptr == imagesVectorProperty)
495  {
496  MITK_DEBUG << "Could not find any image in the storage.";
497  return SemanticTypes::IDVector();
498  }
499 
500  mitk::SemanticTypes::IDVector allImageIDsOfInformationType;
501  std::vector<std::string> imagesVectorPropertyValue = imagesVectorProperty->GetValue();
502  for (const auto& imageID : imagesVectorPropertyValue)
503  {
504  // retrieve a vector property that contains the referenced ID of an image (0. information type 1. control point ID)
505  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
506  if (nullptr == imageVectorProperty)
507  {
508  continue;
509  }
510 
511  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
512  // an image has to have exactly two values (the information type and the ID of the control point)
513  if (imageVectorPropertyValue.size() != 2)
514  {
515  continue;
516  }
517 
518  // the first value of the image vector is the ID of the referenced information type
519  if (imageVectorPropertyValue[0] == informationType)
520  {
521  allImageIDsOfInformationType.push_back(imageID);
522  }
523  }
524 
525  return allImageIDsOfInformationType;
526 }
527 
529 {
530  PropertyList::Pointer propertyList = GetStorageData(caseID);
531  if (nullptr == propertyList)
532  {
533  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
534  return SemanticTypes::IDVector();
535  }
536  // retrieve a vector property that contains the valid segmentation-IDs for the current case
537  VectorProperty<std::string>* segmentationsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("segmentations"));
538  if (nullptr == segmentationsVectorProperty)
539  {
540  MITK_DEBUG << "Could not find any segmentation in the storage.";
541  return SemanticTypes::IDVector();
542  }
543 
544  return segmentationsVectorProperty->GetValue();
545 }
546 
548 {
549  PropertyList::Pointer propertyList = GetStorageData(caseID);
550  if (nullptr == propertyList)
551  {
552  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
553  return SemanticTypes::IDVector();
554  }
555  // retrieve a vector property that contains the valid segmentation-IDs for the current case
556  VectorProperty<std::string>* segmentationsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("segmentations"));
557  if (nullptr == segmentationsVectorProperty)
558  {
559  MITK_DEBUG << "Could not find any segmentation in the storage.";
560  return SemanticTypes::IDVector();
561  }
562 
563  mitk::SemanticTypes::IDVector allSegmentationIDsOfImage;
564  std::vector<std::string> segmentationsVectorPropertyValue = segmentationsVectorProperty->GetValue();
565  for (const auto& segmentationID : segmentationsVectorPropertyValue)
566  {
567  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
568  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
569  if (nullptr == segmentationVectorProperty)
570  {
571  continue;
572  }
573 
574  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
575  // a segmentation has to have exactly two values (the ID of the referenced image and the ID of the referenced lesion)
576  if (segmentationVectorPropertyValue.size() != 2)
577  {
578  continue;
579  }
580 
581  // the first value of the segmentation vector is the ID of the referenced image
582  if (segmentationVectorPropertyValue[0] == imageID)
583  {
584  allSegmentationIDsOfImage.push_back(segmentationID);
585  }
586  }
587 
588  return allSegmentationIDsOfImage;
589 }
590 
592 {
593  PropertyList::Pointer propertyList = GetStorageData(caseID);
594  if (nullptr == propertyList)
595  {
596  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
597  return SemanticTypes::IDVector();
598  }
599  // retrieve a vector property that contains the valid segmentation-IDs for the current case
600  VectorProperty<std::string>* segmentationsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("segmentations"));
601  if (nullptr == segmentationsVectorProperty)
602  {
603  MITK_DEBUG << "Could not find any segmentation in the storage.";
604  return SemanticTypes::IDVector();
605  }
606 
607  mitk::SemanticTypes::IDVector allSegmentationIDsOfLesion;
608  std::vector<std::string> segmentationsVectorPropertyValue = segmentationsVectorProperty->GetValue();
609  for (const auto& segmentationID : segmentationsVectorPropertyValue)
610  {
611  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
612  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
613  if (nullptr == segmentationVectorProperty)
614  {
615  continue;
616  }
617 
618  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
619  // a segmentation has to have exactly two values (the ID of the referenced image and the ID of the referenced lesion)
620  if (segmentationVectorPropertyValue.size() != 2)
621  {
622  continue;
623  }
624 
625  // the second value of the segmentation vector is the ID of the referenced lesion
626  if (segmentationVectorPropertyValue[1] == lesion.UID)
627  {
628  allSegmentationIDsOfLesion.push_back(segmentationID);
629  }
630  }
631 
632  return allSegmentationIDsOfLesion;
633 }
634 
636 {
637  PropertyList::Pointer propertyList = GetStorageData(caseID);
638  if (nullptr == propertyList)
639  {
640  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
641  return SemanticTypes::ID();
642  }
643 
644  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
645  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
646  if (nullptr == segmentationVectorProperty)
647  {
648  MITK_DEBUG << "Could not find the segmentation " << segmentationID << " in the storage.";
649  return SemanticTypes::ID();
650  }
651 
652  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
653  // the lesion ID of a segmentation is the second value in the vector
654  if (segmentationVectorPropertyValue.size() != 2)
655  {
656  MITK_DEBUG << "Incorrect segmentation storage. Not two (2) IDs stored.";
657  return SemanticTypes::ID();
658  }
659 
660  return segmentationVectorPropertyValue[0];
661 }
662 
663 std::vector<mitk::SemanticTypes::CaseID> mitk::RelationStorage::GetAllCaseIDs()
664 {
665  return GetCaseIDs();
666 }
667 
669 {
670  return CaseIDExists(caseID);
671 }
672 
674 {
676  if (nullptr == persistenceService)
677  {
678  MITK_DEBUG << "Persistence service could not be loaded";
679  return;
680  }
681  // the property list is valid for a certain scenario and contains all the case IDs of the radiological user's MITK session
682  std::string listIdentifier = "caseIDs";
683  PropertyList::Pointer propertyList = persistenceService->GetPropertyList(listIdentifier);
684  if (nullptr == propertyList)
685  {
686  MITK_DEBUG << "Could not find the property list " << listIdentifier << " for the current MITK workbench / session.";
687  return;
688  }
689  // retrieve a vector property that contains all case IDs
690  VectorProperty<std::string>::Pointer caseIDsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(listIdentifier));
691  std::vector<std::string> caseIDsVectorPropertyValue;
692  if (nullptr == caseIDsVectorProperty)
693  {
694  caseIDsVectorProperty = VectorProperty<std::string>::New();
695  }
696  else
697  {
698  caseIDsVectorPropertyValue = caseIDsVectorProperty->GetValue();
699  }
700 
701  auto existingCase = std::find(caseIDsVectorPropertyValue.begin(), caseIDsVectorPropertyValue.end(), caseID);
702  if (existingCase != caseIDsVectorPropertyValue.end())
703  {
704  return;
705  }
706 
707  // add case to the "caseIDs" property list
708  caseIDsVectorPropertyValue.push_back(caseID);
709  caseIDsVectorProperty->SetValue(caseIDsVectorPropertyValue);
710  propertyList->SetProperty(listIdentifier, caseIDsVectorProperty);
711 }
712 
714 {
715  PropertyList::Pointer propertyList = GetStorageData(caseID);
716  if (nullptr == propertyList)
717  {
718  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
719  return;
720  }
721 
722  // retrieve a vector property that contains the valid image-IDs for the current case
723  VectorProperty<std::string>::Pointer imagesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("images"));
724  std::vector<std::string> imagesVectorPropertyValue;
725  if (nullptr == imagesVectorProperty)
726  {
727  imagesVectorProperty = VectorProperty<std::string>::New();
728  }
729  else
730  {
731  imagesVectorPropertyValue = imagesVectorProperty->GetValue();
732  }
733 
734  auto existingImage = std::find(imagesVectorPropertyValue.begin(), imagesVectorPropertyValue.end(), imageID);
735  if (existingImage != imagesVectorPropertyValue.end())
736  {
737  return;
738  }
739 
740  // add image to the "images" property list
741  imagesVectorPropertyValue.push_back(imageID);
742  imagesVectorProperty->SetValue(imagesVectorPropertyValue);
743  propertyList->SetProperty("images", imagesVectorProperty);
744 
745  // add the image itself
747  // an image has to have exactly two values (the information type and the ID of the control point)
748  std::vector<std::string> imageVectorPropertyValue(2);
749  imageVectorProperty->SetValue(imageVectorPropertyValue);
750  propertyList->SetProperty(imageID, imageVectorProperty);
751 }
752 
754 {
755  PropertyList::Pointer propertyList = GetStorageData(caseID);
756  if (nullptr == propertyList)
757  {
758  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
759  return;
760  }
761 
762  // retrieve a vector property that contains the valid image-IDs for the current case
763  VectorProperty<std::string>::Pointer imagesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("images"));
764  if (nullptr == imagesVectorProperty)
765  {
766  MITK_DEBUG << "Could not find any images in the storage.";
767  return;
768  }
769 
770  // remove the image reference from the list of all images of the current case
771  std::vector<std::string> imagesVectorPropertyValue = imagesVectorProperty->GetValue();
772  imagesVectorPropertyValue.erase(std::remove(imagesVectorPropertyValue.begin(), imagesVectorPropertyValue.end(), imageID), imagesVectorPropertyValue.end());
773  if (imagesVectorPropertyValue.empty())
774  {
775  // no more images stored -> remove the images property list
776  propertyList->DeleteProperty("images");
777  }
778  else
779  {
780  // or store the modified vector value
781  imagesVectorProperty->SetValue(imagesVectorPropertyValue);
782  }
783 
784  // remove the image instance itself
785  propertyList->DeleteProperty(imageID);
786 }
787 
788 void mitk::RelationStorage::AddSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID, const SemanticTypes::ID& parentID)
789 {
790  PropertyList::Pointer propertyList = GetStorageData(caseID);
791  if (nullptr == propertyList)
792  {
793  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
794  return;
795  }
796 
797  // retrieve a vector property that contains the valid segmentation-IDs for the current case
798  VectorProperty<std::string>::Pointer segmentationsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("segmentations"));
799  std::vector<std::string> segmentationsVectorPropertyValue;
800  if (nullptr == segmentationsVectorProperty)
801  {
802  segmentationsVectorProperty = VectorProperty<std::string>::New();
803  }
804  else
805  {
806  segmentationsVectorPropertyValue = segmentationsVectorProperty->GetValue();
807  }
808 
809  auto existingSegmentation = std::find(segmentationsVectorPropertyValue.begin(), segmentationsVectorPropertyValue.end(), segmentationID);
810  if (existingSegmentation != segmentationsVectorPropertyValue.end())
811  {
812  return;
813  }
814 
815  // add segmentation to the "segmentations" property list
816  segmentationsVectorPropertyValue.push_back(segmentationID);
817  segmentationsVectorProperty->SetValue(segmentationsVectorPropertyValue);
818  propertyList->SetProperty("segmentations", segmentationsVectorProperty);
819 
820  // add the segmentation itself
822  // a segmentation has to have exactly two values (the ID of the referenced image and the ID of the referenced lesion)
823  std::vector<std::string> segmentationVectorPropertyValue(2);
824  segmentationVectorPropertyValue[0] = parentID;
825  segmentationVectorProperty->SetValue(segmentationVectorPropertyValue);
826  propertyList->SetProperty(segmentationID, segmentationVectorProperty);
827 }
828 
830 {
831  PropertyList::Pointer propertyList = GetStorageData(caseID);
832  if (nullptr == propertyList)
833  {
834  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
835  return;
836  }
837 
838  // retrieve a vector property that contains the valid segmentation-IDs for the current case
839  VectorProperty<std::string>::Pointer segmentationsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("segmentations"));
840  if (nullptr == segmentationsVectorProperty)
841  {
842  MITK_DEBUG << "Could not find any segmentation in the storage.";
843  return;
844  }
845 
846  // remove the lesion reference from the list of all lesions of the current case
847  std::vector<std::string> segmentationsVectorPropertyValue = segmentationsVectorProperty->GetValue();
848  segmentationsVectorPropertyValue.erase(std::remove(segmentationsVectorPropertyValue.begin(), segmentationsVectorPropertyValue.end(), segmentationID), segmentationsVectorPropertyValue.end());
849  if (segmentationsVectorPropertyValue.empty())
850  {
851  // no more segmentations stored -> remove the segmentations property list
852  propertyList->DeleteProperty("segmentations");
853  }
854  else
855  {
856  // or store the modified vector value
857  segmentationsVectorProperty->SetValue(segmentationsVectorPropertyValue);
858  }
859 
860  // remove the lesion instance itself
861  propertyList->DeleteProperty(segmentationID);
862 }
863 
865 {
866  PropertyList::Pointer propertyList = GetStorageData(caseID);
867  if (nullptr == propertyList)
868  {
869  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
870  return;
871  }
872  // retrieve a vector property that contains the valid lesion-IDs for the current case
873  VectorProperty<std::string>::Pointer lesionsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
874  std::vector<std::string> lesionsVectorPropertyValue;
875  if (nullptr == lesionsVectorProperty)
876  {
877  lesionsVectorProperty = VectorProperty<std::string>::New();
878  }
879  else
880  {
881  lesionsVectorPropertyValue = lesionsVectorProperty->GetValue();
882  }
883 
884  const auto& existingIndex = std::find(lesionsVectorPropertyValue.begin(), lesionsVectorPropertyValue.end(), lesion.UID);
885  if (existingIndex != lesionsVectorPropertyValue.end())
886  {
887  return;
888  }
889 
890  // add the new lesion id from the given lesion to the vector of all current lesion IDs
891  lesionsVectorPropertyValue.push_back(lesion.UID);
892  // overwrite the current vector property with the new, extended string vector
893  lesionsVectorProperty->SetValue(lesionsVectorPropertyValue);
894  propertyList->SetProperty("lesions", lesionsVectorProperty);
895 
896  // add the lesion with the lesion UID as the key and the lesion information as value
897  std::vector<std::string> lesionData;
898  lesionData.push_back(lesion.name);
899  lesionData.push_back(lesion.lesionClass.UID);
901  newLesionVectorProperty->SetValue(lesionData);
902  propertyList->SetProperty(lesion.UID, newLesionVectorProperty);
903 
904  // add the lesion class with the lesion class UID as key and the class type as value
905  std::string lesionClassType = lesion.lesionClass.classType;
906  propertyList->SetStringProperty(lesion.lesionClass.UID.c_str(), lesionClassType.c_str());
907 }
908 
910 {
911  PropertyList::Pointer propertyList = GetStorageData(caseID);
912  if (nullptr == propertyList)
913  {
914  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
915  return;
916  }
917  // retrieve a vector property that contains the valid lesion-IDs for the current case
918  VectorProperty<std::string>* lesionVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
919  if (nullptr == lesionVectorProperty)
920  {
921  MITK_DEBUG << "Could not find any lesion in the storage.";
922  return;
923  }
924 
925  std::vector<std::string> lesionVectorPropertyValue = lesionVectorProperty->GetValue();
926  const auto existingLesion = std::find(lesionVectorPropertyValue.begin(), lesionVectorPropertyValue.end(), lesion.UID);
927  if (existingLesion != lesionVectorPropertyValue.end())
928  {
929  // overwrite the referenced lesion class UID with the new, given lesion class data
930  std::vector<std::string> lesionData;
931  lesionData.push_back(lesion.name);
932  lesionData.push_back(lesion.lesionClass.UID);
934  newLesionVectorProperty->SetValue(lesionData);
935  propertyList->SetProperty(lesion.UID, newLesionVectorProperty);
936 
937  // overwrite the lesion class with the lesion class UID as key and the new, given class type as value
938  std::string lesionClassType = lesion.lesionClass.classType;
939  propertyList->SetStringProperty(lesion.lesionClass.UID.c_str(), lesionClassType.c_str());
940  }
941  else
942  {
943  MITK_DEBUG << "Could not find lesion " << lesion.UID << " in the storage. Cannot overwrite the lesion.";
944  }
945 }
946 
948 {
949  PropertyList::Pointer propertyList = GetStorageData(caseID);
950  if (nullptr == propertyList)
951  {
952  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
953  return;
954  }
955  // retrieve a vector property that contains the valid lesion-IDs for the current case
956  VectorProperty<std::string>* lesionVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
957  if (nullptr == lesionVectorProperty)
958  {
959  MITK_DEBUG << "Could not find any lesion in the storage.";
960  return;
961  }
962 
963  std::vector<std::string> lesionVectorPropertyValue = lesionVectorProperty->GetValue();
964  const auto existingLesion = std::find(lesionVectorPropertyValue.begin(), lesionVectorPropertyValue.end(), lesion.UID);
965  if (existingLesion != lesionVectorPropertyValue.end())
966  {
967  // set / overwrite the lesion reference of the given segmentation
968  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
969  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
970  if (nullptr == segmentationVectorProperty)
971  {
972  MITK_DEBUG << "Could not find the segmentation " << segmentationID << " in the storage. Cannot link segmentation to lesion.";
973  return;
974  }
975 
976  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
977  if (segmentationVectorPropertyValue.size() != 2)
978  {
979  MITK_DEBUG << "Incorrect segmentation storage. Not two (2) IDs stored.";
980  return;
981  }
982 
983  // the lesion ID of a segmentation is the second value in the vector
984  segmentationVectorPropertyValue[1] = lesion.UID;
985  segmentationVectorProperty->SetValue(segmentationVectorPropertyValue);
986  return;
987  }
988 
989  MITK_DEBUG << "Could not find lesion " << lesion.UID << " in the storage. Cannot link segmentation to lesion.";
990 }
991 
993 {
994  PropertyList::Pointer propertyList = GetStorageData(caseID);
995  if (nullptr == propertyList)
996  {
997  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
998  return;
999  }
1000  // retrieve a vector property that contains the referenced ID of a segmentation (0. image ID 1. lesion ID)
1001  VectorProperty<std::string>* segmentationVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(segmentationID));
1002  if (nullptr == segmentationVectorProperty)
1003  {
1004  MITK_DEBUG << "Could not find the segmentation " << segmentationID << " in the storage. Cannot unlink lesion from segmentation.";
1005  return;
1006  }
1007 
1008  std::vector<std::string> segmentationVectorPropertyValue = segmentationVectorProperty->GetValue();
1009  // a segmentation has to have exactly two values (the ID of the linked image and the ID of the lesion)
1010  if (segmentationVectorPropertyValue.size() != 2)
1011  {
1012  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
1013  return;
1014  }
1015 
1016  // the second value of the segmentation vector is the ID of the referenced lesion
1017  // set the lesion reference to an empty string for removal
1018  segmentationVectorPropertyValue[1] = "";
1019  segmentationVectorProperty->SetValue(segmentationVectorPropertyValue);
1020 }
1021 
1023 {
1024  PropertyList::Pointer propertyList = GetStorageData(caseID);
1025  if (nullptr == propertyList)
1026  {
1027  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1028  return;
1029  }
1030  // retrieve a vector property that contains the valid lesions of the current case
1031  VectorProperty<std::string>* lesionVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
1032  if (nullptr == lesionVectorProperty)
1033  {
1034  MITK_DEBUG << "Could not find any lesion in the storage.";
1035  return;
1036  }
1037 
1038  // remove the lesion reference from the list of all lesions of the current case
1039  std::vector<std::string> lesionsVectorPropertyValue = lesionVectorProperty->GetValue();
1040  lesionsVectorPropertyValue.erase(std::remove(lesionsVectorPropertyValue.begin(), lesionsVectorPropertyValue.end(), lesion.UID), lesionsVectorPropertyValue.end());
1041  if (lesionsVectorPropertyValue.empty())
1042  {
1043  // no more lesions stored -> remove the lesions property list
1044  propertyList->DeleteProperty("lesions");
1045  }
1046  else
1047  {
1048  // or store the modified vector value
1049  lesionVectorProperty->SetValue(lesionsVectorPropertyValue);
1050  }
1051 
1052  // remove the lesion instance itself
1053  // the lesion data is stored under the lesion ID
1054  VectorProperty<std::string>* lesionDataProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(lesion.UID));
1055  if (nullptr == lesionDataProperty)
1056  {
1057  MITK_DEBUG << "Lesion " << lesion.UID << " not found (already removed?). Cannot remove the lesion.";
1058  return;
1059  }
1060 
1061  std::vector<std::string> lesionData = lesionDataProperty->GetValue();
1062  // a lesion date has to have exactly two values (the name of the lesion and the UID of the lesion class)
1063  if (lesionData.size() != 2)
1064  {
1065  MITK_DEBUG << "Incorrect lesion data storage. Not two (2) strings of the lesion UID and the lesion name are stored.";
1066  }
1067  else
1068  {
1069  std::string lesionClassID = lesionData[1];
1070  RemoveLesionClass(caseID, lesionClassID);
1071  }
1072  propertyList->DeleteProperty(lesion.UID);
1073 }
1074 
1076 {
1077  PropertyList::Pointer propertyList = GetStorageData(caseID);
1078  if (nullptr == propertyList)
1079  {
1080  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1081  return;
1082  }
1083 
1084  // retrieve a vector property that contains the lesion class
1085  StringProperty* lesionClassProperty = dynamic_cast<StringProperty*>(propertyList->GetProperty(lesionClassID));
1086  if (nullptr == lesionClassProperty)
1087  {
1088  MITK_DEBUG << "Lesion class " << lesionClassID << " not found (already removed?). Cannot remove the lesion class.";
1089  return;
1090  }
1091 
1092  // retrieve a vector property that contains the valid lesions of the current case
1093  VectorProperty<std::string>* lesionVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("lesions"));
1094  if (nullptr == lesionVectorProperty)
1095  {
1096  return;
1097  }
1098 
1099  // check if the lesion class ID is referenced by any other lesion
1100  std::vector<std::string> lesionsVectorPropertyValue = lesionVectorProperty->GetValue();
1101  const auto existingLesionClass = std::find_if(lesionsVectorPropertyValue.begin(), lesionsVectorPropertyValue.end(),
1102  [&propertyList, &lesionClassID](const std::string& lesionID)
1103  {
1104  VectorProperty<std::string>* lesionDataProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(lesionID));
1105  if (nullptr == lesionDataProperty)
1106  {
1107  return false;
1108  }
1109 
1110  std::vector<std::string> lesionData = lesionDataProperty->GetValue();
1111  // a lesion date has to have exactly two values (the name of the lesion and the UID of the lesion class)
1112  if (lesionData.size() != 2)
1113  {
1114  return false;
1115  }
1116 
1117  return lesionData[1] == lesionClassID;
1118  });
1119 
1120  if (existingLesionClass == lesionsVectorPropertyValue.end())
1121  {
1122  // lesion class ID not referenced; remove lesion class
1123  propertyList->DeleteProperty(lesionClassID);
1124  }
1125 }
1126 
1128 {
1129  PropertyList::Pointer propertyList = GetStorageData(caseID);
1130  if (nullptr == propertyList)
1131  {
1132  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1133  return;
1134  }
1135  // retrieve a vector property that contains the valid controlPoint UIDs for the current case
1136  VectorProperty<std::string>::Pointer controlPointsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("controlpoints"));
1137  std::vector<std::string> controlPointsVectorPropertyValue;
1138  if (nullptr == controlPointsVectorProperty)
1139  {
1140  controlPointsVectorProperty = VectorProperty<std::string>::New();
1141  }
1142  else
1143  {
1144  controlPointsVectorPropertyValue = controlPointsVectorProperty->GetValue();
1145  }
1146 
1147  const auto existingControlPoint = std::find(controlPointsVectorPropertyValue.begin(), controlPointsVectorPropertyValue.end(), controlPoint.UID);
1148  if (existingControlPoint != controlPointsVectorPropertyValue.end())
1149  {
1150  return;
1151  }
1152 
1153  // add the new control point UID from the given control point to the vector of all current control point UIDs
1154  controlPointsVectorPropertyValue.push_back(controlPoint.UID);
1155  // overwrite the current vector property with the new, extended string vector
1156  controlPointsVectorProperty->SetValue(controlPointsVectorPropertyValue);
1157  propertyList->SetProperty("controlpoints", controlPointsVectorProperty);
1158 
1159  // store the control point values (the three integer values of a date)
1160  std::vector<int> controlPointDate;
1161  controlPointDate.push_back(controlPoint.date.year());
1162  controlPointDate.push_back(controlPoint.date.month());
1163  controlPointDate.push_back(controlPoint.date.day());
1164 
1165  VectorProperty<int>::Pointer newControlPointVectorProperty = VectorProperty<int>::New();
1166  newControlPointVectorProperty->SetValue(controlPointDate);
1167  propertyList->SetProperty(controlPoint.UID, newControlPointVectorProperty);
1168 }
1169 
1171 {
1172  PropertyList::Pointer propertyList = GetStorageData(caseID);
1173  if (nullptr == propertyList)
1174  {
1175  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1176  return;
1177  }
1178  // retrieve a vector property that contains the valid controlPoint UIDs for the current case
1179  VectorProperty<std::string>* controlPointsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("controlpoints"));
1180  if (nullptr == controlPointsVectorProperty)
1181  {
1182  MITK_DEBUG << "Could not find any control point in the storage.";
1183  return;
1184  }
1185 
1186  std::vector<std::string> controlPointsVectorPropertyValue = controlPointsVectorProperty->GetValue();
1187  const auto existingControlPoint = std::find(controlPointsVectorPropertyValue.begin(), controlPointsVectorPropertyValue.end(), controlPoint.UID);
1188  if (existingControlPoint != controlPointsVectorPropertyValue.end())
1189  {
1190  // set / overwrite the control point reference of the given data
1191  // retrieve a vector property that contains the referenced ID of a image (0. information type 1. control point ID)
1192  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
1193  if (nullptr == imageVectorProperty)
1194  {
1195  MITK_DEBUG << "Could not find the image " << imageID << " in the storage. Cannot link data to control point.";
1196  return;
1197  }
1198 
1199  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
1200  // an image has to have exactly two values (the information type and the ID of the control point)
1201  if (imageVectorPropertyValue.size() != 2)
1202  {
1203  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
1204  return;
1205  }
1206 
1207  // the second value of the image vector is the ID of the referenced control point
1208  imageVectorPropertyValue[1] = controlPoint.UID;
1209  imageVectorProperty->SetValue(imageVectorPropertyValue);
1210  return;
1211  }
1212 
1213  MITK_DEBUG << "Could not find control point " << controlPoint.UID << " in the storage. Cannot link data to control point.";
1214 }
1215 
1217 {
1218  PropertyList::Pointer propertyList = GetStorageData(caseID);
1219  if (nullptr == propertyList)
1220  {
1221  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1222  return;
1223  }
1224  // retrieve a vector property that contains the referenced ID of a date (0. information type 1. control point ID)
1225  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
1226  if (nullptr == imageVectorProperty)
1227  {
1228  MITK_DEBUG << "Could not find the date " << imageID << " in the storage. Cannot unlink control point from date.";
1229  return;
1230  }
1231 
1232  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
1233  // an image has to have exactly two values (the information type and the ID of the control point)
1234  if (imageVectorPropertyValue.size() != 2)
1235  {
1236  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
1237  return;
1238  }
1239 
1240  // the second value of the image vector is the ID of the referenced control point
1241  // set the control point reference to an empty string for removal
1242  imageVectorPropertyValue[1] = "";
1243  imageVectorProperty->SetValue(imageVectorPropertyValue);
1244 }
1245 
1247 {
1248  PropertyList::Pointer propertyList = GetStorageData(caseID);
1249  if (nullptr == propertyList)
1250  {
1251  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1252  return;
1253  }
1254  // retrieve a vector property that contains the valid controlPoint UIDs for the current case
1255  VectorProperty<std::string>* controlPointsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("controlpoints"));
1256  if (nullptr == controlPointsVectorProperty)
1257  {
1258  MITK_DEBUG << "Could not find any control point in the storage.";
1259  return;
1260  }
1261 
1262  // remove the control point reference from the list of all control points of the current case
1263  std::vector<std::string> controlPointsVectorPropertyValue = controlPointsVectorProperty->GetValue();
1264  controlPointsVectorPropertyValue.erase(std::remove(controlPointsVectorPropertyValue.begin(), controlPointsVectorPropertyValue.end(), controlPoint.UID), controlPointsVectorPropertyValue.end());
1265  if (controlPointsVectorPropertyValue.empty())
1266  {
1267  // no more control points stored -> remove the control point property list
1268  propertyList->DeleteProperty("controlpoints");
1269  }
1270  else
1271  {
1272  // or store the modified vector value
1273  controlPointsVectorProperty->SetValue(controlPointsVectorPropertyValue);
1274  }
1275 
1276  // remove the control point instance itself
1277  propertyList->DeleteProperty(controlPoint.UID);
1278 }
1279 
1281 {
1282  PropertyList::Pointer propertyList = GetStorageData(caseID);
1283  if (nullptr == propertyList)
1284  {
1285  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1286  return;
1287  }
1288  // retrieve a vector property that contains the valid examination period UIDs for the current case
1289  VectorProperty<std::string>::Pointer examinationPeriodsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("examinationperiods"));
1290  std::vector<std::string> examinationPeriodsVectorPropertyValue;
1291  if (nullptr == examinationPeriodsVectorProperty)
1292  {
1293  examinationPeriodsVectorProperty = VectorProperty<std::string>::New();
1294  }
1295  else
1296  {
1297  examinationPeriodsVectorPropertyValue = examinationPeriodsVectorProperty->GetValue();
1298  }
1299 
1300  const auto& existingIndex = std::find(examinationPeriodsVectorPropertyValue.begin(), examinationPeriodsVectorPropertyValue.end(), examinationPeriod.UID);
1301  if (existingIndex != examinationPeriodsVectorPropertyValue.end())
1302  {
1303  return;
1304  }
1305 
1306  // add the new examination period id from the given examination period to the vector of all current examination period UIDs
1307  examinationPeriodsVectorPropertyValue.push_back(examinationPeriod.UID);
1308  // overwrite the current vector property with the new, extended string vector
1309  examinationPeriodsVectorProperty->SetValue(examinationPeriodsVectorPropertyValue);
1310  propertyList->SetProperty("examinationperiods", examinationPeriodsVectorProperty);
1311 
1312  // add the examination period with the UID as the key and the name as as the vector value
1313  std::vector<std::string> examinationPeriodData;
1314  examinationPeriodData.push_back(examinationPeriod.name);
1315  VectorProperty<std::string>::Pointer newExaminationPeriodVectorProperty = VectorProperty<std::string>::New();
1316  newExaminationPeriodVectorProperty->SetValue(examinationPeriodData);
1317  propertyList->SetProperty(examinationPeriod.UID, newExaminationPeriodVectorProperty);
1318 }
1319 
1321 {
1322  PropertyList::Pointer propertyList = GetStorageData(caseID);
1323  if (nullptr == propertyList)
1324  {
1325  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1326  return;
1327  }
1328  // retrieve a vector property that contains the data of the given examination period
1329  VectorProperty<std::string>* examinationPeriodDataVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(examinationPeriod.UID));
1330  if (nullptr == examinationPeriodDataVectorProperty)
1331  {
1332  MITK_DEBUG << "Could not find examination period " << examinationPeriod.UID << " in the storage. Cannot rename the examination period.";
1333  return;
1334  }
1335 
1336  std::vector<std::string> examinationPeriodDataVectorPropertyValue = examinationPeriodDataVectorProperty->GetValue();
1337  // an examination period has an arbitrary number of vector values (name and control point UIDs) (at least one for the name)
1338  if (examinationPeriodDataVectorPropertyValue.size() < 1)
1339  {
1340  MITK_DEBUG << "Incorrect examination period storage. At least one (1) name has to be stored.";
1341  return;
1342  }
1343  else
1344  {
1345  // set the first vector value - the name
1346  examinationPeriodDataVectorPropertyValue[0] = examinationPeriod.name;
1347  // store the modified vector value
1348  examinationPeriodDataVectorProperty->SetValue(examinationPeriodDataVectorPropertyValue);
1349  }
1350 }
1351 
1353 {
1354  PropertyList::Pointer propertyList = GetStorageData(caseID);
1355  if (nullptr == propertyList)
1356  {
1357  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1358  return;
1359  }
1360 
1361  // retrieve a vector property that contains the represented control point UIDs of the given examination period
1362  VectorProperty<std::string>* controlPointUIDsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(examinationPeriod.UID));
1363  if (nullptr == controlPointUIDsVectorProperty)
1364  {
1365  MITK_DEBUG << "Could not find the examination period " << examinationPeriod.UID << " in the storage. Cannot add the control point to the examination period.";
1366  return;
1367  }
1368 
1369  std::vector<std::string> controlPointUIDsVectorPropertyValue = controlPointUIDsVectorProperty->GetValue();
1370  // store the control point UID
1371  controlPointUIDsVectorPropertyValue.push_back(controlPoint.UID);
1372  // sort the vector according to the date of the control points referenced by the UIDs
1373  auto lambda = [&caseID](const SemanticTypes::ID& leftControlPointUID, const SemanticTypes::ID& rightControlPointUID)
1374  {
1375  const auto& leftControlPoint = GenerateControlpoint(caseID, leftControlPointUID);
1376  const auto& rightControlPoint = GenerateControlpoint(caseID, rightControlPointUID);
1377 
1378  return leftControlPoint.date <= rightControlPoint.date;
1379  };
1380 
1381  std::sort(controlPointUIDsVectorPropertyValue.begin(), controlPointUIDsVectorPropertyValue.end(), lambda);
1382  // store the modified and sorted control point UID vector of this examination period
1383  controlPointUIDsVectorProperty->SetValue(controlPointUIDsVectorPropertyValue);
1384 }
1385 
1387 {
1388  PropertyList::Pointer propertyList = GetStorageData(caseID);
1389  if (nullptr == propertyList)
1390  {
1391  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1392  return;
1393  }
1394 
1395  // retrieve a vector property that contains the represented control point UIDs of the given examination period
1396  VectorProperty<std::string>* controlPointUIDsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(examinationPeriod.UID));
1397  if (nullptr == controlPointUIDsVectorProperty)
1398  {
1399  MITK_DEBUG << "Could not find examination period " << examinationPeriod.UID << " in the storage. Cannot add the control point to the examination period.";
1400  return;
1401  }
1402 
1403  std::vector<std::string> controlPointUIDsVectorPropertyValue = controlPointUIDsVectorProperty->GetValue();
1404  // an examination period has an arbitrary number of vector values (name and control point UIDs) (at least one for the name)
1405  if (controlPointUIDsVectorPropertyValue.size() < 2)
1406  {
1407  MITK_DEBUG << "Incorrect examination period storage. At least one (1) control point ID has to be stored.";
1408  return;
1409  }
1410  else
1411  {
1412  controlPointUIDsVectorPropertyValue.erase(std::remove(controlPointUIDsVectorPropertyValue.begin(), controlPointUIDsVectorPropertyValue.end(), controlPoint.UID), controlPointUIDsVectorPropertyValue.end());
1413  if (controlPointUIDsVectorPropertyValue.size() < 2)
1414  {
1415  RemoveExaminationPeriod(caseID, examinationPeriod);
1416  }
1417  else
1418  {
1419  // store the modified vector value
1420  controlPointUIDsVectorProperty->SetValue(controlPointUIDsVectorPropertyValue);
1421  }
1422  }
1423 }
1424 
1426 {
1427  PropertyList::Pointer propertyList = GetStorageData(caseID);
1428  if (nullptr == propertyList)
1429  {
1430  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1431  return;
1432  }
1433  // retrieve a vector property that contains the valid examination period UIDs for the current case
1434  VectorProperty<std::string>::Pointer examinationPeriodsVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("examinationperiods"));
1435  if (nullptr == examinationPeriodsVectorProperty)
1436  {
1437  MITK_DEBUG << "Could not find any examination periods in the storage.";
1438  return;
1439  }
1440 
1441  std::vector<std::string> examinationPeriodsVectorPropertyValue = examinationPeriodsVectorProperty->GetValue();
1442  examinationPeriodsVectorPropertyValue.erase(std::remove(examinationPeriodsVectorPropertyValue.begin(), examinationPeriodsVectorPropertyValue.end(), examinationPeriod.UID), examinationPeriodsVectorPropertyValue.end());
1443  if (examinationPeriodsVectorPropertyValue.empty())
1444  {
1445  // no more examination periods stored -> remove the examination period property list
1446  propertyList->DeleteProperty("examinationperiods");
1447  }
1448  else
1449  {
1450  // or store the modified vector value
1451  examinationPeriodsVectorProperty->SetValue(examinationPeriodsVectorPropertyValue);
1452  }
1453 
1454  // remove the examination period instance itself
1455  propertyList->DeleteProperty(examinationPeriod.UID);
1456 }
1457 
1459 {
1460  PropertyList::Pointer propertyList = GetStorageData(caseID);
1461  if (nullptr == propertyList)
1462  {
1463  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1464  return;
1465  }
1466  // retrieve a vector property that contains the valid information types of the current case
1467  VectorProperty<std::string>::Pointer informationTypesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("informationtypes"));
1468  std::vector<std::string> informationTypesVectorPropertyValue;
1469  if (nullptr == informationTypesVectorProperty)
1470  {
1471  informationTypesVectorProperty = VectorProperty<std::string>::New();
1472  }
1473  else
1474  {
1475  informationTypesVectorPropertyValue = informationTypesVectorProperty->GetValue();
1476  }
1477 
1478  const auto existingInformationType = std::find(informationTypesVectorPropertyValue.begin(), informationTypesVectorPropertyValue.end(), informationType);
1479  if (existingInformationType == informationTypesVectorPropertyValue.end())
1480  {
1481  // at first: add the information type to the storage
1482  informationTypesVectorPropertyValue.push_back(informationType);
1483  informationTypesVectorProperty->SetValue(informationTypesVectorPropertyValue);
1484  propertyList->SetProperty("informationtypes", informationTypesVectorProperty);
1485  }
1486 
1487  // set / overwrite the information type of the given data
1488  // retrieve a vector property that contains the referenced ID of an image (0. information type 1. control point ID)
1489  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
1490  if (nullptr == imageVectorProperty)
1491  {
1492  MITK_DEBUG << "Could not find the image " << imageID << " in the storage. Cannot add information type to image.";
1493  return;
1494  }
1495 
1496  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
1497  // an image has to have exactly two values (the information type and the ID of the control point)
1498  if (imageVectorPropertyValue.size() != 2)
1499  {
1500  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
1501  return;
1502  }
1503 
1504  // the first value of the image vector is the information type
1505  imageVectorPropertyValue[0] = informationType;
1506  imageVectorProperty->SetValue(imageVectorPropertyValue);
1507 }
1508 
1510 {
1511  PropertyList::Pointer propertyList = GetStorageData(caseID);
1512  if (nullptr == propertyList)
1513  {
1514  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1515  return;
1516  }
1517  // retrieve a vector property that contains the referenced ID of an image (0. information type 1. control point ID)
1518  VectorProperty<std::string>* imageVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty(imageID));
1519  if (nullptr == imageVectorProperty)
1520  {
1521  MITK_DEBUG << "Could not find the image " << imageID << " in the storage. Cannot remove information type from image.";
1522  return;
1523  }
1524 
1525  std::vector<std::string> imageVectorPropertyValue = imageVectorProperty->GetValue();
1526  // an image has to have exactly two values (the information type and the ID of the control point)
1527  if (imageVectorPropertyValue.size() != 2)
1528  {
1529  MITK_DEBUG << "Incorrect data storage. Not two (2) values stored.";
1530  return;
1531  }
1532 
1533  // the first value of the image vector is the information type
1534  // set the information type to an empty string for removal
1535  imageVectorPropertyValue[0] = "";
1536  imageVectorProperty->SetValue(imageVectorPropertyValue);
1537 }
1538 
1540 {
1541  PropertyList::Pointer propertyList = GetStorageData(caseID);
1542  if (nullptr == propertyList)
1543  {
1544  MITK_DEBUG << "Could not find the property list " << caseID << " for the current MITK workbench / session.";
1545  return;
1546  }
1547  // retrieve a vector property that contains the valid information types of the current case
1548  VectorProperty<std::string>* informationTypesVectorProperty = dynamic_cast<VectorProperty<std::string>*>(propertyList->GetProperty("informationtypes"));
1549  if (nullptr == informationTypesVectorProperty)
1550  {
1551  MITK_DEBUG << "Could not find any information type in the storage.";
1552  return;
1553  }
1554 
1555  std::vector<std::string> informationTypesVectorPropertyValue = informationTypesVectorProperty->GetValue();
1556  informationTypesVectorPropertyValue.erase(std::remove(informationTypesVectorPropertyValue.begin(), informationTypesVectorPropertyValue.end(), informationType), informationTypesVectorPropertyValue.end());
1557  if (informationTypesVectorPropertyValue.empty())
1558  {
1559  // no more information types stored -> remove the information types property list
1560  propertyList->DeleteProperty("informationtypes");
1561  }
1562  else
1563  {
1564  // or store the modified vector value
1565  informationTypesVectorProperty->SetValue(informationTypesVectorPropertyValue);
1566  }
1567 }
void AddExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
void AddInformationTypeToImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID, const SemanticTypes::InformationType &informationType)
void LinkSegmentationToLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID, const SemanticTypes::Lesion &lesion)
SemanticTypes::InformationType GetInformationTypeOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
void AddControlPointToExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::ExaminationPeriod &examinationPeriod)
std::vector< ID > IDVector
virtual const char * GetValue() const
void RemoveControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
void UnlinkSegmentationFromLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
virtual void SetValue(const VectorType &parameter_vector)
sets the content vector
#define MITK_DEBUG
Definition: mitkLogMacros.h:22
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationTypeVector GetAllInformationTypesOfCase(const SemanticTypes::CaseID &caseID)
virtual const VectorType & GetValue() const
returns a const reference to the contained vector
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
std::vector< Lesion > LesionVector
void AddControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
SemanticTypes::ControlPoint GetControlPointOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
void AddImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
MITKSEMANTICRELATIONS_EXPORT void RenameExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
std::vector< ControlPoint > ControlPointVector
void RemoveLesionClass(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &lesionClassID)
SemanticTypes::Lesion GetLesionOfSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
void RemoveControlPointFromExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::ExaminationPeriod &examinationPeriod)
void LinkImageToControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID, const SemanticTypes::ControlPoint &controlPoint)
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::LesionVector GetAllLesionsOfCase(const SemanticTypes::CaseID &caseID)
void UnlinkImageFromControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
void OverwriteLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
void RemoveExaminationPeriod(const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
#define PERSISTENCE_GET_SERVICE_MACRO
Providing a std::vector as property.
void RemoveLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfControlPoint(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint)
void RemoveInformationTypeFromImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
std::string InformationType
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriodVector GetAllExaminationPeriodsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT std::vector< SemanticTypes::CaseID > GetAllCaseIDs()
std::vector< InformationType > InformationTypeVector
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfCase(const SemanticTypes::CaseID &caseID)
void RemoveSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
void RemoveImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
Property for strings.
void AddLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
void AddSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID, const SemanticTypes::ID &parentID)
std::vector< ExaminationPeriod > ExaminationPeriodVector
SemanticTypes::ID GetImageIDOfSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &segmentationID)
void RemoveInformationType(const SemanticTypes::CaseID &caseID, const SemanticTypes::InformationType &informationType)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfCase(const SemanticTypes::CaseID &caseID)
void AddCase(const SemanticTypes::CaseID &caseID)