Medical Imaging Interaction Toolkit  2018.4.99-c670e289
Medical Imaging Interaction Toolkit
mitkAutoMLSegmentationWithPreviewTool.h
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 #ifndef MITK_AUTO_ML_SEGMENTATION_WITH_PREVIEW_TOOL_H
13 #define MITK_AUTO_ML_SEGMENTATION_WITH_PREVIEW_TOOL_H
14 
16 #include "mitkDataNode.h"
17 #include "mitkLabelSetImage.h"
18 
20 
21 namespace mitk
22 {
36  {
37  public:
39 
40  void Activated() override;
41  void Deactivated() override;
42 
43  using SelectedLabelVectorType = std::vector<Label::PixelType>;
44  void SetSelectedLabels(const SelectedLabelVectorType& regions);
45  SelectedLabelVectorType GetSelectedLabels() const;
46 
47  const LabelSetImage* GetMLPreview() const;
48 
49  protected:
52 
53  void UpdateCleanUp() override;
54  void DoUpdatePreview(const Image* inputAtTimeStep, Image* previewImage, TimeStepType timeStep) override;
55 
63  virtual LabelSetImage::Pointer ComputeMLPreview(const Image* inputAtTimeStep, TimeStepType timeStep) = 0;
64 
65  private:
72  template <typename TPixel, unsigned int VImageDimension>
73  void CalculateMergedSimplePreview(const itk::Image<TPixel, VImageDimension>* mlImage, mitk::Image* segmentation, unsigned int timeStep);
74 
75  SelectedLabelVectorType m_SelectedLabels = {};
76 
77  // holds the multilabel result as a preview image
78  mitk::DataNode::Pointer m_MLPreviewNode;
79  TimeStepType m_LastMLTimeStep = 0;
80  };
81 }
82 #endif
Base class for any auto segmentation tool that provides a preview of the new segmentation and generat...
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:73
std::vcl_size_t TimeStepType
LabelSetImage class for handling labels and layers in a segmentation session.
Base class for any auto segmentation tool that provides a preview of the new segmentation.