Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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)
60  mitkSegmentationTaskValueMacro(fs::path, Preset)
61  mitkSegmentationTaskValueMacro(fs::path, Result)
62  mitkSegmentationTaskValueMacro(bool, Dynamic)
65 
66  private:
67  const Task* m_Defaults;
68  };
69 
71  itkFactorylessNewMacro(Self)
72  itkCloneMacro(Self)
73 
74  mitkSegmentationTaskListValueMacro(std::string, Name)
75  mitkSegmentationTaskListValueMacro(std::string, Description)
77  mitkSegmentationTaskListValueMacro(fs::path, Segmentation)
78  mitkSegmentationTaskListValueMacro(std::string, LabelName)
79  mitkSegmentationTaskListValueMacro(fs::path, LabelNameSuggestions)
80  mitkSegmentationTaskListValueMacro(fs::path, Preset)
81  mitkSegmentationTaskListValueMacro(fs::path, Result)
85 
86  size_t GetNumberOfTasks() const;
87  size_t AddTask(const Task& subtask);
88  const Task* GetTask(size_t index) const;
89  Task* GetTask(size_t index);
90 
91  const Task& GetDefaults() const;
92  void SetDefaults(const Task& defaults);
93 
94  bool IsDone() const;
95  bool IsDone(size_t index) const;
96 
97  fs::path GetInputLocation() const;
98  fs::path GetBasePath() const;
99  fs::path GetAbsolutePath(const fs::path& path) const;
100  fs::path GetInterimPath(const fs::path& path) const;
101 
102  void SaveTask(size_t index, const BaseData* segmentation, bool saveAsInterimResult = false);
103 
104  std::vector<Task>::const_iterator begin() const;
105  std::vector<Task>::const_iterator end() const;
106 
107  std::vector<Task>::iterator begin();
108  std::vector<Task>::iterator end();
109 
110  void SetRequestedRegionToLargestPossibleRegion() override;
111  bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
112  bool VerifyRequestedRegion() override;
113  void SetRequestedRegion(const itk::DataObject*) override;
114 
115  protected:
117 
119  SegmentationTaskList(const Self& other);
120  ~SegmentationTaskList() override;
121 
122  private:
123  Task m_Defaults;
124  std::vector<Task> m_Tasks;
125  };
126 }
127 
128 #endif
mitk::SegmentationTaskList::Task::Scene::Image
std::string Image
Definition: mitkSegmentationTaskList.h:45
mitk::SegmentationTaskList::Task::Form::Path
fs::path Path
Definition: mitkSegmentationTaskList.h:38
mitk::SegmentationTaskList::Task::Scene::Path
fs::path Path
Definition: mitkSegmentationTaskList.h:44
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::Form
Definition: mitkSegmentationTaskList.h:36
mitk::SegmentationTaskList::Task
Definition: mitkSegmentationTaskList.h:33
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::SegmentationTaskList::Task::Form::Result
fs::path Result
Definition: mitkSegmentationTaskList.h:39
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
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
MitkSegmentationExports.h
mitkSegmentationTaskListValueMacro
#define mitkSegmentationTaskListValueMacro(type, name)
Definition: mitkSegmentationTaskListMacros.h:56
mitkSegmentationTaskListMacros.h
mitkFileSystem.h
mitk::SegmentationTaskList::Task::Scene
Definition: mitkSegmentationTaskList.h:42
mitk::SegmentationTaskList::Task::Scene::Segmentation
std::string Segmentation
Definition: mitkSegmentationTaskList.h:46