Medical Imaging Interaction Toolkit  2026.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 
20 
21 #include <mitkFileSystem.h>
22 #include <optional>
23 
24 namespace mitk
25 {
31  {
32  public:
34  {
35  public:
37  {
38  fs::path Path;
39  fs::path Result;
40  };
41 
43  {
44  fs::path Path;
45  std::string Image;
46  std::string Segmentation;
47  };
48 
49  Task();
50  ~Task();
51 
52  void SetDefaults(const Task* defaults);
53 
54  mitkSegmentationTaskValueMacro(std::string, Name)
55  mitkSegmentationTaskValueMacro(std::string, Description)
57  mitkSegmentationTaskValueMacro(fs::path, Segmentation)
58  mitkSegmentationTaskValueMacro(std::string, LabelName)
59  mitkSegmentationTaskValueMacro(fs::path, LabelNameSuggestions)
65 
66  private:
67  const Task* m_Defaults;
68  };
69 
71  itkFactorylessNewMacro(Self)
72  itkCloneMacro(Self)
73 
75  mitkSegmentationTaskListValueMacro(std::string, Description)
77  mitkSegmentationTaskListValueMacro(fs::path, Segmentation)
78  mitkSegmentationTaskListValueMacro(std::string, LabelName)
79  mitkSegmentationTaskListValueMacro(fs::path, LabelNameSuggestions)
85 
87  size_t GetNumberOfTasks() const;
88 
94  size_t AddTask(const Task& subtask);
95 
101  const Task* GetTask(size_t index) const;
102 
108  Task* GetTask(size_t index);
109 
111  const Task& GetDefaults() const;
112 
117  void SetDefaults(const Task& defaults);
118 
120  bool IsDone() const;
121 
126  bool IsDone(size_t index) const;
127 
129  fs::path GetInputLocation() const;
130 
132  fs::path GetBasePath() const;
133 
139  fs::path GetAbsolutePath(const fs::path& path) const;
140 
146  fs::path GetInterimPath(const fs::path& path) const;
147 
154  void SaveTask(size_t index, const BaseData* segmentation, bool saveAsInterimResult = false);
155 
157  std::vector<Task>::const_iterator begin() const;
159  std::vector<Task>::const_iterator end() const;
160 
162  std::vector<Task>::iterator begin();
164  std::vector<Task>::iterator end();
165 
166  void SetRequestedRegionToLargestPossibleRegion() override;
167  bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
168  bool VerifyRequestedRegion() override;
169  void SetRequestedRegion(const itk::DataObject*) override;
170 
171  protected:
173 
175  SegmentationTaskList(const Self& other);
176  ~SegmentationTaskList() override;
177 
178  private:
179  Task m_Defaults;
180  std::vector<Task> m_Tasks;
181  };
182 }
183 
184 #endif
#define MITKSEGMENTATION_EXPORT
Base class of all data objects.
Definition: mitkBaseData.h:60
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
void SetDefaults(const Task *defaults)
A list of segmentation tasks.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:30
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:148
Portability header that provides a unified namespace alias for the C++ filesystem library.
Convenience macros for declaring SegmentationTask and SegmentationTaskList value properties.
#define mitkSegmentationTaskListValueMacro(type, name)
Declare Has/Get/SetDefault methods for a task list property (combines list-level macros).
#define mitkSegmentationTaskValueMacro(type, name)
Declare Has/Get/Set methods and the backing std::optional member for a task property.
Find image slices visible on a given plane.