~ubuntu-branches/ubuntu/precise/insighttoolkit/precise

« back to all changes in this revision

Viewing changes to Code/BasicFilters/itkBinaryMorphologyImageFilter.txx

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-12-19 20:16:49 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081219201649-drt97guwl2ryt0cn

* New upstream version.
  - patches/nifti-versioning.patch: Remove.  Applied upstream.
  - control:
  - rules: Update version numbers, package names.

* control: Build-depend on uuid-dev (gdcm uses it).

* copyright: Update download URL.

* rules: Adhere to parallel=N in DEB_BUILD_OPTIONS by setting MAKEFLAGS.

* compat: Set to 7.
* control: Update build-dep on debhelper to version >= 7.

* CMakeCache.txt.debian: Set CMAKE_BUILD_TYPE to "RELEASE" so that we
  build with -O3 (not -O2), necessary to optimize the templated code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   Insight Segmentation & Registration Toolkit
4
4
  Module:    $RCSfile: itkBinaryMorphologyImageFilter.txx,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2007-04-24 10:06:57 $
7
 
  Version:   $Revision: 1.9 $
 
6
  Date:      $Date: 2008-10-09 15:31:36 $
 
7
  Version:   $Revision: 1.13 $
8
8
 
9
9
  Copyright (c) Insight Software Consortium. All rights reserved.
10
10
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
17
17
#ifndef __itkBinaryMorphologyImageFilter_txx
18
18
#define __itkBinaryMorphologyImageFilter_txx
19
19
 
 
20
 
 
21
// First make sure that the configuration is available.
 
22
// This line can be removed once the optimized versions
 
23
// gets integrated into the main directories.
 
24
#include "itkConfigure.h"
 
25
 
 
26
#ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
 
27
#include "itkOptBinaryMorphologyImageFilter.h"
 
28
#else
 
29
 
20
30
#include "itkConstNeighborhoodIterator.h"
21
31
#include "itkNeighborhoodIterator.h"
22
32
#include "itkImageRegionIteratorWithIndex.h"
40
50
  m_Radius.Fill(1);
41
51
  m_ForegroundValue = NumericTraits<InputPixelType>::max();
42
52
  m_BackgroundValue = NumericTraits<OutputPixelType>::NonpositiveMin();
43
 
  this->SetNumberOfThreads(1);
 
53
  //this->SetNumberOfThreads(1);
44
54
}
45
55
 
46
56
template <class TInputImage, class TOutputImage, class TKernel>
151
161
                
152
162
  for ( i=0, kernel_it=KernelBegin; kernel_it != KernelEnd; ++kernel_it, ++i)
153
163
    {
154
 
    if ((*kernel_it) > 0)
 
164
    if (*kernel_it)
155
165
      {
156
166
      kernelOnElements.push_back(i);
157
167
      }
192
202
 
193
203
  while( !kernelImageIt.IsAtEnd() )
194
204
    {
195
 
    kernelImageIt.Set( *kernel_it > 0 );
 
205
    kernelImageIt.Set( *kernel_it ? true : false);
196
206
    ++kernelImageIt;
197
207
    ++kernel_it;
198
208
    }
385
395
  unsigned int centerKernelIndex  = adjNeigh.Size() / 2;
386
396
  for ( k=0, kernel_it=KernelBegin; kernel_it != KernelEnd; ++kernel_it, ++k)
387
397
    {
388
 
    if ((*kernel_it) > 0)
 
398
    if (*kernel_it)
389
399
      {
390
400
      OffsetType currentOffset = m_Kernel.GetOffset(k);
391
401
      m_KernelDifferenceSets[centerKernelIndex].push_back(currentOffset);
413
423
} // end namespace itk
414
424
 
415
425
#endif
 
426
 
 
427
#endif