ITK 6.0.0
Insight Toolkit
 
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::Testing
26{
32{
33public:
38 enum class HashFunction : uint8_t
39 {
41 };
42};
43// Define how to print enumeration
44extern std::ostream &
45operator<<(std::ostream & out, HashImageFilterEnums::HashFunction value);
46
62template <typename TImageType>
63class ITK_TEMPLATE_EXPORT HashImageFilter : public InPlaceImageFilter<TImageType, TImageType>
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(HashImageFilter);
67
73
74 using RegionType = typename TImageType::RegionType;
75
77 itkNewMacro(Self);
78
80 itkOverrideGetNameOfClassMacro(HashImageFilter);
81
84
87
89 [[nodiscard]] std::string
90 GetHash() const
91 {
92 return this->GetHashOutput()->Get();
93 }
94 HashObjectType *
96 {
97 return static_cast<HashObjectType *>(this->ProcessObject::GetOutput(1));
98 }
99 [[nodiscard]] const HashObjectType *
101 {
102 return static_cast<const HashObjectType *>(this->ProcessObject::GetOutput(1));
103 }
104
111
113#if !defined(ITK_LEGACY_REMOVE)
115 static constexpr HashFunctionEnum MD5 = HashFunctionEnum::MD5;
116#endif
117
121 itkSetEnumMacro(HashFunction, HashFunctionEnum);
122 itkGetMacro(HashFunction, HashFunctionEnum);
123
124protected:
126
127 // virtual ~HashImageFilter(); // implementation not needed
128
129 void
130 PrintSelf(std::ostream & os, Indent indent) const override;
131
133 void
136 void
139
140 // See superclass for doxygen documentation
141 //
142 // This method is to do work after the superclass potential threaded
143 // copy.
144 void
146
147 // See superclass for doxygen documentation
148 //
149 // Override since the filter produces all of its output
150 void
152
153private:
154 HashFunctionEnum m_HashFunction{ HashFunctionEnum::MD5 };
155};
156
157} // namespace itk::Testing
158
159
160#include "itkTestingHashImageFilter.hxx"
161
162#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)
unsigned int ThreadIdType