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

« back to all changes in this revision

Viewing changes to Code/BasicFilters/itkVectorCurvatureNDAnisotropicDiffusionFunction.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: itkVectorCurvatureNDAnisotropicDiffusionFunction.txx,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2004-07-07 14:57:04 $
7
 
  Version:   $Revision: 1.13 $
 
6
  Date:      $Date: 2008-10-17 16:30:54 $
 
7
  Version:   $Revision: 1.14 $
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.
14
14
     PURPOSE.  See the above copyright notices for more information.
15
15
 
16
16
=========================================================================*/
17
 
#ifndef __itkVectorCurvatureNDAnisotropicDiffusionFunction_txx_
18
 
#define __itkVectorCurvatureNDAnisotropicDiffusionFunction_txx_
 
17
#ifndef __itkVectorCurvatureNDAnisotropicDiffusionFunction_txx
 
18
#define __itkVectorCurvatureNDAnisotropicDiffusionFunction_txx
19
19
 
20
20
namespace itk {
21
21
 
116
116
    for (i = 0; i < ImageDimension; i++)
117
117
      {
118
118
      // Gradient magnitude approximations
119
 
      grad_mag_sq[k]   += dx_forward[i][k]  * dx_forward[i][k];
 
119
      grad_mag_sq[k] += dx_forward[i][k]  * dx_forward[i][k];
120
120
      grad_mag_sq_d[k] += dx_backward[i][k] * dx_backward[i][k];
121
121
      for (j = 0; j < ImageDimension; j++)
122
122
        {
123
123
        if (j != i)
124
124
          {
125
 
          dx_aug     = m_InnerProduct(xa_slice[j][i],it, dx_op);
126
 
          dx_dim     = m_InnerProduct(xd_slice[j][i],it, dx_op);
127
 
          grad_mag_sq[k]   += 0.25f * (dx[j][k]+dx_aug[k]) * (dx[j][k]+dx_aug[k]);
 
125
          dx_aug = m_InnerProduct(xa_slice[j][i],it, dx_op);
 
126
          dx_dim = m_InnerProduct(xd_slice[j][i],it, dx_op);
 
127
          grad_mag_sq[k] += 0.25f * (dx[j][k]+dx_aug[k]) * (dx[j][k]+dx_aug[k]);
128
128
          grad_mag_sq_d[k] += 0.25f * (dx[j][k]+dx_dim[k]) * (dx[j][k]+dx_dim[k]);
129
129
          }
130
130
        }
172
172
    speed = 0.0;
173
173
    for (i = 0; i < ImageDimension; i++)
174
174
      {
175
 
      dx_forward_Cn[i][k]  *= Cx[i];
 
175
      dx_forward_Cn[i][k] *= Cx[i];
176
176
      dx_backward_Cn[i][k] *= Cxd[i];
177
177
      
178
178
      // Second order conductance-modified curvature
204
204
    ans[k] = ::sqrt(propagation_gradient) * speed;
205
205
    }
206
206
  
207
 
  return ans;    
 
207
  return ans;
208
208
}
209
209
 
210
210
} // end namespace itk