Orfeo Toolbox  4.0
itkSparseFieldLevelSetImageFilter.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 __itkSparseFieldLevelSetImageFilter_h
19 #define __itkSparseFieldLevelSetImageFilter_h
20 
22 #include "itkMultiThreader.h"
23 #include "itkSparseFieldLayer.h"
24 #include "itkObjectStore.h"
25 #include <vector>
27 
28 namespace itk
29 {
35 template< typename TValueType >
37 {
38 public:
39  TValueType m_Value;
42 };
43 
72 template< typename TNeighborhoodType >
74 {
75 public:
76  typedef TNeighborhoodType NeighborhoodType;
79  itkStaticConstMacro(Dimension, unsigned int,
80  NeighborhoodType::Dimension);
81 
82  const RadiusType & GetRadius() const
83  { return m_Radius; }
84 
85  const unsigned int & GetArrayIndex(unsigned int i) const
86  { return m_ArrayIndex[i]; }
87 
88  const OffsetType & GetNeighborhoodOffset(unsigned int i) const
89  { return m_NeighborhoodOffset[i]; }
90 
91  const unsigned int & GetSize() const
92  { return m_Size; }
93 
94  int GetStride(unsigned int i)
95  { return m_StrideTable[i]; }
96 
99 
100  void Print(std::ostream & os) const;
101 
102 private:
103  unsigned int m_Size;
105  std::vector< unsigned int > m_ArrayIndex;
106  std::vector< OffsetType > m_NeighborhoodOffset;
107 
111 };
112 
228 template< typename TInputImage, typename TOutputImage >
230  public FiniteDifferenceImageFilter< TInputImage, TOutputImage >
231 {
232 public:
238 
243 
245  itkNewMacro(Self);
246 
249 
251  typedef TInputImage InputImageType;
252  typedef TOutputImage OutputImageType;
254  itkStaticConstMacro(ImageDimension, unsigned int,
255  TOutputImage::ImageDimension);
256 
260 
263 
267 
269  typedef std::vector< LayerPointerType > LayerListType;
270 
272  typedef signed char StatusType;
273 
278 
282 
284  typedef std::vector< ValueType > UpdateBufferType;
285 
289  itkSetMacro(NumberOfLayers, unsigned int);
290  itkGetConstMacro(NumberOfLayers, unsigned int);
291 
293  itkSetMacro(IsoSurfaceValue, ValueType);
294  itkGetConstMacro(IsoSurfaceValue, ValueType);
295 
299  // itkGetConstMacro(RMSChange, ValueType);
300 
306  itkSetMacro(InterpolateSurfaceLocation, bool);
307  itkGetConstMacro(InterpolateSurfaceLocation, bool);
308 
311  { this->SetInterpolateSurfaceLocation(true); }
313  { this->SetInterpolateSurfaceLocation(false); }
314 
315 #ifdef ITK_USE_CONCEPT_CHECKING
316  // Begin concept checking
317  itkConceptMacro( OutputEqualityComparableCheck,
319  itkConceptMacro( DoubleConvertibleToOutputCheck,
321  itkConceptMacro( OutputOStreamWritableCheck,
323  // End concept checking
324 #endif
325 
326 protected:
329  virtual void PrintSelf(std::ostream & os, Indent indent) const;
330 
336  const IndexType & itkNotUsed(idx),
337  const TimeStepType & dt,
338  const ValueType & value,
339  const ValueType & change)
340  { return ( value + dt * change ); }
341 
345  virtual void PostProcessOutput();
346 
351  virtual void InitializeBackgroundPixels();
352 
354  void Initialize();
355 
360  void CopyInputToOutput();
361 
363  void AllocateUpdateBuffer();
364 
367  void ApplyUpdate(const TimeStepType& dt);
368 
372 
376  void ConstructLayer(StatusType from, StatusType to);
377 
382  void ConstructActiveLayer();
383 
386 
395  StatusType promote, int InOrOut);
396 
402 
406  void UpdateActiveLayerValues(TimeStepType dt, LayerType *StatusUpList,
407  LayerType *StatusDownList);
408 
410  void ProcessStatusList(LayerType *InputList, LayerType *OutputList,
411  StatusType ChangeToStatus, StatusType SearchForStatus);
412 
414  void ProcessOutsideList(LayerType *OutsideList, StatusType ChangeToStatus);
415 
416  itkGetConstMacro(ValueZero, ValueType);
417  itkGetConstMacro(ValueOne, ValueType);
418 
422 
426 
429 
432 
436 
440 
444 
448 
452 
457 
463 
468  unsigned int m_NumberOfLayers;
469 
472 
475 
478 
482 
486  // ValueType m_RMSChange;
487 
493 
496 
497 private:
498  SparseFieldLevelSetImageFilter(const Self &); //purposely not implemented
499  void operator=(const Self &); //purposely not implemented
500 
504 };
505 } // end namespace itk
506 
507 #ifndef ITK_MANUAL_INSTANTIATION
509 #endif
510 
511 #endif

Generated at Sat Mar 8 2014 15:34:10 for Orfeo Toolbox with doxygen 1.8.3.1