Medical Imaging Interaction Toolkit  2023.12.99-4c75e429
Medical Imaging Interaction Toolkit
mitkHotspotMaskGenerator.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 mitkHotspotMaskGenerator_h
14 #define mitkHotspotMaskGenerator_h
15 
16 #include <itkObject.h>
17 #include <mitkImage.h>
18 #include <itkImage.h>
19 #include <itkTimeStamp.h>
20 #include <stdexcept>
22 #include <mitkImageTimeSelector.h>
23 #include <mitkMaskGenerator.h>
24 
25 
26 namespace mitk
27 {
38  {
39  public:
45 
47  itkNewMacro(Self);
48  itkTypeMacro(HotspotMaskGenerator, MaskGenerator);
49 
53  void SetInputImage(mitk::Image::Pointer inputImage);
54 
58  void SetMask(MaskGenerator::Pointer mask);
59 
63  void SetHotspotRadiusInMM(double radiusInMillimeter);
64 
65  const double& GetHotspotRadiusinMM() const;
66 
70  void SetHotspotMustBeCompletelyInsideImage(bool hotspotCompletelyInsideImage);
71 
72  bool GetHotspotMustBeCompletelyInsideImage() const;
73 
77  void SetLabel(unsigned short label);
78 
82  mitk::Image::ConstPointer GetMask() override;
83 
87  vnl_vector<int> GetHotspotIndex();
88 
92  vnl_vector<int> GetConvolutionImageMinIndex();
93 
98  void SetTimeStep(unsigned int timeStep) override;
99 
100  protected:
102 
103  ~HotspotMaskGenerator() override;
104 
106  {
107  public:
108  bool Defined;
109  double Max;
110  double Min;
111  vnl_vector<int> MaxIndex;
112  vnl_vector<int> MinIndex;
113 
115  :Defined(false)
116  ,Max(itk::NumericTraits<double>::min())
117  ,Min(itk::NumericTraits<double>::max())
118  {
119  }
120  };
121 
122  private:
124  template <unsigned int VImageDimension>
125  itk::Size<VImageDimension>
126  CalculateConvolutionKernelSize(double spacing[VImageDimension], double radiusInMM);
127 
129  template <unsigned int VImageDimension>
131  GenerateHotspotSearchConvolutionKernel(double spacing[VImageDimension], double radiusInMM);
132 
134  template <typename TPixel, unsigned int VImageDimension>
136  GenerateConvolutionImage( const itk::Image<TPixel, VImageDimension>* inputImage );
137 
138 
140  template < typename TPixel, unsigned int VImageDimension>
141  void
142  FillHotspotMaskPixels( itk::Image<TPixel, VImageDimension>* maskImage,
143  itk::Point<double, VImageDimension> sphereCenter,
144  double sphereRadiusInMM);
145 
146 
148  template <typename TPixel, unsigned int VImageDimension>
149  void
150  CalculateHotspotMask(itk::Image<TPixel, VImageDimension>* inputImage,
151  const itk::Image<unsigned short, VImageDimension>* maskImage,
152  unsigned int label);
153 
154 
155  template <typename TPixel, unsigned int VImageDimension >
156  ImageExtrema CalculateExtremaWorld( const itk::Image<TPixel, VImageDimension>* inputImage,
157  const itk::Image<unsigned short, VImageDimension>* maskImage,
158  double neccessaryDistanceToImageBorderInMM,
159  unsigned int label);
160 
161  bool IsUpdateRequired() const;
162 
164  HotspotMaskGenerator & operator=(const HotspotMaskGenerator &);
165 
166  MaskGenerator::Pointer m_Mask;
167  mitk::Image::Pointer m_InternalMask;
168  mitk::Image::Pointer m_internalImage;
169  itk::Image<unsigned short, 2>::ConstPointer m_internalMask2D;
170  itk::Image<unsigned short, 3>::ConstPointer m_internalMask3D;
171  double m_HotspotRadiusinMM;
172  bool m_HotspotMustBeCompletelyInsideImage;
173  unsigned short m_Label;
174  vnl_vector<int> m_ConvolutionImageMinIndex, m_ConvolutionImageMaxIndex;
175  unsigned long m_InternalMaskUpdateTime;
176  };
177 }
178 #endif
mitkImage.h
mitk::HotspotMaskGenerator::ImageExtrema::Min
double Min
Definition: mitkHotspotMaskGenerator.h:110
mitk::HotspotMaskGenerator::ImageExtrema::MinIndex
vnl_vector< int > MinIndex
Definition: mitkHotspotMaskGenerator.h:112
mitk::HotspotMaskGenerator::ImageExtrema
Definition: mitkHotspotMaskGenerator.h:105
mitkImageTimeSelector.h
itk::SmartPointer< Self >
mitk::HotspotMaskGenerator::Superclass
MaskGenerator Superclass
Definition: mitkHotspotMaskGenerator.h:42
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::HotspotMaskGenerator::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkHotspotMaskGenerator.h:43
mitkMaskGenerator.h
MITKIMAGESTATISTICS_EXPORT
#define MITKIMAGESTATISTICS_EXPORT
Definition: MitkImageStatisticsExports.h:15
mitk::HotspotMaskGenerator::ImageExtrema::ImageExtrema
ImageExtrema()
Definition: mitkHotspotMaskGenerator.h:114
mitk::HotspotMaskGenerator::ImageExtrema::Max
double Max
Definition: mitkHotspotMaskGenerator.h:109
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
mitk::HotspotMaskGenerator::Self
HotspotMaskGenerator Self
Definition: mitkHotspotMaskGenerator.h:41
mitk::HotspotMaskGenerator::ImageExtrema::MaxIndex
vnl_vector< int > MaxIndex
Definition: mitkHotspotMaskGenerator.h:111
MitkImageStatisticsExports.h
mitk::HotspotMaskGenerator::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: mitkHotspotMaskGenerator.h:44
mitk::MaskGenerator
Base Class for all Mask Generators. Mask generators are classes that provide functionality for the cr...
Definition: mitkMaskGenerator.h:30
mitk::HotspotMaskGenerator::ImageExtrema::Defined
bool Defined
Definition: mitkHotspotMaskGenerator.h:108
mitk::HotspotMaskGenerator
The HotspotMaskGenerator class is used when a hotspot has to be found in an image....
Definition: mitkHotspotMaskGenerator.h:37