Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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  itkTypeMacro(MaskUtilities, itk::Object);
39 
40  typedef itk::Image<TPixel, VImageDimension> ImageType;
41  typedef itk::Image<unsigned short, VImageDimension> MaskType;
42 
46  void SetImage(ImageType* image);
47 
51  void SetMask(MaskType* mask);
52 
57  bool CheckMaskSanity();
58 
62  typename itk::Image<TPixel, VImageDimension>::Pointer ExtractMaskImageRegion();
63 
64  protected:
65  MaskUtilities(): m_Image(nullptr), m_Mask(nullptr){}
66 
67  ~MaskUtilities() override{}
68 
69  private:
70  itk::Image<TPixel, VImageDimension>* m_Image;
71  itk::Image<unsigned short, VImageDimension>* m_Mask;
72  };
73 }
74 
75 #ifndef ITK_MANUAL_INSTANTIATION
76 #include <mitkMaskUtilities.cpp>
77 #endif
78 
79 #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
mitk::Image::Pointer image
itk::Image< unsigned short, VImageDimension > MaskType
itk::Image< TPixel, VImageDimension > ImageType
mitk::Image::Pointer mask