ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkTemporalRegion.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkTemporalRegion_h
19 #define itkTemporalRegion_h
20 
21 #include "itkRegion.h"
22 #include "itkRealTimeStamp.h"
23 #include "itkRealTimeInterval.h"
24 #include "itkNumericTraits.h"
25 #include <climits>
26 #include "ITKVideoCoreExport.h"
27 
29 #define ITK_INFINITE_FRAME_DURATION itk::NumericTraits<itk::SizeValueType>::max()
30 #define ITK_INFINITE_REAL_DURATION RealTimeInterval(ITK_INFINITE_FRAME_DURATION, 0)
31 
32 namespace itk
33 {
42 class ITKVideoCore_EXPORT TemporalRegion : public Region
43 {
44 public:
45 
48  using Superclass = Region;
49 
50  itkTypeMacro(TemporalRegion, Region);
51 
54 
56  void SetRealStart(const RealTimeStamp s);
57  RealTimeStamp GetRealStart() const;
59 
61  void SetRealDuration(const RealTimeInterval d);
62  RealTimeInterval GetRealDuration() const;
64 
66  void SetFrameStart(const FrameOffsetType s);
67  FrameOffsetType GetFrameStart() const;
69 
71  void SetFrameDuration(const FrameOffsetType d);
72  FrameOffsetType GetFrameDuration() const;
74 
76  RegionType GetRegionType() const override;
77 
80 
82  ~TemporalRegion() override;
83 
85  virtual bool IsEqualInFrames(const Self & region) const;
86 
88  bool IsEqualInRealTime(const Self & region) const;
89 
91  bool operator==(const Self & region) const;
92 
93  bool operator!=(const Self & region) const;
94 
95 protected:
96 
97  void PrintSelf(std::ostream & os, Indent indent) const override;
98 
102  FrameOffsetType m_FrameStart{0};
103  FrameOffsetType m_FrameDuration{0};
104 
105 }; // end class TemporalRegion
106 
108 ITKVideoCore_EXPORT std::ostream & operator<<(std::ostream & os, const TemporalRegion & region);
109 
110 } // end namespace itk
111 
112 #endif
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
Definition: itkIndex.h:485
::itk::SizeValueType FrameOffsetType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:188
The RealTimeStamp is a data structure for representing time with high precision and a large dynamic r...
A data structure for representing the time span between two RealTimeStamps, with similar high precisi...
RealTimeStamp m_RealStart
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
Definition: itkIndex.h:492
Region subclass that holds a region in time.
RealTimeInterval m_RealDuration
A region represents some portion or piece of data.
Definition: itkRegion.h:64
Control indentation during Print() invocation.
Definition: itkIndent.h:49