39 if (m_DataStorage.IsExpired())
49 for (
auto it = segmentationNodes->Begin(); it != segmentationNodes->End(); ++it)
51 DataNode* segmentationNode = it->Value();
69 if (caseID == currentCaseID && (std::find(allSegmentationIDsOfCase.begin(), allSegmentationIDsOfCase.end(), segmentationID) != allSegmentationIDsOfCase.end()))
72 allSegmentationsOfCase.push_back(segmentationNode);
76 return allSegmentationsOfCase;
92 return lesion.
UID != representedLesion.
UID;
99 allSegmentationsOfLesion.erase(std::remove_if(allSegmentationsOfLesion.begin(), allSegmentationsOfLesion.end(), lambda), allSegmentationsOfLesion.end());
101 return allSegmentationsOfLesion;
111 if (m_DataStorage.IsExpired())
121 for (
auto it = imageNodes->Begin(); it != imageNodes->End(); ++it)
141 if (caseID == currentCaseID && (std::find(allImageIDsOfCase.begin(), allImageIDsOfCase.end(), imageID) != allImageIDsOfCase.end()))
144 allImagesOfCase.push_back(imageNode);
148 return allImagesOfCase;
153 if (m_DataStorage.IsExpired())
162 for (
auto it = imageNodes->Begin(); it != imageNodes->End(); ++it)
181 if (std::find(imageIDs.begin(), imageIDs.end(), imageID) != imageIDs.end())
184 allImagesOfCase.push_back(imageNode);
188 return allImagesOfCase;
193 if (m_DataStorage.IsExpired())
202 for (
const auto& segmentationNode : allSegmentationsOfLesion)
206 for (
auto it = parentNodes->Begin(); it != parentNodes->End(); ++it)
209 allImagesOfLesion.push_back(it->Value());
213 std::sort(allImagesOfLesion.begin(), allImagesOfLesion.end());
214 allImagesOfLesion.erase(std::unique(allImagesOfLesion.begin(), allImagesOfLesion.end()), allImagesOfLesion.end());
215 return allImagesOfLesion;
233 allImagesOfCase.erase(std::remove_if(allImagesOfCase.begin(), allImagesOfCase.end(), lambda), allImagesOfCase.end());
235 return allImagesOfCase;
262 allImageIDsOfExaminationPeriod.erase(std::remove_if(allImageIDsOfExaminationPeriod.begin(), allImageIDsOfExaminationPeriod.end(), lambda), allImageIDsOfExaminationPeriod.end());
264 auto allImagesOfExaminationPeriod =
GetAllImagesByID(allImageIDsOfExaminationPeriod);
265 return allImagesOfExaminationPeriod;
280 if (m_DataStorage.IsExpired())
282 mitkThrow() <<
"Not a valid data storage.";
293 mitkReThrow(e) <<
"Cannot get the specific segmentation.";
297 for (
const auto& imageNode : allSpecificImages)
300 for (
auto it = segmentationNodes->Begin(); it != segmentationNodes->End(); ++it)
302 allSpecificSegmentations.push_back(it->Value());
306 return allSpecificSegmentations;
312 if (m_DataStorage.IsExpired())
314 mitkThrow() <<
"Not a valid data storage.";
325 mitkReThrow(e) <<
"Cannot get the specific segmentation.";
328 for (
const auto& segmentationNode : allSpecificSegmentations)
331 if (representedLesion.
UID == lesion.
UID)
333 return segmentationNode;
SemanticTypes::InformationType GetInformationTypeOfImage(const SemanticTypes::CaseID &caseID, const SemanticTypes::ID &imageID)
Data management class that handles 'was created by' relations.
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
DataNodeVector GetAllSegmentationsOfCase(const SemanticTypes::CaseID &caseID) const
Return a vector of all segmentations that are currently available for the given case. The segmentations may be connected / not connected to a lesion of the case. If no segmentations are stored for the current case, an empty vector is returned.
DataNode::Pointer GetSpecificSegmentation(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::InformationType &informationType, const SemanticTypes::Lesion &lesion) const
Return the single segmentation node that is defined with the given information type, the given control point and is representing the given lesion. The function uses the 'GetAllSpecificSegmentations'-function to retrieve the specific segmentations and then checks for the represented lesion.
std::vector< DataNode::Pointer > DataNodeVector
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetImagePredicate()
DataNodeVector GetAllImagesOfCase(const SemanticTypes::CaseID &caseID) const
Return a vector of all images that are currently available for the given case.
#define mitkReThrow(mitkexception)
DataNodeVector GetAllSegmentationsOfLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion) const
Return a vector of all segmentations that define the given lesion. These segmentations don't have to ...
boost::gregorian::date date
SemanticRelationsDataStorageAccess(DataStorage *dataStorage)
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...
itk::SmartPointer< Self > Pointer
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetSegmentationPredicate()
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::CaseID GetCaseIDFromDataNode(const mitk::DataNode *dataNode)
mitk::DataStorage::Pointer m_DataStorage
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...
DataNodeVector GetAllImagesByID(const SemanticTypes::IDVector &imageIDs) const
Return a vector of all images that are specified by the given vector of image IDs.
The concept of an examination period. An examination period holds a vector of control point UIDs...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ID GetIDFromDataNode(const mitk::DataNode *dataNode)
DataNodeVector GetAllSpecificSegmentations(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::InformationType &informationType) const
Return a vector of all segmentation nodes that are defined with the given control point and the given...
#define mitkThrowException(classname)
std::string InformationType
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfCase(const SemanticTypes::CaseID &caseID)
DataNodeVector GetAllSpecificImages(const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::InformationType &informationType) const
Return a vector of all image nodes that are defined with the given control point and the given inform...
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfCase(const SemanticTypes::CaseID &caseID)
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::Lesion GetLesionOfSegmentation(const DataNode *segmentationNode)
Return the lesion that is defined by the given segmentation.
DataNodeVector GetAllImagesOfLesion(const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion) const
Return a vector of all images that are connected to those segmentations that are linked to the given ...
Class for nodes of the DataTree.
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 ...