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

« back to all changes in this revision

Viewing changes to Code/Algorithms/itkRGBGibbsPriorFilter.txx

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-05-31 12:07:29 UTC
  • mfrom: (3.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080531120729-7g7layn480le43ko
Tags: 3.6.0-3
* debian/patches/gccxml-workaround.patch: New.  Work around gccxml issue
  with #include_next; c.f. http://www.gccxml.org/Bug/view.php?id=7134.  
* debian/patches/gcc43.patch: include <cstring> in itkNeighbourhood.h.
  This only showed up in the tcl wrapping step.

* Above two entries fix FTBFS for GCC 4.3-based systems.
  Closes: #478500.

* debian/patches/sharedforward.patch: New.  Ensure that linux/sparc
  systems are not also configured as a SUN sparc system, which requires
  SUN header sys/isa_defs.h.  Closes: #478940, #483312.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   Insight Segmentation & Registration Toolkit
4
4
  Module:    $RCSfile: itkRGBGibbsPriorFilter.txx,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2005/08/10 18:13:43 $
7
 
  Version:   $Revision: 1.46 $
 
6
  Date:      $Date: 2008-01-27 18:29:24 $
 
7
  Version:   $Revision: 1.47 $
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.
308
308
 
309
309
  bool changeflag = (k > 3);
310
310
 
311
 
  for(unsigned int j = 0; j < 2; j++) 
 
311
  for(unsigned int jj = 0; jj < 2; jj++) 
312
312
    {
313
 
    energy[j] = 0;
314
 
    energy[j] += GibbsEnergy(i,           0, j);
315
 
    energy[j] += GibbsEnergy(i+rowsize+1, 1, j);
316
 
    energy[j] += GibbsEnergy(i+rowsize,   2, j);
317
 
    energy[j] += GibbsEnergy(i+rowsize-1, 3, j);
318
 
    energy[j] += GibbsEnergy(i-1,         4, j);
319
 
    energy[j] += GibbsEnergy(i-rowsize-1, 5, j);
320
 
    energy[j] += GibbsEnergy(i-rowsize,   6, j);
321
 
    energy[j] += GibbsEnergy(i-rowsize+1, 7, j);
322
 
    energy[j] += GibbsEnergy(i+1,         8, j);
323
 
    if ( m_LabelStatus[i] == j ) 
 
313
    energy[jj] = 0;
 
314
    energy[jj] += GibbsEnergy(i,           0, jj);
 
315
    energy[jj] += GibbsEnergy(i+rowsize+1, 1, jj);
 
316
    energy[jj] += GibbsEnergy(i+rowsize,   2, jj);
 
317
    energy[jj] += GibbsEnergy(i+rowsize-1, 3, jj);
 
318
    energy[jj] += GibbsEnergy(i-1,         4, jj);
 
319
    energy[jj] += GibbsEnergy(i-rowsize-1, 5, jj);
 
320
    energy[jj] += GibbsEnergy(i-rowsize,   6, jj);
 
321
    energy[jj] += GibbsEnergy(i-rowsize+1, 7, jj);
 
322
    energy[jj] += GibbsEnergy(i+1,         8, jj);
 
323
    if ( m_LabelStatus[i] == jj ) 
324
324
      {
325
 
      energy[j] += -3;
 
325
      energy[jj] += -3;
326
326
      }
327
327
    else 
328
328
      {
329
 
      energy[j] += 3;  
 
329
      energy[jj] += 3;  
330
330
      }
331
331
    }
332
332
 
642
642
      ChangedPixelVec = inputImageIt.Get();
643
643
      }
644
644
 
645
 
    const std::vector<double> & dist =
 
645
    const std::vector<double> & distValue =
646
646
      m_ClassifierPtr->GetPixelMembershipValue( ChangedPixelVec );
647
647
 
648
648
    LabelType pixLabel;
649
 
    if (dist[1] > m_ObjectThreshold) pixLabel = 0;
 
649
    if (distValue[1] > m_ObjectThreshold) pixLabel = 0;
650
650
    else pixLabel = 1;
651
651
    labelledImageIt.Set( pixLabel );
652
652