| 1 |
/*========================================================================= |
| 2 |
* |
| 3 |
* Copyright NumFOCUS |
| 4 |
* |
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
* you may not use this file except in compliance with the License. |
| 7 |
* You may obtain a copy of the License at |
| 8 |
* |
| 9 |
* https://www.apache.org/licenses/LICENSE-2.0.txt |
| 10 |
* |
| 11 |
* Unless required by applicable law or agreed to in writing, software |
| 12 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
* See the License for the specific language governing permissions and |
| 15 |
* limitations under the License. |
| 16 |
* |
| 17 |
*=========================================================================*/ |
| 18 |
#ifndef itkViewImage_h |
| 19 |
#define itkViewImage_h |
| 20 |
#include <cstddef> |
| 21 |
#include <string> |
| 22 |
namespace itk |
| 23 |
{ |
| 24 |
|
| 25 |
/** |
| 26 |
* \class ViewImage |
| 27 |
* |
| 28 |
* \brief Class with static function to visualize an image using just vtk. |
| 29 |
* It accepts 2D and 3D images. |
| 30 |
* |
| 31 |
* Usage example: |
| 32 |
* |
| 33 |
* itk::ViewImage<ImageType>::View( reader->GetOutput() ); |
| 34 |
* |
| 35 |
* \ingroup ITKVtkGlue |
| 36 |
*/ |
| 37 |
template <typename TImage> |
| 38 |
class ViewImage |
| 39 |
{ |
| 40 |
public: |
| 41 |
using ImageType = TImage; |
| 42 |
/** |
| 43 |
* Static function to visualize 2D and 3D images. |
| 44 |
* |
| 45 |
* \param img Input image |
| 46 |
* \param windowTitle Title of the window. |
| 47 |
* \param windowWidth Width of the visualization window. |
| 48 |
* \param windowHeight Height of the visualization window. |
| 49 |
*/ |
| 50 |
static void |
| 51 |
View(const ImageType * img, |
| 52 |
const std::string & windowTitle = "itkView", |
| 53 |
size_t windowWidth = 600, |
| 54 |
size_t windowHeight = 600); |
| 55 |
}; |
| 56 |
} // namespace itk |
| 57 |
|
| 58 |
#ifndef ITK_MANUAL_INSTANTIATION |
| 59 |
# include "itkViewImage.hxx" |
| 60 |
#endif |
| 61 |
#endif |