Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkRandomImageSampler.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 mitkRandomImageSampler_h
13 #define mitkRandomImageSampler_h
14 
15 #include "MitkCLUtilitiesExports.h"
16 
17 //MITK
18 #include <mitkImage.h>
19 #include "mitkImageToImageFilter.h"
20 #include <itkImage.h>
21 
22 namespace mitk
23 {
25  {
30  };
31 
32 
34  {
35  public:
36 
38  itkFactorylessNewMacro(Self);
39  itkCloneMacro(Self);
40  itkSetMacro(SamplingMode, RandomImageSamplerMode);
41  itkGetConstMacro(SamplingMode, RandomImageSamplerMode);
42 
43  itkSetMacro(AcceptanceRate, double);
44  itkGetConstMacro(AcceptanceRate, double);
45 
46  //itkSetMacro(AcceptanceRateVector, std::vector<double>);
47  void SetAcceptanceRateVector(std::vector<double> arg)
48  {
49  m_AcceptanceRateVector = arg;
50  }
51 
52  itkGetConstMacro(AcceptanceRateVector, std::vector<double>);
53 
54  itkSetMacro(NumberOfSamples, unsigned int);
55  itkGetConstMacro(NumberOfSamples, unsigned int);
56 
57  //itkSetMacro(NumberOfSamplesVector, std::vector<unsigned int>);
58  void SetNumberOfSamplesVector(std::vector<unsigned int> arg)
59  {
60  m_NumberOfSamplesVector = arg;
61  }
62 
63  itkGetConstMacro(NumberOfSamplesVector, std::vector<unsigned int>);
64 
65  private:
73  ~RandomImageSampler() override;
78  void GenerateOutputInformation() override;
83  void GenerateData() override;
84 
88  template<typename TPixel, unsigned int VImageDimension>
89  void ItkImageProcessing(const itk::Image<TPixel, VImageDimension>* itkImage);
90 
94  template<typename TPixel, unsigned int VImageDimension>
95  void ItkImageProcessingClassDependendSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
96 
100  template<typename TPixel, unsigned int VImageDimension>
101  void ItkImageProcessingFixedNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
102 
106  template<typename TPixel, unsigned int VImageDimension>
107  void ItkImageProcessingClassDependendNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
108 
109  double m_AcceptanceRate;
110  std::vector<double> m_AcceptanceRateVector;
111  unsigned int m_NumberOfSamples;
112  std::vector<unsigned int> m_NumberOfSamplesVector;
113  RandomImageSamplerMode m_SamplingMode;
114  };
115 } //END mitk namespace
116 #endif
MITKCLUTILITIES_EXPORT
#define MITKCLUTILITIES_EXPORT
Definition: MitkCLUtilitiesExports.h:15
mitk::CLASS_DEPENDEND_ACCEPTANCE_RATE
@ CLASS_DEPENDEND_ACCEPTANCE_RATE
Definition: mitkRandomImageSampler.h:27
mitk::RandomImageSampler::SetAcceptanceRateVector
void SetAcceptanceRateVector(std::vector< double > arg)
Definition: mitkRandomImageSampler.h:47
mitkImageToImageFilter.h
mitkImage.h
mitk::SINGLE_NUMBER_OF_ACCEPTANCE
@ SINGLE_NUMBER_OF_ACCEPTANCE
Definition: mitkRandomImageSampler.h:28
mitk::RandomImageSamplerMode
RandomImageSamplerMode
Definition: mitkRandomImageSampler.h:24
mitk::SINGLE_ACCEPTANCE_RATE
@ SINGLE_ACCEPTANCE_RATE
Definition: mitkRandomImageSampler.h:26
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::RandomImageSampler
Definition: mitkRandomImageSampler.h:33
mitk::RandomImageSampler::SetNumberOfSamplesVector
void SetNumberOfSamplesVector(std::vector< unsigned int > arg)
Definition: mitkRandomImageSampler.h:58
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::CLASS_DEPENDEND_NUMBER_OF_ACCEPTANCE
@ CLASS_DEPENDEND_NUMBER_OF_ACCEPTANCE
Definition: mitkRandomImageSampler.h:29
MitkCLUtilitiesExports.h
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25