SimpleITK  
sitkHashImageFilter.h
Go to the documentation of this file.
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 * http://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 sitkHashImageFilter_h
19#define sitkHashImageFilter_h
20
21#include "sitkMacro.h"
23#include "sitkImage.h"
24#include "sitkBasicFilters.h"
25#include "sitkImageFilter.h"
26#include "sitkProcessObject.h"
27
28namespace itk::simple
29{
30
37{
38public:
40
41 // function pointer type
42 typedef std::string (Self::*MemberFunctionType)(const Image &);
43
44 // this filter works with all itk::Image and itk::VectorImage types.
45 using PixelIDTypeList = typelist2::append<BasicPixelIDTypeList, ComplexPixelIDTypeList, VectorPixelIDTypeList>::type;
46
47 ~HashImageFilter() override;
48
50
52 {
55 };
56 SITK_RETURN_SELF_TYPE_HEADER
60
62 std::string
63 GetName() const override
64 {
65 return std::string("Hash");
66 }
67
68 // Print ourselves out
69 std::string
70 ToString() const override;
71
72 std::string
73 Execute(const Image &);
74
75
76private:
78
79 template <class TImageType>
80 std::string
81 ExecuteInternal(const Image & image);
82 template <class TImageType>
83 std::string
85
86 // friend to get access to executeInternal member
89
90 std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType>> m_MemberFactory;
91};
92
95} // namespace itk::simple
96#endif
typelist2::append< BasicPixelIDTypeList, ComplexPixelIDTypeList, VectorPixelIDTypeList >::type PixelIDTypeList
std::string ToString() const override
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
HashFunction GetHashFunction() const
std::string GetName() const override
Self & SetHashFunction(HashFunction hashFunction)
std::string ExecuteInternalLabelImage(const Image &image)
std::string(Self::* MemberFunctionType)(const Image &)
std::string Execute(const Image &)
std::string ExecuteInternal(const Image &image)
The Image class for SimpleITK.
Definition sitkImage.h:77
std::string Hash(const Image &image, HashImageFilter::HashFunction function=HashImageFilter::SHA1)
#define SITKBasicFilters_EXPORT