ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBinaryMaskToNarrowBandPointSetFilter.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 __itkBinaryMaskToNarrowBandPointSetFilter_h
00019 #define __itkBinaryMaskToNarrowBandPointSetFilter_h
00020 
00021 #include "itkImageToMeshFilter.h"
00022 #include "itkImageRegionIteratorWithIndex.h"
00023 #include "itkReinitializeLevelSetImageFilter.h"
00024 #include "itkRescaleIntensityImageFilter.h"
00025 
00026 namespace itk
00027 {
00053 template< class TInputImage, class TOutputMesh >
00054 class ITK_EXPORT BinaryMaskToNarrowBandPointSetFilter:
00055   public ImageToMeshFilter< TInputImage, TOutputMesh >
00056 {
00057 public:
00059   typedef BinaryMaskToNarrowBandPointSetFilter Self;
00060 
00061   typedef ImageToMeshFilter< TInputImage, TOutputMesh >  Superclass;
00062 
00063   typedef SmartPointer< Self >                 Pointer;
00064   typedef SmartPointer< const Self >           ConstPointer;
00065 
00067   itkNewMacro(Self);
00068 
00070   itkTypeMacro(BinaryMaskToNarrowBandPointSetFilter, ImageToMeshFilter);
00071 
00073   typedef TInputImage                           InputImageType;
00074   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00075   typedef typename InputImageType::RegionType   InputImageRegionType;
00076   typedef typename InputImageType::PixelType    InputImagePixelType;
00077 
00078   typedef ImageRegionConstIteratorWithIndex< InputImageType > InputImageIterator;
00079 
00081   typedef TOutputMesh                                 OutputMeshType;
00082   typedef typename OutputMeshType::PointType          PointType;
00083   typedef typename OutputMeshType::Pointer            OutputMeshPointer;
00084   typedef typename OutputMeshType::ConstPointer       OutputMeshConstPointer;
00085   typedef typename OutputMeshType::PointsContainer    PointsContainer;
00086   typedef typename OutputMeshType::PointIdentifier    PointIdentifier;
00087   typedef typename PointsContainer::Pointer           PointsContainerPointer;
00088   typedef typename PointsContainer::Iterator          PointsContainerIterator;
00089   typedef typename OutputMeshType::PointDataContainer PointDataContainer;
00090   typedef typename PointDataContainer::Pointer        PointDataContainerPointer;
00091   typedef typename PointDataContainer::Iterator       PointDataContainerIterator;
00092 
00094   itkStaticConstMacro(ImageDimension, unsigned int,
00095                       TInputImage::ImageDimension);
00096 
00098   typedef itk::Image< float,
00099                       itkGetStaticConstMacro(ImageDimension) >   RealImageType;
00100 
00105   typedef ReinitializeLevelSetImageFilter< RealImageType >  DistanceFilterType;
00106   typedef typename DistanceFilterType::Pointer              DistanceFilterPointer;
00107   typedef typename DistanceFilterType::NodeContainerPointer NodeContainerPointer;
00108   typedef typename DistanceFilterType::NodeContainer        NodeContainer;
00109   typedef typename NodeContainer::Element                   NodeType;
00110 
00114   typedef RescaleIntensityImageFilter< InputImageType, RealImageType > RescaleFilterType;
00115 
00116   typedef typename RescaleFilterType::Pointer RescaleFilterPointer;
00117 
00119   itkStaticConstMacro(PointDimension, unsigned int,
00120                       TOutputMesh::PointDimension);
00121 
00123   void GenerateData(void);
00124 
00126   void GenerateOutputInformation(void);
00127 
00129   using Superclass::SetInput;
00130   void SetInput(const InputImageType *inputImage);
00131 
00136   itkSetMacro(BandWidth, float);
00137   itkGetConstMacro(BandWidth, float);
00138 protected:
00139   BinaryMaskToNarrowBandPointSetFilter();
00140   ~BinaryMaskToNarrowBandPointSetFilter();
00141   void PrintSelf(std::ostream & os, Indent indent) const;
00143 
00144 private:
00145   //purposely not implemented purposely
00146   BinaryMaskToNarrowBandPointSetFilter(const BinaryMaskToNarrowBandPointSetFilter &);
00147   void operator=(const BinaryMaskToNarrowBandPointSetFilter &);
00148 
00149   DistanceFilterPointer m_DistanceFilter;
00150   RescaleFilterPointer  m_RescaleFilter;
00151 
00152   float m_BandWidth;
00153 };
00154 } // end namespace itk
00155 
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkBinaryMaskToNarrowBandPointSetFilter.hxx"
00158 #endif
00159 
00160 #endif
00161