Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkMaskUtilities.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKMASKUTIL
14 #define MITKMASKUTIL
15 
17 #include <mitkImage.h>
18 #include <itkImage.h>
19 
20 namespace mitk
21 {
26 template <class TPixel, unsigned int VImageDimension>
27 class MITKIMAGESTATISTICS_EXPORT MaskUtilities: public itk::Object
28  {
29  public:
32  typedef itk::Object Superclass;
35 
37  itkNewMacro(Self)
38 
39 
40  itkTypeMacro(MaskUtilities, itk::Object)
41 
42  typedef itk::Image<TPixel, VImageDimension> ImageType;
43  typedef itk::Image<unsigned short, VImageDimension> MaskType;
44 
48  void SetImage(ImageType* image);
49 
53  void SetMask(MaskType* mask);
54 
59  bool CheckMaskSanity();
60 
64  typename itk::Image<TPixel, VImageDimension>::Pointer ExtractMaskImageRegion();
65 
66  protected:
67  MaskUtilities(): m_Image(nullptr), m_Mask(nullptr){}
68 
69  ~MaskUtilities() override{}
70 
71  private:
72  itk::Image<TPixel, VImageDimension>* m_Image;
73  itk::Image<unsigned short, VImageDimension>* m_Mask;
74  };
75 }
76 
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #include <mitkMaskUtilities.cpp>
79 #endif
80 
81 #endif
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
DataCollection - Class to facilitate loading/accessing structured data.
Utility class for mask operations. It checks whether an image and a mask are compatible (spacing...
#define MITKIMAGESTATISTICS_EXPORT
Image class for storing images.
Definition: mitkImage.h:72
mitk::Image::Pointer image
itk::Image< unsigned short, VImageDimension > MaskType
itk::Image< TPixel, VImageDimension > ImageType
mitk::Image::Pointer mask