CustusX  22.04-rc5
An IGT application
cxAlgorithmHelpers.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXALGORITHMHELPERS_H_
13 #define CXALGORITHMHELPERS_H_
14 
15 #include "cxResourceExport.h"
16 
19 #include <itkImage.h>
20 
21 #include "cxForwardDeclarations.h"
22 #include "vtkForwardDeclarations.h"
23 
24 namespace cx
25 {
26 
27 const unsigned int Dimension = 3;
28 //typedef unsigned short PixelType;
29 typedef short PixelType; //short will probably work in most cases, but int may be needed
30 typedef itk::Image< PixelType, Dimension > itkImageType;
33 
34 
42 class cxResource_EXPORT AlgorithmHelper
43 {
44 public:
45  static itkImageType::ConstPointer getITKfromSSCImage(ImagePtr image);
46  static itkImageType::ConstPointer getITKfromVTKImage(vtkImageDataPtr image);
47 
48  static vtkImageDataPtr getVTKFromITK(itkImageType::ConstPointer input);
49  static vtkImageDataPtr execute_itk_GrayscaleFillholeImageFilter(vtkImageDataPtr input);
50 
51 private:
52  static itkImageType::ConstPointer getITKfromVTKImageViaFile(vtkImageDataPtr image);
53 };
54 
55 
56 }
57 
58 #endif /* CXALGOROTHMHELPERS_H_ */
itk::ImageToVTKImageFilter< itkImageType > itkToVtkFilterType
Class with helper functions for algorithms.
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
const unsigned int Dimension
itk::VTKImageToImageFilter< itkImageType > itkVTKImageToImageFilterType
Converts an ITK image into a VTK image and plugs a itk data pipeline to a VTK datapipeline.
itk::Image< PixelType, Dimension > itkImageType
short PixelType
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Converts a VTK image into an ITK image and plugs a vtk data pipeline to an ITK datapipeline.
Namespace for all CustusX production code.