ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLabelObjectLine.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 __itkLabelObjectLine_h
00019 #define __itkLabelObjectLine_h
00020 
00021 #include "itkIndex.h"
00022 #include "itkIndent.h"
00023 
00024 namespace itk
00025 {
00041 template< unsigned int VImageDimension >
00042 class LabelObjectLine
00043 {
00044 public:
00045   itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);
00046 
00047   typedef Index< VImageDimension > IndexType;
00048   typedef SizeValueType            LengthType;
00049 
00050   LabelObjectLine() {}
00051   virtual ~LabelObjectLine() {}
00052   LabelObjectLine(const IndexType & idx, const LengthType & length);
00053 
00057   void SetIndex(const IndexType & idx);
00058 
00059   const IndexType & GetIndex() const;
00060 
00064   void SetLength(const LengthType length);
00065 
00066   const LengthType & GetLength() const;
00067 
00071   bool HasIndex(const IndexType idx) const;
00072 
00073   bool IsNextIndex(const IndexType & idx) const;
00074 
00076   void Print(std::ostream & os, Indent indent = 0) const;
00077 
00078 protected:
00083   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00084 
00085   virtual void PrintHeader(std::ostream & os, Indent indent) const;
00086 
00087   virtual void PrintTrailer(std::ostream & os, Indent indent) const;
00088 
00089 private:
00090   IndexType  m_Index;
00091   LengthType m_Length;
00092 };
00093 } // end namespace itk
00094 
00095 #ifndef ITK_MANUAL_INSTANTIATION
00096 #include "itkLabelObjectLine.hxx"
00097 #endif
00098 
00099 #endif
00100