ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLabelSelectionLabelMapFilter.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 __itkLabelSelectionLabelMapFilter_h
00019 #define __itkLabelSelectionLabelMapFilter_h
00020 
00021 #include "itkAttributeSelectionLabelMapFilter.h"
00022 #include "itkLabelObject.h"
00023 #include "itkLabelObjectAccessors.h"
00024 #include <set>
00025 
00026 
00027 namespace itk {
00052 template<class TImage>
00053 class ITK_EXPORT LabelSelectionLabelMapFilter :
00054     public AttributeSelectionLabelMapFilter<TImage, typename Functor::LabelLabelObjectAccessor< typename TImage::LabelObjectType > >
00055 {
00056 public:
00058   typedef LabelSelectionLabelMapFilter Self;
00059   typedef AttributeSelectionLabelMapFilter<TImage, typename Functor::LabelLabelObjectAccessor< typename TImage::LabelObjectType > >
00060                                        Superclass;
00061   typedef SmartPointer<Self>           Pointer;
00062   typedef SmartPointer<const Self>     ConstPointer;
00063 
00065   typedef TImage                              ImageType;
00066   typedef typename ImageType::Pointer         ImagePointer;
00067   typedef typename ImageType::ConstPointer    ImageConstPointer;
00068   typedef typename ImageType::PixelType       PixelType;
00069   typedef typename ImageType::IndexType       IndexType;
00070 
00071   typedef typename Superclass::AttributeAccessorType AttributeAccessorType;
00072   typedef typename Superclass::AttributeValueType    AttributeValueType;
00073 
00074   typedef typename Superclass::AttributeSetType AttributeSetType;
00075 
00077   itkStaticConstMacro(ImageDimension, unsigned int,
00078                       TImage::ImageDimension);
00079 
00081   itkNewMacro(Self);
00082 
00084   itkTypeMacro(LabelSelectionLabelMapFilter,
00085                AttributeSelectionLabelMapFilter);
00086 
00087 #ifdef ITK_USE_CONCEPT_CHECKING
00088 
00089 /*  itkConceptMacro(InputEqualityComparableCheck,
00090     (Concept::EqualityComparable<InputImagePixelType>));
00091   itkConceptMacro(IntConvertibleToInputCheck,
00092     (Concept::Convertible<int, InputImagePixelType>));
00093   itkConceptMacro(InputOStreamWritableCheck,
00094     (Concept::OStreamWritable<InputImagePixelType>));*/
00095 
00097 #endif
00098 
00099   const AttributeSetType & GetLabelSet() const
00100     {
00101     return this->GetAttributeSet();
00102     }
00103 
00104   void SetLabelSet( const AttributeSetType & set )
00105     {
00106     this->SetAttributeSet( set );
00107     }
00108 
00110   void SetLabel( const AttributeValueType & attr )
00111     {
00112     this->SetAttribute( attr );
00113     }
00114 
00115   void ClearLabelSet()
00116     {
00117     this->ClearAttributeSet();
00118     }
00119 
00120   void AddLabel( const AttributeValueType & attr )
00121     {
00122     this->AddAttribute( attr );
00123     }
00124 
00125 protected:
00126   LabelSelectionLabelMapFilter() {};
00127   ~LabelSelectionLabelMapFilter() {};
00128 
00129 private:
00130   LabelSelectionLabelMapFilter(const Self&); //purposely not implemented
00131   void operator=(const Self&); //purposely not implemented
00132 
00133 }; // end of class
00134 
00135 } // end namespace itk
00136 
00137 #endif
00138