ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkTemporalRegion.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkTemporalRegion_h
00019 #define __itkTemporalRegion_h
00020 
00021 #include "itkRegion.h"
00022 #include "itkRealTimeStamp.h"
00023 #include "itkRealTimeInterval.h"
00024 #include "itkNumericTraits.h"
00025 #include <limits.h>
00026 
00028 #define ITK_INFINITE_FRAME_DURATION itk::NumericTraits<itk::SizeValueType>::max()
00029 #define ITK_INFINITE_REAL_DURATION RealTimeInterval(ITK_INFINITE_FRAME_DURATION, 0)
00030 
00031 namespace itk
00032 {
00041 class ITK_EXPORT TemporalRegion : public Region
00042 {
00043 public:
00044 
00046   typedef TemporalRegion       Self;
00047   typedef Region               Superclass;
00048 
00049   itkTypeMacro(TemporalRegion, Region);
00050 
00052   typedef ::itk::SizeValueType FrameOffsetType;
00053 
00055   void SetRealStart(const RealTimeStamp s);
00056   RealTimeStamp GetRealStart() const;
00058 
00060   void SetRealDuration(const RealTimeInterval d);
00061   RealTimeInterval GetRealDuration() const;
00063 
00065   void SetFrameStart(const FrameOffsetType s);
00066   FrameOffsetType GetFrameStart() const;
00068 
00070   void SetFrameDuration(const FrameOffsetType d);
00071   FrameOffsetType GetFrameDuration() const;
00073 
00075   virtual RegionType GetRegionType() const;
00076 
00078   TemporalRegion();
00079 
00081   virtual ~TemporalRegion();
00082 
00084   virtual bool IsEqualInFrames(const Self & region) const;
00085 
00087   bool IsEqualInRealTime(const Self & region) const;
00088 
00090   bool operator==(const Self & region) const;
00091 
00092   bool operator!=(const Self & region) const;
00093 
00094 protected:
00095 
00096   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00097 
00099   RealTimeStamp    m_RealStart;
00100   RealTimeInterval m_RealDuration;
00101   FrameOffsetType  m_FrameStart;
00102   FrameOffsetType  m_FrameDuration;
00103 
00104 };  // end class TemporalRegion
00105 
00107 std::ostream & operator<<(std::ostream & os, const TemporalRegion & region);
00108 
00109 } // end namespace itk
00110 
00111 #endif
00112