Skip to content

Commit

Permalink
COMP: Place all QUICKVIEW code in ifdef
Browse files Browse the repository at this point in the history
This example is only valid if QUICKVIEW is enabled
with VTK support.
  • Loading branch information
hjmjohnson committed Sep 29, 2021
1 parent 3930982 commit ca095ee
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/Filtering/Thresholding/DemonstrateThresholdAlgorithms/Code.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@
* limitations under the License.
*
*=========================================================================*/
#include "itkLiThresholdImageFilter.h"
#include "itkHuangThresholdImageFilter.h"
#include "itkIntermodesThresholdImageFilter.h"
#include "itkIsoDataThresholdImageFilter.h"
#include "itkKittlerIllingworthThresholdImageFilter.h"
#include "itkMaximumEntropyThresholdImageFilter.h"
#include "itkMomentsThresholdImageFilter.h"
#include "itkOtsuThresholdImageFilter.h"
#include "itkRenyiEntropyThresholdImageFilter.h"
#include "itkShanbhagThresholdImageFilter.h"
#include "itkTriangleThresholdImageFilter.h"
#include "itkYenThresholdImageFilter.h"

#include "itkImageFileReader.h"

#include "itksys/SystemTools.hxx"
#include <sstream>
#include <iostream>
#include <map>
#ifdef ENABLE_QUICKVIEW
# include "itkLiThresholdImageFilter.h"
# include "itkHuangThresholdImageFilter.h"
# include "itkIntermodesThresholdImageFilter.h"
# include "itkIsoDataThresholdImageFilter.h"
# include "itkKittlerIllingworthThresholdImageFilter.h"
# include "itkMaximumEntropyThresholdImageFilter.h"
# include "itkMomentsThresholdImageFilter.h"
# include "itkOtsuThresholdImageFilter.h"
# include "itkRenyiEntropyThresholdImageFilter.h"
# include "itkShanbhagThresholdImageFilter.h"
# include "itkTriangleThresholdImageFilter.h"
# include "itkYenThresholdImageFilter.h"

# include "itkImageFileReader.h"

# include "itksys/SystemTools.hxx"
# include "QuickView.h"
#endif

Expand All @@ -47,7 +49,7 @@ main(int argc, char * argv[])
std::cerr << std::endl;
return EXIT_FAILURE;
}

#ifdef ENABLE_QUICKVIEW
using InputPixelType = short;
using OutputPixelType = unsigned char;

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

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

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

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


viewer.Visualize();
#else
std::cout << " Example requires compilation with ENABLE_QUICKVIEW defined." << std::endl;
#endif
return EXIT_SUCCESS;
}

1 comment on commit ca095ee

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.