MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / ExecuteInternal

Method ExecuteInternal

Code/BasicFilters/src/sitkHashImageFilter.cxx:113–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112template <class TImageType>
113std::string
114HashImageFilter::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
142std::string
143Hash(const Image & image, HashImageFilter::HashFunction function)

Callers

nothing calls this directly

Calls 5

GetHashFunctionMethod · 0.95
SetHashFunctionMethod · 0.80
GetHashMethod · 0.80
GetITKBaseMethod · 0.45
PreUpdateMethod · 0.45

Tested by

no test coverage detected