Loading [MathJax]/jax/input/TeX/config.js
ITK 6.0.0
Insight Toolkit
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
itkTestingHashImageFilter.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 * https://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 itkTestingHashImageFilter_h
19#define itkTestingHashImageFilter_h
20
21
24
25namespace itk
26{
27namespace Testing
28{
34{
35public:
40 enum class HashFunction : uint8_t
41 {
43 };
44};
45// Define how to print enumeration
46extern std::ostream &
47operator<<(std::ostream & out, HashImageFilterEnums::HashFunction value);
48
64template <typename TImageType>
65class ITK_TEMPLATE_EXPORT HashImageFilter : public InPlaceImageFilter<TImageType, TImageType>
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(HashImageFilter);
69
75
76 using RegionType = typename TImageType::RegionType;
77
79 itkNewMacro(Self);
80
82 itkOverrideGetNameOfClassMacro(HashImageFilter);
83
86
89
91 std::string
92 GetHash() const
93 {
94 return this->GetHashOutput()->Get();
95 }
96 HashObjectType *
98 {
99 return static_cast<HashObjectType *>(this->ProcessObject::GetOutput(1));
100 }
101 const HashObjectType *
103 {
104 return static_cast<const HashObjectType *>(this->ProcessObject::GetOutput(1));
105 }
106
113
115#if !defined(ITK_LEGACY_REMOVE)
117 static constexpr HashFunctionEnum MD5 = HashFunctionEnum::MD5;
118#endif
119
123 itkSetEnumMacro(HashFunction, HashFunctionEnum);
124 itkGetMacro(HashFunction, HashFunctionEnum);
125
126protected:
128
129 // virtual ~HashImageFilter(); // implementation not needed
130
131 void
132 PrintSelf(std::ostream & os, Indent indent) const override;
133
135 void
138 void
141
142 // See superclass for doxygen documentation
143 //
144 // This method is to do work after the superclass potential threaded
145 // copy.
146 void
148
149 // See superclass for doxygen documentation
150 //
151 // Override since the filter produces all of its output
152 void
154
155private:
156 HashFunctionEnum m_HashFunction{ HashFunctionEnum::MD5 };
157};
158
159} // end namespace Testing
160} // end namespace itk
161
162
163#include "itkTestingHashImageFilter.hxx"
164
165#endif // itkTestingHashImageFilter_h
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
typename OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition itkIndent.h:50
DataObject * GetOutput(const DataObjectIdentifierType &key)
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
Enum classes for HashImageFilter.
void DynamicThreadedGenerateData(const typename Superclass::OutputImageRegionType &) override
void EnlargeOutputRequestedRegion(DataObject *data) override
void ThreadedGenerateData(const typename Superclass::OutputImageRegionType &, ThreadIdType) override
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
InPlaceImageFilter< TImageType, TImageType > Superclass
typename DataObject::Pointer DataObjectPointer
const HashObjectType * GetHashOutput() const
void PrintSelf(std::ostream &os, Indent indent) const override
SmartPointer< const Self > ConstPointer
HashImageFilterEnums::HashFunction HashFunctionEnum
void AfterThreadedGenerateData() override
SimpleDataObjectDecorator< std::string > HashObjectType
typename TImageType::RegionType RegionType
std::ostream & operator<<(std::ostream &out, const ExtractSliceImageFilterEnums::TestExtractSliceImageFilterCollapseStrategy value)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType