ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCollidingFrontsImageFilter.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 __itkCollidingFrontsImageFilter_h
00019 #define __itkCollidingFrontsImageFilter_h
00020 
00021 #include "itkFastMarchingUpwindGradientImageFilter.h"
00022 #include "itkImageToImageFilter.h"
00023 
00024 namespace itk
00025 {
00060 template< typename TInputImage, typename TOutputImage >
00061 class ITK_EXPORT CollidingFrontsImageFilter:
00062   public ImageToImageFilter< TInputImage, TOutputImage >
00063 {
00064 public:
00066   typedef CollidingFrontsImageFilter                      Self;
00067   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00068   typedef SmartPointer< Self >                            Pointer;
00069   typedef SmartPointer< const Self >                      ConstPointer;
00070 
00072   itkNewMacro(Self);
00073 
00075   itkTypeMacro(CollidingFrontsImageFilter, ImageToImageFilter);
00076 
00079   typedef typename TOutputImage::PixelType                   OutputPixelType;
00080   typedef typename TInputImage::PixelType                    InputPixelType;
00081   typedef typename NumericTraits< InputPixelType >::RealType RealType;
00082 
00085   itkStaticConstMacro(ImageDimension, unsigned int,
00086                       TOutputImage::ImageDimension);
00087 
00089   typedef TInputImage                       InputImageType;
00090   typedef typename InputImageType::Pointer  InputImagePointer;
00091   typedef TOutputImage                      OutputImageType;
00092   typedef typename OutputImageType::Pointer OutputImagePointer;
00093 
00095   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00096 
00098   typedef itk::FastMarchingUpwindGradientImageFilter< TInputImage,
00099                                                       TOutputImage > FastMarchingUpwindGradientImageFilterType;
00100 
00102   typedef typename FastMarchingUpwindGradientImageFilterType::PixelType
00103   PixelType;
00104   typedef typename FastMarchingUpwindGradientImageFilterType::NodeType
00105   NodeType;
00106   typedef typename FastMarchingUpwindGradientImageFilterType::NodeContainer
00107   NodeContainer;
00108   typedef typename FastMarchingUpwindGradientImageFilterType::NodeContainerPointer
00109   NodeContainerPointer;
00110   typedef typename FastMarchingUpwindGradientImageFilterType::GradientImageType
00111   GradientImageType;
00112   typedef typename FastMarchingUpwindGradientImageFilterType::IndexType IndexType;
00113 
00116   void SetSeedPoints1(NodeContainer *points)
00117   {
00118     m_SeedPoints1 = points;
00119     this->Modified();
00120   }
00122 
00124   NodeContainerPointer GetSeedPoints1()
00125   { return m_SeedPoints1; }
00126 
00129   void SetSeedPoints2(NodeContainer *points)
00130   {
00131     m_SeedPoints2 = points;
00132     this->Modified();
00133   }
00135 
00137   NodeContainerPointer GetSeedPoints2()
00138   { return m_SeedPoints2; }
00139 
00140   itkSetMacro(NegativeEpsilon, double);
00141   itkGetConstMacro(NegativeEpsilon, double);
00142 
00143   itkSetMacro(ApplyConnectivity, bool);
00144   itkGetConstMacro(ApplyConnectivity, bool);
00145   itkBooleanMacro(ApplyConnectivity);
00146 
00147   itkSetMacro(StopOnTargets, bool);
00148   itkGetConstMacro(StopOnTargets, bool);
00149   itkBooleanMacro(StopOnTargets);
00150 
00151 #ifdef ITK_USE_CONCEPT_CHECKING
00152 
00153   itkConceptMacro( InputHasNumericTraitsCheck,
00154                    ( Concept::HasNumericTraits< InputPixelType > ) );
00155 
00157 #endif
00158 protected:
00159   CollidingFrontsImageFilter();
00160   virtual ~CollidingFrontsImageFilter() {}
00161 
00162   void GenerateData();
00163 
00164   void PrintSelf(std::ostream &, Indent) const;
00165 private:
00166   CollidingFrontsImageFilter(const Self &); //purposely not implemented
00167   void operator=(const Self &);             //purposely not implemented
00168 
00169   NodeContainerPointer m_SeedPoints1;
00170   NodeContainerPointer m_SeedPoints2;
00171 
00172   bool m_StopOnTargets;
00173   bool m_ApplyConnectivity;
00174 
00175   double m_NegativeEpsilon;
00176 };
00177 } // end namespace itk
00178 
00179 #ifndef ITK_MANUAL_INSTANTIATION
00180 #include "itkCollidingFrontsImageFilter.hxx"
00181 #endif
00182 
00183 #endif
00184