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

« back to all changes in this revision

Viewing changes to Testing/Code/Algorithms/itkRegionGrow2DTest.cxx

  • 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: itkRegionGrow2DTest.cxx,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2007-06-02 18:18:29 $
7
 
  Version:   $Revision: 1.39 $
 
6
  Date:      $Date: 2008-06-10 13:02:48 $
 
7
  Version:   $Revision: 1.41 $
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.
341
341
         pixelLabel  != m )
342
342
      {
343
343
      std::cout << "Test FAILED" << std::endl;
 
344
      if ( pixelOut[0] != pixelIn[0])
 
345
        {
 
346
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
347
                  << " != "
 
348
                  << "pixelIn[0]: " << pixelIn[0]
 
349
                  << std::endl;
 
350
        }
 
351
      if ( pixelOut[1] != pixelIn[1])
 
352
        {
 
353
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
354
                  << " != "
 
355
                  << "pixelIn[1]: " << pixelIn[1]
 
356
                  << std::endl;
 
357
        }
 
358
      if ( pixelOut[2] != pixelIn[2])
 
359
        {
 
360
        std::cout << "pixelOut[2]: " << pixelOut[2]
 
361
                  << " != "
 
362
                  << "pixelIn[2]: " << pixelIn[2]
 
363
                  << std::endl;
 
364
        }
 
365
      if ( pixelLabel  != m )
 
366
        {
 
367
        std::cout << "pixelLabel: " << pixelLabel
 
368
                  << " != "
 
369
                  << "m: " << m
 
370
                  << std::endl;
 
371
        }
344
372
      return EXIT_FAILURE;
345
373
      }
346
374
 
418
446
      if ( pixelOut != pixelOut2a || pixelLabel != ma )
419
447
        {
420
448
        std::cout << "Test FAILED" << std::endl;
 
449
        if ( pixelLabel != ma)
 
450
          {
 
451
          std::cout << "pixelLabel: " << pixelLabel
 
452
                    << " != "
 
453
                    << "ma: " << ma
 
454
                    << std::endl;
 
455
          }
 
456
        if ( pixelOut != pixelOut2a)
 
457
          {
 
458
          std::cout << "pixelOut: " << pixelOut
 
459
                    << " != "
 
460
                    << "pixelOut2a: " << pixelOut2a
 
461
                    << std::endl;
 
462
          }
421
463
        return EXIT_FAILURE;
422
464
        }
423
465
      }
426
468
      if ( pixelOut != pixelOut2b || pixelLabel != mb )
427
469
        {
428
470
        std::cout << "Test FAILED" << std::endl;
 
471
        if ( pixelLabel != ma)
 
472
          {
 
473
          std::cout << "pixelLabel: " << pixelLabel
 
474
                    << " != "
 
475
                    << "mb: " << mb
 
476
                    << std::endl;
 
477
          }
 
478
        if ( pixelOut != pixelOut2b)
 
479
          {
 
480
          std::cout << "pixelOut: " << pixelOut
 
481
                    << " != "
 
482
                    << "pixelOut2b: " << pixelOut2b
 
483
                    << std::endl;
 
484
          }
429
485
        return EXIT_FAILURE;
430
486
        }
431
487
      }
532
588
      if ( pixelOut != pixelOut3a || pixelLabel != ma )
533
589
        {
534
590
        std::cout << "Test FAILED" << std::endl;
 
591
        if ( pixelLabel != ma)
 
592
          {
 
593
          std::cout << "pixelLabel: " << pixelLabel
 
594
                    << " != "
 
595
                    << "ma: " << ma
 
596
                    << std::endl;
 
597
          }
 
598
        if ( pixelOut != pixelOut3a)
 
599
          {
 
600
          std::cout << "pixelOut: " << pixelOut
 
601
                    << " != "
 
602
                    << "pixelOut3a: " << pixelOut3a
 
603
                    << std::endl;
 
604
          }
535
605
        return EXIT_FAILURE;
536
606
        }
537
607
      }
540
610
      if ( pixelOut != pixelOut3b || pixelLabel != mb )
541
611
        {
542
612
        std::cout << "Test FAILED" << std::endl;
 
613
        if ( pixelLabel != mb)
 
614
          {
 
615
          std::cout << "pixelLabel: " << pixelLabel
 
616
                    << " != "
 
617
                    << "mb: " << mb
 
618
                    << std::endl;
 
619
          }
 
620
        if ( pixelOut != pixelOut3b)
 
621
          {
 
622
          std::cout << "pixelOut: " << pixelOut
 
623
                    << " != "
 
624
                    << "pixelOut3b: " << pixelOut3b
 
625
                    << std::endl;
 
626
          }
543
627
        return EXIT_FAILURE;
544
628
        }
545
629
      }
548
632
      if ( pixelOut != pixelOut3c || pixelLabel != mc )
549
633
        {
550
634
        std::cout << "Test FAILED" << std::endl;
 
635
        if ( pixelLabel != ma)
 
636
          {
 
637
          std::cout << "pixelLabel: " << pixelLabel
 
638
                    << " != "
 
639
                    << "mc: " << mc
 
640
                    << std::endl;
 
641
          }
 
642
        if ( pixelOut != pixelOut3c)
 
643
          {
 
644
          std::cout << "pixelOut: " << pixelOut
 
645
                    << " != "
 
646
                    << "pixelOut3c: " << pixelOut3c
 
647
                    << std::endl;
 
648
          }
551
649
        return EXIT_FAILURE;
552
650
        }
553
651
      }
556
654
      if ( pixelOut != pixelOut3d || pixelLabel != md )
557
655
        {
558
656
        std::cout << "Test FAILED" << std::endl;
 
657
        if ( pixelLabel != md)
 
658
          {
 
659
          std::cout << "pixelLabel: " << pixelLabel
 
660
                    << " != "
 
661
                    << "md: " << md
 
662
                    << std::endl;
 
663
          }
 
664
        if ( pixelOut != pixelOut3d)
 
665
          {
 
666
          std::cout << "pixelOut: " << pixelOut
 
667
                    << " != "
 
668
                    << "pixelOut3d: " << pixelOut3d
 
669
                    << std::endl;
 
670
          }
559
671
        return EXIT_FAILURE;
560
672
        }
561
673
      }
664
776
      if ( pixelLabel != k )
665
777
        {
666
778
        std::cout << "Test FAILED" << std::endl;
 
779
        std::cout << "pixelLabel: " << pixelLabel
 
780
                  << " != "
 
781
                  << "k : " << k
 
782
                  << std::endl;
667
783
        return EXIT_FAILURE;
668
784
        }
669
785
      ++labelIt5;
676
792
    for ( int idx = 0; idx < gridWidth; idx++ )
677
793
      {
678
794
      pixelOut5out = outIt5.Get();
 
795
      std::cout << "idx: " << idx << " pixelOut5out: " << pixelOut5out << std::endl;
679
796
      if ( pixelOut5in != pixelOut5out )
680
797
        {
681
798
        std::cout << "Test FAILED" << std::endl;
 
799
        std::cout << "pixelOut5in: " << pixelOut5in
 
800
                  << " != "
 
801
                  << "pixelOut5out: " << pixelOut5out
 
802
                  << std::endl;
682
803
        return EXIT_FAILURE;
683
804
        }
684
805
      ++outIt5;
893
1014
    if ( pixelOut[0] != pixelIn[0] || pixelOut[1] != pixelIn[1] )
894
1015
      {
895
1016
      std::cout << "Test FAILED" << std::endl;
 
1017
      if ( pixelOut[0] != pixelIn[0] )
 
1018
        {
 
1019
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1020
                  << " != "
 
1021
                  << "pixelIn[0]: " << pixelIn[0]
 
1022
                  << std::endl;
 
1023
        }
 
1024
      if ( pixelOut[1] != pixelIn[1] )
 
1025
        {
 
1026
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1027
                  << " != "
 
1028
                  << "pixelIn[1]: " << pixelIn[1]
 
1029
                  << std::endl;
 
1030
        }
896
1031
      return EXIT_FAILURE;
897
1032
      }
898
1033
 
931
1066
    if(pixelLabel != m)
932
1067
      {
933
1068
      std::cout << "Test FAILED" << std::endl;
 
1069
      std::cout << "pixelLabel: " << pixelLabel
 
1070
                << " != "
 
1071
                << "m: " << m
 
1072
                << std::endl;
934
1073
      return EXIT_FAILURE;
935
1074
      }
936
1075
 
990
1129
         pixelOut[1] != 100 - pixelOut[0] )
991
1130
      {
992
1131
      std::cout << "Test FAILED" << std::endl;
 
1132
      if ( pixelOut[0] != outImageVals[k] )
 
1133
        {
 
1134
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1135
                  << " != "
 
1136
                  << "outImageVals[k]: " << outImageVals[k]
 
1137
                  << std::endl;
 
1138
        }
 
1139
      if ( pixelOut[1] != (100 - pixelOut[0]) )
 
1140
        {
 
1141
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1142
                  << " != "
 
1143
                  << "100 - pixelOut[0]: " << 100 - pixelOut[0]
 
1144
                  << std::endl;
 
1145
        }
 
1146
 
993
1147
      return EXIT_FAILURE;
994
1148
      }
995
1149
 
1014
1168
    if(pixelLabel != labelVals[k])
1015
1169
      {
1016
1170
      std::cout << "Test FAILED" << std::endl;
 
1171
      std::cout << "pixelLabel: " << pixelLabel
 
1172
                << " != "
 
1173
                << "labelVals[k]: " << labelVals[k]
 
1174
                << std::endl;
1017
1175
      return EXIT_FAILURE;
1018
1176
      }
1019
1177
 
1084
1242
    if ( pixelOut[0] != 0 || pixelOut[1] != 0 )
1085
1243
      {
1086
1244
      std::cout << "Test FAILED" << std::endl;
 
1245
      if ( pixelOut[0] != 0 )
 
1246
        {
 
1247
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1248
                  << " != "
 
1249
                  << "0"
 
1250
                  << std::endl;
 
1251
        }
 
1252
      if ( pixelOut[1] != 0 )
 
1253
        {
 
1254
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1255
                  << " != "
 
1256
                  << "0"
 
1257
                  << std::endl;
 
1258
        }
1087
1259
      return EXIT_FAILURE;
1088
1260
      }
1089
1261
 
1485
1657
    if ( pixelOut[0] != pixelIn[0] || pixelOut[1] != pixelIn[1] )
1486
1658
      {
1487
1659
      std::cout << "Test FAILED" << std::endl;
 
1660
      if ( pixelOut[0] != pixelIn[0] )
 
1661
        {
 
1662
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1663
                  << " != "
 
1664
                  << "pixelIn[0]: " << pixelIn[0]
 
1665
                  << std::endl;
 
1666
        }
 
1667
      if ( pixelOut[1] != 0 )
 
1668
        {
 
1669
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1670
                  << " != "
 
1671
                  << "pixelIn[1]: " << pixelIn[1]
 
1672
                  << std::endl;
 
1673
        }
1488
1674
      return EXIT_FAILURE;
1489
1675
      }
1490
1676
 
1523
1709
    if(pixelLabel != m)
1524
1710
      {
1525
1711
      std::cout << "Test FAILED" << std::endl;
 
1712
      std::cout << "pixelLabel: " << pixelLabel
 
1713
                  << " != "
 
1714
                  << "m: " << m
 
1715
                  << std::endl;
1526
1716
      return EXIT_FAILURE;
1527
1717
      }
1528
1718
 
1582
1772
         pixelOut[1] != 100 - pixelOut[0] )
1583
1773
      {
1584
1774
      std::cout << "Test FAILED" << std::endl;
 
1775
      if ( pixelOut[0] != outImageVals[k] )
 
1776
        {
 
1777
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1778
                  << " != "
 
1779
                  << "outImageVals[k]: " << outImageVals[k]
 
1780
                  << std::endl;
 
1781
        }
 
1782
      if ( pixelOut[1] != (100 - pixelOut[0]) )
 
1783
        {
 
1784
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1785
                  << " != "
 
1786
                  << "100 - pixelOut[0]: " << 100 - pixelOut[0]
 
1787
                  << std::endl;
 
1788
        }
1585
1789
      return EXIT_FAILURE;
1586
1790
      }
1587
1791
 
1606
1810
    if(pixelLabel != labelVals[k])
1607
1811
      {
1608
1812
      std::cout << "Test FAILED" << std::endl;
 
1813
      std::cout << "pixelLabel: " << pixelLabel
 
1814
                << " != "
 
1815
                << "labelVals[k]: " << labelVals[k]
 
1816
                << std::endl;
1609
1817
      return EXIT_FAILURE;
1610
1818
      }
1611
1819
 
1675
1883
    if ( pixelOut[0] != 0 || pixelOut[1] != 0 )
1676
1884
      {
1677
1885
      std::cout << "Test FAILED" << std::endl;
 
1886
      if ( pixelOut[0] != 0 )
 
1887
        {
 
1888
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
1889
                  << " != "
 
1890
                  << "0"
 
1891
                  << std::endl;
 
1892
        }
 
1893
      if ( pixelOut[1] != 0 )
 
1894
        {
 
1895
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
1896
                  << " != "
 
1897
                  << "0"
 
1898
                  << std::endl;
 
1899
        }
1678
1900
      return EXIT_FAILURE;
1679
1901
      }
1680
1902
 
1873
2095
    if ( pixelOut[0] != pixelIn[0] )
1874
2096
      {
1875
2097
      std::cout << "Test FAILED" << std::endl;
 
2098
      if ( pixelOut[0] != pixelIn[0] )
 
2099
        {
 
2100
        std::cout << "pixelOut[0]: " << pixelOut[0]
 
2101
                  << " != "
 
2102
                  << "pixelIn[0]: " << pixelIn[0]
 
2103
                  << std::endl;
 
2104
        }
 
2105
      if ( pixelOut[1] != 0 )
 
2106
        {
 
2107
        std::cout << "pixelOut[1]: " << pixelOut[1]
 
2108
                  << " != "
 
2109
                  << "0"
 
2110
                  << std::endl;
 
2111
        }
1876
2112
      return EXIT_FAILURE;
1877
2113
      }
1878
2114
 
1910
2146
 
1911
2147
    if(pixelLabel != m)
1912
2148
      {
1913
 
      std::cout << "pixelLabel " << pixelLabel << " m " << m << std::endl;
1914
 
 
1915
2149
      std::cout << "Test FAILED" << std::endl;
 
2150
      std::cout << "pixelLabel: " << pixelLabel
 
2151
                  << " != "
 
2152
                  << "m: " << m
 
2153
                  << std::endl;
1916
2154
      return EXIT_FAILURE;
1917
2155
      }
1918
2156
 
1970
2208
    if ( pixelOut[0] != pixelIn[0] )
1971
2209
      {
1972
2210
      std::cout << "Test FAILED" << std::endl;
 
2211
      std::cout << "pixelOut[0]: " << pixelOut[0]
 
2212
                << " != "
 
2213
                << "pixelIn[0]: " << pixelIn[0]
 
2214
                << std::endl;
1973
2215
      return EXIT_FAILURE;
1974
2216
      }
1975
2217
 
1995
2237
 
1996
2238
    if(pixelLabel != static_cast<LabelType>(pixelIn[0]))
1997
2239
      {
 
2240
      std::cout << "Test FAILED" << std::endl;
1998
2241
      std::cout << "k = " << k
1999
2242
                << " pixelLabel = " << pixelLabel
2000
2243
                << " pixelIn[0] = " << pixelIn[0] << std::endl;
2001
2244
 
2002
 
      std::cout << "Test FAILED" << std::endl;
2003
2245
      return EXIT_FAILURE;
2004
2246
      }
2005
2247
 
2071
2313
    if ( pixelOut[0] != 0 )
2072
2314
      {
2073
2315
      std::cout << "Test FAILED" << std::endl;
 
2316
      std::cout << "pixelOut[0]: " << pixelOut[0]
 
2317
                << " != "
 
2318
                << "0"
 
2319
                << std::endl;
2074
2320
      return EXIT_FAILURE;
2075
2321
      }
2076
2322