{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "cbda31c6", "metadata": {}, "outputs": [], "source": [ "using MIRTjim: jim\n", "using ImageFiltering: centered, imfilter\n", "using Plots: savefig\n", "using SPECTrecon: fft_conv" ] }, { "cell_type": "code", "execution_count": null, "id": "f5852bb8", "metadata": {}, "outputs": [], "source": [ "M = 80\n", "N = 64\n", "T = Float32\n", "img = ones(T, M, N) * T(0.5) # replicate padding\n", "img[5:M-5, 5:N-5] .= rand(T, 71, 55)\n", "ker = rand(T, 5, 5)\n", "ker .+= ker'\n", "ker .+= reverse(ker)\n", "ker /= sum(ker)\n", "my = fft_conv(img, ker)\n", "julia = imfilter(img, centered(ker), \"circular\")\n", "jim(jim(my, \"my\"), jim(julia, \"julia\"), jim(my - julia, \"diff\"), gui=true)" ] }, { "cell_type": "code", "execution_count": null, "id": "4d673f57", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.6.3", "language": "julia", "name": "julia-1.6" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.6.3" } }, "nbformat": 4, "nbformat_minor": 5 }