Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkNodePredicates.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 "mitkNodePredicates.h"
14 
15 // mitk core
17 #include <mitkNodePredicateNot.h>
18 #include <mitkNodePredicateOr.h>
20 
21 // multi label module
22 #include <mitkLabelSetImage.h>
23 
25 {
27 
28  NodePredicateOr::Pointer validImages = NodePredicateOr::New();
29  validImages->AddPredicate(isImage);
30 
31  NodePredicateAnd::Pointer imagePredicate = NodePredicateAnd::New();
32  imagePredicate->AddPredicate(validImages);
33  imagePredicate->AddPredicate(NodePredicateNot::New(GetSegmentationPredicate()));
34  imagePredicate->AddPredicate(NodePredicateNot::New(NodePredicateProperty::New("helper object")));
35 
36  return imagePredicate;
37 }
38 
40 {
41  NodePredicateAnd::Pointer segmentationPredicate = NodePredicateAnd::New();
42 
43  NodePredicateProperty::Pointer isBinary = NodePredicateProperty::New("binary", BoolProperty::New(true));
45  NodePredicateOr::Pointer allSegmentations = NodePredicateOr::New(isBinary, isLabelSetImage);
46 
47  segmentationPredicate->AddPredicate(allSegmentations);
48  segmentationPredicate->AddPredicate(NodePredicateNot::New(NodePredicateProperty::New("helper object")));
49 
50  return segmentationPredicate;
51 }
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetImagePredicate()
Tests for type compatibility (dynamic_cast).
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetSegmentationPredicate()