Skip to content
Discussion options

You must be logged in to vote

Thank you for highlighting this issue with the SSIM implementation regarding small and large Gaussian kernel sigmas leading to padding and empty slicing problems, which result in NaN values.

Your analysis about the padding calculations causing empty slices and the double removal of padding (valid convolution followed by manual cropping) sounds accurate and seems to be a legitimate concern, especially for small image stacks like in medical imaging.

This type of issue with edge handling and padding size checks is critical for stable SSIM computation.

I recommend first making sure you are using the latest version of TorchMetrics, as there have been recent fixes and improvements related to SS…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Borda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants