Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSlicedData.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 mitkSlicedData_h
14 #define mitkSlicedData_h
15 
16 #include <itkImageRegion.h>
17 #include <itkIndex.h>
18 #include <itkOffset.h>
19 #include <itkSize.h>
20 #include <mitkBaseData.h>
21 #include <mitkSlicedGeometry3D.h>
22 #include <MitkCoreExports.h>
23 
24 namespace mitk
25 {
26  class SlicedGeometry3D;
27 
45  {
46  public:
48 
49  itkStaticConstMacro(RegionDimension, unsigned int, 5);
50 
52  typedef itk::ImageRegion<RegionDimension> RegionType;
53 
55  typedef itk::Index<RegionDimension> IndexType;
56  typedef IndexType::IndexValueType IndexValueType;
57 
60  typedef itk::Offset<RegionDimension> OffsetType;
61  typedef OffsetType::OffsetValueType OffsetValueType;
62 
64  typedef itk::Size<RegionDimension> SizeType;
65  typedef SizeType::SizeValueType SizeValueType;
66 
76  void UpdateOutputInformation() override;
77 
84  void PrepareForNewData() override;
85 
93 
104 
113  bool VerifyRequestedRegion() override;
114 
122  void SetRequestedRegion(const itk::DataObject *data) override;
123 
131 
143 
149  const RegionType &GetLargestPossibleRegion() const { return m_LargestPossibleRegion; }
150 
157  virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
158 
167  virtual bool IsSliceSet(int s = 0, int t = 0, int n = 0) const = 0;
168 
176  virtual bool IsVolumeSet(int t = 0, int n = 0) const = 0;
177 
184  virtual bool IsChannelSet(int n = 0) const = 0;
185 
195  void CopyInformation(const itk::DataObject *data) override;
196 
205  unsigned int GetNumberOfChannels() const { return m_LargestPossibleRegion.GetSize(4); }
206 
218  SlicedGeometry3D *GetSlicedGeometry(unsigned int t = 0) const;
219 
232  const SlicedGeometry3D *GetUpdatedSlicedGeometry(unsigned int t = 0);
233 
246  void SetGeometry(BaseGeometry *aGeometry3D) override;
247 
258  void SetOrigin(const Point3D &origin) override;
259 
267  virtual void SetSpacing(const ScalarType aSpacing[]);
268 
276  virtual void SetSpacing(mitk::Vector3D aSpacing);
277 
278  protected:
280  SlicedData(const SlicedData &other);
281  ~SlicedData() override;
283 
286 
289  };
290 
291 } // namespace mitk
292 
293 #endif
#define MITKCORE_EXPORT
Base class of all data objects.
Definition: mitkBaseData.h:60
Abstract base class describing the geometry of a data object.
Super class of data objects consisting of slices.
virtual void SetSpacing(const ScalarType aSpacing[])
Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps.
RegionType m_LargestPossibleRegion
void SetGeometry(BaseGeometry *aGeometry3D) override
Set the BaseGeometry of the data, which will be referenced (not copied!).
unsigned int GetNumberOfChannels() const
Get the number of channels.
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it).
RegionType m_BufferedRegion
itkStaticConstMacro(RegionDimension, unsigned int, 5)
OffsetType::OffsetValueType OffsetValueType
virtual void SetSpacing(mitk::Vector3D aSpacing)
Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps.
virtual void SetRequestedRegion(SlicedData::RegionType *region)
Set the requested region from a RegionType pointer.
const RegionType & GetLargestPossibleRegion() const
Get the largest possible region.
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
itk::Size< RegionDimension > SizeType
itk::Offset< RegionDimension > OffsetType
itk::Index< RegionDimension > IndexType
~SlicedData() override
RegionType m_RequestedRegion
const SlicedGeometry3D * GetUpdatedSlicedGeometry(unsigned int t=0)
Convenience access method that returns an up-to-date SlicedGeometry3D.
bool m_RequestedRegionInitialized
void SetOrigin(const Point3D &origin) override
Convenience method for setting the origin of the SlicedGeometry3D instances of all time steps.
virtual bool IsVolumeSet(int t=0, int n=0) const =0
Check whether volume at time t in channel n is set.
SlicedData(const SlicedData &other)
IndexType::IndexValueType IndexValueType
void PrepareForNewData() override
Prepare the data object to receive new data.
itk::ImageRegion< RegionDimension > RegionType
virtual bool IsSliceSet(int s=0, int t=0, int n=0) const =0
Check whether slice s at time t in channel n is set.
void SetLargestPossibleRegion(SlicedData::RegionType *region)
Set the largest possible region.
mitkClassMacro(SlicedData, BaseData)
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region from another data object.
virtual bool IsChannelSet(int n=0) const =0
Check whether channel n is set.
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
SizeType::SizeValueType SizeValueType
void CopyInformation(const itk::DataObject *data) override
Copy information from the specified data set.
void UpdateOutputInformation() override
Update the information for this DataObject so it can be used as an output of a ProcessObject.
bool m_UseLargestPossibleRegion
virtual const RegionType & GetRequestedRegion() const
Get the region object that defines the size and starting index for the requested region (i....
Describes the geometry of a data object consisting of slices.
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.