Medical Imaging Interaction Toolkit  2024.06.00
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 {
40  {
41  public:
47 
49  itkNewMacro(Self);
50  itkTypeMacro(HotspotMaskGenerator, MaskGenerator);
51 
52  unsigned int GetNumberOfMasks() const override;
53 
57  itkSetObjectMacro(Mask, MaskGenerator);
58 
62  itkGetConstMacro(HotspotRadiusInMM, double);
63  itkSetMacro(HotspotRadiusInMM, double);
64 
68  itkGetConstMacro(HotspotMustBeCompletelyInsideImage, bool);
69  itkSetMacro(HotspotMustBeCompletelyInsideImage, bool);
70 
74  itkSetMacro(Label, unsigned short);
75 
76  protected:
78 
79  ~HotspotMaskGenerator() override;
80 
81  Image::ConstPointer DoGetMask(unsigned int) override;
82 
84  {
85  public:
86  bool Defined;
87  double Max;
88  double Min;
89  vnl_vector<int> MaxIndex;
90  vnl_vector<int> MinIndex;
91 
93  :Defined(false)
94  ,Max(itk::NumericTraits<double>::min())
95  ,Min(itk::NumericTraits<double>::max())
96  {
97  }
98  };
99 
100  private:
102  template <unsigned int VImageDimension>
103  itk::Size<VImageDimension>
104  CalculateConvolutionKernelSize(double spacing[VImageDimension], double radiusInMM);
105 
107  template <unsigned int VImageDimension>
109  GenerateHotspotSearchConvolutionKernel(double spacing[VImageDimension], double radiusInMM);
110 
112  template <typename TPixel, unsigned int VImageDimension>
114  GenerateConvolutionImage( const itk::Image<TPixel, VImageDimension>* inputImage );
115 
116 
118  template < typename TPixel, unsigned int VImageDimension>
119  void
120  FillHotspotMaskPixels( itk::Image<TPixel, VImageDimension>* maskImage,
121  itk::Point<double, VImageDimension> sphereCenter,
122  double sphereRadiusInMM);
123 
124 
126  template <typename TPixel, unsigned int VImageDimension>
127  void
128  CalculateHotspotMask(const itk::Image<TPixel, VImageDimension>* inputImage,
129  const itk::Image<unsigned short, VImageDimension>* maskImage,
130  unsigned int label);
131 
132 
133  template <typename TPixel, unsigned int VImageDimension >
134  ImageExtrema CalculateExtremaWorld( const itk::Image<TPixel, VImageDimension>* inputImage,
135  const itk::Image<unsigned short, VImageDimension>* maskImage,
136  double necessaryDistanceToImageBorderInMM,
137  unsigned int label);
138 
139  bool IsUpdateRequired() const;
140 
142  HotspotMaskGenerator & operator=(const HotspotMaskGenerator &);
143 
144  MaskGenerator::Pointer m_Mask;
145  mitk::Image::Pointer m_InternalMask;
146  itk::Image<unsigned short, 2>::ConstPointer m_internalMask2D;
147  itk::Image<unsigned short, 3>::ConstPointer m_internalMask3D;
148  double m_HotspotRadiusInMM;
149  bool m_HotspotMustBeCompletelyInsideImage;
150  unsigned short m_Label;
151  vnl_vector<int> m_ConvolutionImageMinIndex, m_ConvolutionImageMaxIndex;
152  unsigned long m_InternalMaskUpdateTime;
153  };
154 }
155 #endif
mitkImage.h
mitk::HotspotMaskGenerator::ImageExtrema::Min
double Min
Definition: mitkHotspotMaskGenerator.h:88
mitk::HotspotMaskGenerator::ImageExtrema::MinIndex
vnl_vector< int > MinIndex
Definition: mitkHotspotMaskGenerator.h:90
mitk::HotspotMaskGenerator::ImageExtrema
Definition: mitkHotspotMaskGenerator.h:83
mitkImageTimeSelector.h
itk::SmartPointer< Self >
mitk::HotspotMaskGenerator::Superclass
MaskGenerator Superclass
Definition: mitkHotspotMaskGenerator.h:44
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::HotspotMaskGenerator::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkHotspotMaskGenerator.h:45
mitkMaskGenerator.h
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:29
MITKIMAGESTATISTICS_EXPORT
#define MITKIMAGESTATISTICS_EXPORT
Definition: MitkImageStatisticsExports.h:15
mitk::HotspotMaskGenerator::ImageExtrema::ImageExtrema
ImageExtrema()
Definition: mitkHotspotMaskGenerator.h:92
mitk::HotspotMaskGenerator::ImageExtrema::Max
double Max
Definition: mitkHotspotMaskGenerator.h:87
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
mitk::HotspotMaskGenerator::Self
HotspotMaskGenerator Self
Definition: mitkHotspotMaskGenerator.h:43
mitk::HotspotMaskGenerator::ImageExtrema::MaxIndex
vnl_vector< int > MaxIndex
Definition: mitkHotspotMaskGenerator.h:89
MitkImageStatisticsExports.h
mitk::HotspotMaskGenerator::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: mitkHotspotMaskGenerator.h:46
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:86
mitk::HotspotMaskGenerator
The HotspotMaskGenerator class is used when a hotspot has to be found in an image....
Definition: mitkHotspotMaskGenerator.h:39