Class to calculate the sum-of-squared-differences (SSD) image similarity value and gradient.
void SSDImageSimilarity::GetSimilarityGradientWRTVoxels |
( |
nifti_image * |
referenceImg, |
|
|
nifti_image * |
sourceImg, |
|
|
nifti_image * |
similarityGradientWRTVoxelsOutputImage |
|
) |
| |
|
virtual |
Calculates and returns the gradient of the image similarity measure with respect to the voxel intensities. Unlike SSDImageSimilarity::GetSimilarityMeasureValueForImages this funciton is not symmetric. Here \( \frac{\partial \mathcal{S}_t}{\mathbf{P}_{A_t}}\) is calculated, which for SSD is given by
\[ \frac{ \partial \mathcal{S} }{ \partial p_{A_t ,y} } = -2\left( p_{A_t ,y} - \partial p_{t ,y} \right) \]
calculated at each voxel.
- Parameters
-
referenceImg | Nifti image pointer to the reference image. In the case of the unified registration framework it is the actual dynamic image \( \mathbf{P}_{t} \). |
sourceImg | Nifti image pointer to the source image. In the case of the unified registration framework it is the simulated dynamic image \( \mathbf{P}_{A_t} \). |
similarityGradientWRTVoxelsOutputImage | Nifti image of the same size/geometry of the sourceImg and referenceImg that is used to recieve the gradient image. Purposely not a member of this class. |
- Todo:
- Decide how to deal with multiple time points in images
Implements ImageSimilarity.