Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkSegmentationTaskList.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 
13 #ifndef mitkSegmentationTaskList_h
14 #define mitkSegmentationTaskList_h
15 
16 #include <mitkBaseData.h>
18 
19 #include <MitkMultilabelExports.h>
20 
21 #include <mitkFileSystem.h>
22 #include <optional>
23 
24 namespace mitk
25 {
31  {
32  public:
34  {
35  public:
36  Task();
37  ~Task();
38 
39  void SetDefaults(const Task* defaults);
40 
41  mitkSegmentationTaskValueMacro(std::string, Name)
42  mitkSegmentationTaskValueMacro(std::string, Description)
44  mitkSegmentationTaskValueMacro(fs::path, Segmentation)
45  mitkSegmentationTaskValueMacro(std::string, LabelName)
46  mitkSegmentationTaskValueMacro(fs::path, LabelNameSuggestions)
47  mitkSegmentationTaskValueMacro(fs::path, Preset)
48  mitkSegmentationTaskValueMacro(fs::path, Result)
49  mitkSegmentationTaskValueMacro(bool, Dynamic)
50 
51  private:
52  const Task* m_Defaults;
53  };
54 
56  itkFactorylessNewMacro(Self)
57  itkCloneMacro(Self)
58 
59  mitkSegmentationTaskListValueMacro(std::string, Name)
60  mitkSegmentationTaskListValueMacro(std::string, Description)
62  mitkSegmentationTaskListValueMacro(fs::path, Segmentation)
63  mitkSegmentationTaskListValueMacro(std::string, LabelName)
64  mitkSegmentationTaskListValueMacro(fs::path, LabelNameSuggestions)
65  mitkSegmentationTaskListValueMacro(fs::path, Preset)
66  mitkSegmentationTaskListValueMacro(fs::path, Result)
68 
69  size_t GetNumberOfTasks() const;
70  size_t AddTask(const Task& subtask);
71  const Task* GetTask(size_t index) const;
72  Task* GetTask(size_t index);
73 
74  const Task& GetDefaults() const;
75  void SetDefaults(const Task& defaults);
76 
77  bool IsDone() const;
78  bool IsDone(size_t index) const;
79 
80  fs::path GetInputLocation() const;
81  fs::path GetBasePath() const;
82  fs::path GetAbsolutePath(const fs::path& path) const;
83  fs::path GetInterimPath(const fs::path& path) const;
84 
85  void SaveTask(size_t index, const BaseData* segmentation, bool saveAsInterimResult = false);
86 
87  std::vector<Task>::const_iterator begin() const;
88  std::vector<Task>::const_iterator end() const;
89 
90  std::vector<Task>::iterator begin();
91  std::vector<Task>::iterator end();
92 
93  void SetRequestedRegionToLargestPossibleRegion() override;
94  bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
95  bool VerifyRequestedRegion() override;
96  void SetRequestedRegion(const itk::DataObject*) override;
97 
98  protected:
100 
102  SegmentationTaskList(const Self& other);
103  ~SegmentationTaskList() override;
104 
105  private:
106  Task m_Defaults;
107  std::vector<Task> m_Tasks;
108  };
109 }
110 
111 #endif
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::SegmentationTaskList
A list of segmentation tasks.
Definition: mitkSegmentationTaskList.h:30
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::SegmentationTaskList::Task
Definition: mitkSegmentationTaskList.h:33
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitkSegmentationTaskValueMacro
#define mitkSegmentationTaskValueMacro(type, name)
Definition: mitkSegmentationTaskListMacros.h:33
mitkBaseData.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkSegmentationTaskListValueMacro
#define mitkSegmentationTaskListValueMacro(type, name)
Definition: mitkSegmentationTaskListMacros.h:56
mitkSegmentationTaskListMacros.h
mitkFileSystem.h
MitkMultilabelExports.h