Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkLabelObjectLineComparator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelObjectLineComparator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-13 15:32:52 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkLabelObjectLineComparator_h
00018 #define __itkLabelObjectLineComparator_h
00019 
00020 namespace itk
00021 {
00022 
00036 namespace Functor {
00037 
00038 template< class TLabelObjectLine >
00039 class LabelObjectLineComparator
00040 {
00041 public:
00042   bool operator()(TLabelObjectLine const& l1, TLabelObjectLine const& l2) const
00043     {
00044     const typename TLabelObjectLine::IndexType & idx1 = l1.GetIndex();
00045     const typename TLabelObjectLine::IndexType & idx2 = l2.GetIndex();
00046     
00047     for(int i=TLabelObjectLine::ImageDimension - 1; i>=0; i--)
00048       {
00049       if(idx1[i] < idx2[i])
00050         {
00051         return true;
00052         }
00053       else if(idx1[i] > idx2[i])
00054         {
00055         return false;
00056         }
00057       }
00058     return l1.GetLength() < l2.GetLength();
00059     }
00060 };
00061 
00062 }
00063 
00064 }
00065 
00066 #endif
00067 

Generated at Thu May 28 10:38:43 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000