| 111 | |
| 112 | template <class TImageType> |
| 113 | std::string |
| 114 | HashImageFilter::ExecuteInternal(const Image & inImage) |
| 115 | { |
| 116 | using InputImageType = TImageType; |
| 117 | |
| 118 | typename InputImageType::ConstPointer image = dynamic_cast<const InputImageType *>(inImage.GetITKBase()); |
| 119 | |
| 120 | using HashFilterType = itk::HashImageFilter<InputImageType>; |
| 121 | typename HashFilterType::Pointer hasher = HashFilterType::New(); |
| 122 | hasher->SetInput(image); |
| 123 | hasher->InPlaceOff(); // pointless copy of data needed |
| 124 | |
| 125 | switch (this->GetHashFunction()) |
| 126 | { |
| 127 | case SHA1: |
| 128 | hasher->SetHashFunction(HashFilterType::SHA1); |
| 129 | break; |
| 130 | case MD5: |
| 131 | hasher->SetHashFunction(HashFilterType::MD5); |
| 132 | break; |
| 133 | } |
| 134 | |
| 135 | this->PreUpdate(hasher.GetPointer()); |
| 136 | |
| 137 | hasher->Update(); |
| 138 | |
| 139 | return hasher->GetHash(); |
| 140 | } |
| 141 | |
| 142 | std::string |
| 143 | Hash(const Image & image, HashImageFilter::HashFunction function) |
nothing calls this directly
no test coverage detected