Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSUVImageFilter.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 mitkSUVImageFilter_h
14 #define mitkSUVImageFilter_h
15 
16 #include <MitkPETExports.h>
17 #include <mitkImageToImageFilter.h>
19 #include <mitkSUVInputModel.h>
21 #include <optional>
22 
23 namespace mitk
24 {
25  class IPropertyProvider;
26 
74  {
75  public:
77  itkFactorylessNewMacro(Self);
78 
85  itkSetEnumMacro(TargetVariant, SUVVariant);
86  itkGetConstMacro(TargetVariant, SUVVariant);
87 
98  itkGetConstMacro(DICOMReadPolicy, DICOMReadPolicy);
99 
100  // ---- Override fields ---------------------------------------------------
101  //
102  // Most Set / Get use itk macros. The decay-time and input-model
103  // overrides (SetDecayTimeOverrideInSec, SetDecayTimeOverrideMap,
104  // GetDecayTimeOverrideMap, SetInputModelOverride, GetInputModelOverride)
105  // are hand-written to enforce mutual-exclusion / value validation. All
106  // Clear and GetEffective accessors are hand-written.
107 
109  itkSetMacro(PatientWeightInGram, double);
110  itkGetConstMacro(PatientWeightInGram, std::optional<double>);
113 
115  itkSetMacro(PatientHeightInCm, double);
116  itkGetConstMacro(PatientHeightInCm, std::optional<double>);
119 
121  itkSetEnumMacro(PatientSex, Sex);
122  itkGetConstMacro(PatientSex, std::optional<Sex>);
125 
127  itkSetMacro(InjectedActivityInBq, double);
128  itkGetConstMacro(InjectedActivityInBq, std::optional<double>);
131 
133  itkSetMacro(HalfLifeInSec, double);
134  itkGetConstMacro(HalfLifeInSec, std::optional<double>);
137 
159  void SetDecayTimeOverrideInSec(double value);
160  itkGetConstMacro(DecayTimeOverrideInSec, std::optional<double>);
162 
185  const std::optional<DecayTimeMapType>& GetDecayTimeOverrideMap() const;
186 
188 
196  itkSetMacro(TracerIndex, int);
197  itkGetConstMacro(TracerIndex, std::optional<int>);
199 
212  std::optional<SUVInputModel> GetInputModelOverride() const;
214 
235  std::optional<SUVInputModel> GetDetectedInputModel() const noexcept;
236 
273  void ConfigureFromProperties(const IPropertyProvider *props);
274 
275  protected:
277  ~SUVImageFilter() override;
278 
279  void GenerateData() override;
280  void GenerateOutputInformation() override;
281 
282  private:
284  static void RequireConfigured(bool configured, const char *fieldName);
285 
287  void ProcessTimeStep(const Image *stepIn,
288  Image *dst,
289  TimeStepType dstStep,
290  double injectedActivity,
291  double scaleNumerator,
292  double halfLife,
293  const DecayTimeSliceMapType &sliceMap) const;
294 
295  SUVVariant m_TargetVariant{SUVVariant::BW};
296  DICOMReadPolicy m_DICOMReadPolicy{DICOMReadPolicy::Lenient};
297 
298  // Override slots: empty == "not set by user, derive from properties".
299  std::optional<double> m_PatientWeightInGram;
300  std::optional<double> m_PatientHeightInCm;
301  std::optional<Sex> m_PatientSex;
302  std::optional<double> m_InjectedActivityInBq;
303  std::optional<double> m_HalfLifeInSec;
304  std::optional<double> m_DecayTimeOverrideInSec;
305  std::optional<DecayTimeMapType> m_DecayTimeOverrideMap;
306  std::optional<int> m_TracerIndex;
307  std::optional<SUVInputModel> m_InputModelOverride;
308 
309  // Effective values resolved by ConfigureFromProperties().
310  std::optional<double> m_EffectivePatientWeightInGram;
311  std::optional<double> m_EffectivePatientHeightInCm;
312  std::optional<Sex> m_EffectivePatientSex;
313  std::optional<double> m_EffectiveInjectedActivityInBq;
314  std::optional<double> m_EffectiveHalfLifeInSec;
315  std::optional<DecayCorrectionInfo> m_EffectiveDecayCorrection;
316  std::optional<SUVInputModel> m_EffectiveInputModel;
317 
318  // Detected input model: sticky across rollbacks (does not need to
319  // round-trip the failure case because classification is a pure
320  // function of (props, override, policy)). Drives UI affordances
321  // that must remain available even after a configuration failure
322  // further downstream (e.g. showing the sex / height combos when
323  // the source variant of a pre-normalized input requires them).
324  std::optional<SUVInputModel> m_DetectedInputModel;
325 
326  bool m_Configured{false};
327 
328  // Modification time captured at the end of the last successful
329  // ConfigureFromProperties. GenerateData reconfigures when a later
330  // setter bumps GetMTime() past this value, so override changes made
331  // after configuration are not silently ignored at Update().
332  itk::ModifiedTimeType m_ConfigureMTime{0};
333  };
334 } // namespace mitk
335 
336 #endif
#define MITKPET_EXPORT
Interface implemented by classes that provide access to property information.
Superclass of all classes having one or more Images as input and generating Images as output.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Image-to-image filter that converts a PET image into a SUV image.
void SetDecayTimeOverrideInSec(double value)
Override the decay duration uniformly across every voxel, in [s].
void ClearInjectedActivityInBq()
SUVInputModel GetEffectiveInputModel() const
itkSetEnumMacro(DICOMReadPolicy, DICOMReadPolicy)
Policy for IBSI-SUV-recommended adaptations of borderline / ambiguous DICOM input.
double GetEffectivePatientWeightInGram() const
void ClearDecayTimeOverrideInSec()
std::optional< SUVInputModel > GetDetectedInputModel() const noexcept
Input model classified (or override-derived) by the most recent ConfigureFromProperties call,...
double GetEffectiveInjectedActivityInBq() const
std::optional< SUVInputModel > GetInputModelOverride() const
itkSetEnumMacro(PatientSex, Sex)
Override DICOM (0010,0040) Patient Sex.
void ClearInputModelOverride()
void SetDecayTimeOverrideMap(DecayTimeMapType map)
Override the decay duration on a per-(timestep, slice) basis, in [s].
mitkClassMacro(SUVImageFilter, ImageToImageFilter)
void ClearPatientWeightInGram()
itkSetEnumMacro(TargetVariant, SUVVariant)
Set the target SUV variant.
void ClearDecayTimeOverrideMap()
double GetEffectivePatientHeightInCm() const
void SetInputModelOverride(SUVInputModel v)
Override the pixel-semantics classification.
const DecayCorrectionInfo & GetEffectiveDecayCorrection() const
const std::optional< DecayTimeMapType > & GetDecayTimeOverrideMap() const
Sex GetEffectivePatientSex() const
double GetEffectiveHalfLifeInSec() const
Find image slices visible on a given plane.
std::map< mitk::TimeStepType, DecayTimeSliceMapType > DecayTimeMapType
Map storing per-time-step decay time slice maps.
DICOMReadPolicy
Policy controlling whether benchmark-recommended adaptations of borderline / non-spec DICOM input are...
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).
SUVVariant
Identifies a Standardized Uptake Value (SUV) variant.
std::map< mitk::SlicedData::IndexValueType, double > DecayTimeSliceMapType
Map storing the residual decay time in seconds per slice.
Sex
Patient sex modeled as a closed set.
Result of DeduceDecayCorrection().
Classification of how a PET image's raw pixel values relate to the SUV pipeline.