SimpleITK  2.0.0
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 
28 namespace itk {
29 
39 template < class TImageType >
41  public CastImageFilter< TImageType, TImageType >
42 {
43 public:
49 
50  using RegionType = typename TImageType::RegionType;
51 
54 
57 
60 
63 
65  std::string GetHash() const
66  { return this->GetHashOutput()->Get(); }
68  { return static_cast< HashObjectType *>( this->ProcessObject::GetOutput(1) ); }
70  { return static_cast<const HashObjectType *>( this->ProcessObject::GetOutput(1) ); }
71 
72  enum HashFunction { SHA1, MD5 };
73 
77 
83 
84 protected:
85 
87 
88  // virtual ~HashImageFilter(); // implementation not needed
89 
90  void PrintSelf(std::ostream & os, Indent indent) const override;
91 
92  // See superclass for doxygen documentation
93  //
94  // This method is to do work after the superclass potential threaded
95  // copy.
96  void AfterThreadedGenerateData() override;
97 
98  // See superclass for doxygen documentation
99  //
100  // Override since the filter produces all of its output
101  void EnlargeOutputRequestedRegion(DataObject *data) override;
102 
103 private:
104  HashImageFilter(const Self &); //purposely not implemented
105  void operator=(const Self &); //purposely not implemented
106 
107 
109 };
110 
111 
112 } // end namespace itk
113 
114 
115 #include "itkHashImageFilter.hxx"
116 
117 #endif // itkHashImageFilter_h
itk::SimpleDataObjectDecorator
itk::CastImageFilter
itk::HashImageFilter::MD5
@ MD5
Definition: itkHashImageFilter.h:72
itk::HashImageFilter
Generates a hash string from an image.
Definition: itkHashImageFilter.h:40
itk::HashImageFilter::AfterThreadedGenerateData
void AfterThreadedGenerateData() override
itkByteSwapper.h
itk::HashImageFilter::itkGetMacro
itkGetMacro(HashFunction, HashFunction)
itk::HashImageFilter::GetHash
std::string GetHash() const
Definition: itkHashImageFilter.h:65
itk::HashImageFilter::HashImageFilter
HashImageFilter()
itk::ProcessObject::GetOutput
DataObject * GetOutput(const DataObjectIdentifierType &key)
itk::ImageSource::MakeOutput
ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
HashFunction
itk::SmartPointer< Self >
itk::Indent
itkCastImageFilter.h
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
itk::HashImageFilter::GetHashOutput
HashObjectType * GetHashOutput()
Definition: itkHashImageFilter.h:67
itk::HashImageFilter::operator=
void operator=(const Self &)
itk::HashImageFilter::EnlargeOutputRequestedRegion
void EnlargeOutputRequestedRegion(DataObject *data) override
itkImageLinearConstIteratorWithIndex.h
itk::ImageSource
itk::HashImageFilter::MakeOutput
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
itk::HashImageFilter::SHA1
@ SHA1
Definition: itkHashImageFilter.h:72
itk::HashImageFilter::RegionType
typename TImageType::RegionType RegionType
Definition: itkHashImageFilter.h:50
itk::HashImageFilter::itkNewMacro
itkNewMacro(Self)
itk::HashImageFilter::m_HashFunction
HashFunction m_HashFunction
Definition: itkHashImageFilter.h:108
itk::ImageSource::DataObjectPointerArraySizeType
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
itk::HashImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk
itk::ProcessObject
itk::HashImageFilter::GetHashOutput
const HashObjectType * GetHashOutput() const
Definition: itkHashImageFilter.h:69
itkSimpleDataObjectDecorator.h
itk::simple
Definition: sitkAdditionalProcedures.h:29
itk::SimpleDataObjectDecorator::Get
virtual T & Get()
itk::DataObject::Pointer
SmartPointer< Self > Pointer
itk::HashImageFilter::itkSetMacro
itkSetMacro(HashFunction, HashFunction)
itk::HashImageFilter::itkTypeMacro
itkTypeMacro(HashImageFilter, CastImageFilter)
itk::DataObject