SimpleITK  
itkHashImageFilter.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 itkHashImageFilter_h
19#define itkHashImageFilter_h
20
21
24#include "itkCastImageFilter.h"
25#include "itkByteSwapper.h"
26
27
28namespace itk
29{
30
40template <class TImageType>
41class HashImageFilter : public CastImageFilter<TImageType, TImageType>
42{
43public:
49
50 using RegionType = typename TImageType::RegionType;
51
54
57
60
63
65 std::string
66 GetHash() const
67 {
68 return this->GetHashOutput()->Get();
69 }
72 {
73 return static_cast<HashObjectType *>(this->ProcessObject::GetOutput(1));
74 }
75 const HashObjectType *
77 {
78 return static_cast<const HashObjectType *>(this->ProcessObject::GetOutput(1));
79 }
80
82 {
85 };
86
90
97
98protected:
100
101 // virtual ~HashImageFilter(); // implementation not needed
102
103 void
104 PrintSelf(std::ostream & os, Indent indent) const override;
105
106 // See superclass for doxygen documentation
107 //
108 // This method is to do work after the superclass potential threaded
109 // copy.
110 void
112
113 // See superclass for doxygen documentation
114 //
115 // Override since the filter produces all of its output
116 void
118
119private:
120 HashImageFilter(const Self &); // purposely not implemented
121 void
122 operator=(const Self &); // purposely not implemented
123
124
126};
127
128
129} // namespace itk
130
131
132#include "itkHashImageFilter.hxx"
133
134#endif // itkHashImageFilter_h
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
CastImageFilter< TImageType, TImageType > Superclass
HashObjectType * GetHashOutput()
itkTypeMacro(HashImageFilter, CastImageFilter)
itkGetMacro(HashFunction, HashFunction)
void operator=(const Self &)
void PrintSelf(std::ostream &os, Indent indent) const override
itkSetMacro(HashFunction, HashFunction)
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
HashImageFilter(const Self &)
typename TImageType::RegionType RegionType
typename DataObject::Pointer DataObjectPointer
void EnlargeOutputRequestedRegion(DataObject *data) override
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
SimpleDataObjectDecorator< std::string > HashObjectType
void AfterThreadedGenerateData() override
const HashObjectType * GetHashOutput() const
SmartPointer< Self > Pointer
std::string GetHash() const
ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
DataObject * GetOutput(const DataObjectIdentifierType &key)
DataObjectPointerArray::size_type DataObjectPointerArraySizeType