Skip to content

Commit 99839c6

Browse files
committed
COMP: Place all QUICKVIEW code in ifdef
This example is only valid if QUICKVIEW is enabled with VTK support.
1 parent 1f94ee3 commit 99839c6

File tree

1 file changed

+20
-17
lines changed
  • src/Filtering/Thresholding/DemonstrateThresholdAlgorithms

1 file changed

+20
-17
lines changed

src/Filtering/Thresholding/DemonstrateThresholdAlgorithms/Code.cxx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@
1515
* limitations under the License.
1616
*
1717
*=========================================================================*/
18-
#include "itkLiThresholdImageFilter.h"
19-
#include "itkHuangThresholdImageFilter.h"
20-
#include "itkIntermodesThresholdImageFilter.h"
21-
#include "itkIsoDataThresholdImageFilter.h"
22-
#include "itkKittlerIllingworthThresholdImageFilter.h"
23-
#include "itkMaximumEntropyThresholdImageFilter.h"
24-
#include "itkMomentsThresholdImageFilter.h"
25-
#include "itkOtsuThresholdImageFilter.h"
26-
#include "itkRenyiEntropyThresholdImageFilter.h"
27-
#include "itkShanbhagThresholdImageFilter.h"
28-
#include "itkTriangleThresholdImageFilter.h"
29-
#include "itkYenThresholdImageFilter.h"
3018

31-
#include "itkImageFileReader.h"
32-
33-
#include "itksys/SystemTools.hxx"
3419
#include <sstream>
20+
#include <iostream>
3521
#include <map>
3622
#ifdef ENABLE_QUICKVIEW
23+
# include "itkLiThresholdImageFilter.h"
24+
# include "itkHuangThresholdImageFilter.h"
25+
# include "itkIntermodesThresholdImageFilter.h"
26+
# include "itkIsoDataThresholdImageFilter.h"
27+
# include "itkKittlerIllingworthThresholdImageFilter.h"
28+
# include "itkMaximumEntropyThresholdImageFilter.h"
29+
# include "itkMomentsThresholdImageFilter.h"
30+
# include "itkOtsuThresholdImageFilter.h"
31+
# include "itkRenyiEntropyThresholdImageFilter.h"
32+
# include "itkShanbhagThresholdImageFilter.h"
33+
# include "itkTriangleThresholdImageFilter.h"
34+
# include "itkYenThresholdImageFilter.h"
35+
36+
# include "itkImageFileReader.h"
37+
38+
# include "itksys/SystemTools.hxx"
3739
# include "QuickView.h"
3840
#endif
3941

@@ -47,7 +49,7 @@ main(int argc, char * argv[])
4749
std::cerr << std::endl;
4850
return EXIT_FAILURE;
4951
}
50-
52+
#ifdef ENABLE_QUICKVIEW
5153
using InputPixelType = short;
5254
using OutputPixelType = unsigned char;
5355

@@ -71,7 +73,6 @@ main(int argc, char * argv[])
7173

7274
const auto input = itk::ReadImage<InputImageType>(argv[1]);
7375

74-
#ifdef ENABLE_QUICKVIEW
7576
QuickView viewer;
7677
viewer.AddImage(input, true, itksys::SystemTools::GetFilenameName(argv[1]));
7778

@@ -107,6 +108,8 @@ main(int argc, char * argv[])
107108

108109

109110
viewer.Visualize();
111+
#else
112+
std::cout << " Example requires compilation with ENABLE_QUICKVIEW defined." << std::endl;
110113
#endif
111114
return EXIT_SUCCESS;
112115
}

0 commit comments

Comments
 (0)