ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkIsoContourDistanceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkIsoContourDistanceImageFilter_h
19 #define __itkIsoContourDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNarrowBand.h"
24 #include "itkBarrier.h"
25 
26 namespace itk
27 {
56 template< class TInputImage, class TOutputImage >
58  public ImageToImageFilter< TInputImage, TOutputImage >
59 {
60 public:
66 
68  itkNewMacro(Self);
69 
72 
75  typedef typename Superclass::OutputImageType OutputImageType;
76 
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TInputImage::ImageDimension);
81  itkStaticConstMacro(OutputImageDimension, unsigned int,
82  TOutputImage::ImageDimension);
84 
87  typedef typename OutputImageType::PixelType PixelType;
88  typedef typename InputImageType::PixelType InputPixelType;
89  typedef typename OutputImageType::RegionType OutputImageRegionType;
90 
91  typedef typename InputImageType::SizeType InputSizeType;
92  typedef typename OutputImageType::SizeType SizeType;
93 
94  typedef typename InputImageType::IndexType InputIndexType;
95  typedef typename OutputImageType::IndexType IndexType;
96 
97  typedef typename InputImageType::SpacingType InputSpacingType;
98 
106 
109  itkSetMacro(LevelSetValue, InputPixelType);
110  itkGetConstMacro(LevelSetValue, InputPixelType);
112 
115  itkSetMacro(FarValue, PixelType);
116  itkGetConstMacro(FarValue, PixelType);
118 
121  itkSetMacro(NarrowBanding, bool);
122  itkGetConstMacro(NarrowBanding, bool);
123  itkBooleanMacro(NarrowBanding);
125 
127  void SetNarrowBand(NarrowBandType *ptr);
128 
129  NarrowBandPointer GetNarrowBand() const
130  { return m_NarrowBand; }
131 
132 #ifdef ITK_USE_CONCEPT_CHECKING
133 
134  itkConceptMacro( InputEqualityComparableCheck,
136  itkConceptMacro( OutputEqualityComparableCheck,
138  itkConceptMacro( SameDimensionCheck,
140  itkConceptMacro( DoubleConvertibleToOutputCheck,
142  itkConceptMacro( InputConvertibleToOutputCheck,
144  itkConceptMacro( OutputAdditiveOperatorsCheck,
146  itkConceptMacro( InputOStreamWritableCheck,
148  itkConceptMacro( OutputOStreamWritableCheck,
150 
152 #endif
153 
154 protected:
157  void PrintSelf(std::ostream & os, Indent indent) const;
158 
159  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
160  ThreadIdType threadId);
161 
162  void ThreadedGenerateDataFull(const OutputImageRegionType & outputRegionForThread,
163  ThreadIdType threadId);
164 
165  void ThreadedGenerateDataBand(const OutputImageRegionType & outputRegionForThread,
166  ThreadIdType threadId);
167 
168  void BeforeThreadedGenerateData();
169 
170  virtual void GenerateInputRequestedRegion();
171 
172  virtual void EnlargeOutputRequestedRegion(DataObject *);
173 
176 
177  void ComputeValue( const InputNeighbordIteratorType& inNeigIt,
179  unsigned int center,
180  const std::vector< OffsetValueType >& stride );
181 
182 private:
183  IsoContourDistanceImageFilter(const Self &); //purposely not implemented
184  void operator=(const Self &); //purposely not implemented
185 
188 
190 
193  std::vector< RegionType > m_NarrowBandRegion;
194 
197 };
198 } // namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 #include "itkIsoContourDistanceImageFilter.hxx"
202 #endif
203 
204 #endif
205