Medical Imaging Interaction Toolkit  2022.04.99-2e1e005b
Medical Imaging Interaction Toolkit
QmitkImageStatisticsDataGenerator.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 QmitkImageStatisticsDataGenerator_h
14 #define QmitkImageStatisticsDataGenerator_h
15 
17 
19 
28 {
29 public:
30  QmitkImageStatisticsDataGenerator(mitk::DataStorage::Pointer storage, QObject* parent = nullptr) : QmitkImageAndRoiDataGeneratorBase(storage, parent) {};
32 
33  bool IsValidResultAvailable(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode) const;
34 
41  mitk::DataNode::Pointer GetLatestResult(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode, bool onlyIfUpToDate = false, bool noWIP = true) const;
42 
43  std::string GenerateStatisticsNodeName(const mitk::Image* image, const mitk::BaseData* roi) const;
44 
46  void SetIgnoreZeroValueVoxel(bool _arg);
48  bool GetIgnoreZeroValueVoxel() const;
49 
51  void SetHistogramNBins(unsigned int nbins);
53  unsigned int GetHistogramNBins() const;
54 
55 protected:
56  bool ChangedNodeIsRelevant(const mitk::DataNode* changedNode) const;
57  void IndicateFutureResults(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode) const;
58  std::pair<QmitkDataGenerationJobBase*, mitk::DataNode::Pointer> GetNextMissingGenerationJob(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode) const;
59  void RemoveObsoleteDataNodes(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode) const;
60  mitk::DataNode::Pointer PrepareResultForStorage(const std::string& label, mitk::BaseData* result, const QmitkDataGenerationJobBase* job) const;
61 
64 
65  bool m_IgnoreZeroValueVoxel = false;
66  unsigned int m_HistogramNBins = 100;
67 };
68 
69 #endif
virtual bool IsValidResultAvailable(const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const =0
virtual std::pair< QmitkDataGenerationJobBase *, mitk::DataNode::Pointer > GetNextMissingGenerationJob(const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const =0
Is called to generate the next job instance that needs to be done and is associated dummy node in ord...
bool ChangedNodeIsRelevant(const mitk::DataNode *changedNode) const override
Base of all data objects.
Definition: mitkBaseData.h:42
#define MITKIMAGESTATISTICSUI_EXPORT
virtual mitk::DataNode::Pointer PrepareResultForStorage(const std::string &label, mitk::BaseData *result, const QmitkDataGenerationJobBase *job) const =0
QmitkImageAndRoiDataGeneratorBase & operator=(const QmitkImageAndRoiDataGeneratorBase &)=delete
Image class for storing images.
Definition: mitkImage.h:69
QmitkImageStatisticsDataGenerator(mitk::DataStorage::Pointer storage, QObject *parent=nullptr)
virtual void IndicateFutureResults(const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const =0
virtual void RemoveObsoleteDataNodes(const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const =0
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
QmitkDataGenerationJobBase Base class for generation jobs used by QmitkDataGenerationBase and derived...