diff --git a/assets/img/project_cool_1.png b/assets/img/project_cool_1.png new file mode 100644 index 0000000000000000000000000000000000000000..87b7c7e79f84469ecee36a650fa653c59f9d1d82 Binary files /dev/null and b/assets/img/project_cool_1.png differ diff --git a/assets/img/project_cool_2.png b/assets/img/project_cool_2.png new file mode 100644 index 0000000000000000000000000000000000000000..335b7627d3db77a5461784b04917c715571b3fea Binary files /dev/null and b/assets/img/project_cool_2.png differ diff --git a/assets/img/project_cool_3.png b/assets/img/project_cool_3.png new file mode 100644 index 0000000000000000000000000000000000000000..c6c4d7a37daf7f76539987d934e04953bf793468 Binary files /dev/null and b/assets/img/project_cool_3.png differ diff --git a/assets/img/project_cool_4.png b/assets/img/project_cool_4.png new file mode 100644 index 0000000000000000000000000000000000000000..103c646b5768dff20da12808feeb49adec204fcd Binary files /dev/null and b/assets/img/project_cool_4.png differ diff --git a/assets/img/project_transform_im.png b/assets/img/project_transform_im.png new file mode 100644 index 0000000000000000000000000000000000000000..f4dfd5da216d46f229bdfdb76be231a500e9b9ef Binary files /dev/null and b/assets/img/project_transform_im.png differ diff --git a/assets/img/project_transform_re.png b/assets/img/project_transform_re.png new file mode 100644 index 0000000000000000000000000000000000000000..0c342169e4dfc7be4505e9ccfce4d320a00d280e Binary files /dev/null and b/assets/img/project_transform_re.png differ diff --git a/assets/img/project_transform_swapped_im.png b/assets/img/project_transform_swapped_im.png new file mode 100644 index 0000000000000000000000000000000000000000..c0ceb4bf439e1f142a9d3c70d5b9db743cc70172 Binary files /dev/null and b/assets/img/project_transform_swapped_im.png differ diff --git a/assets/img/project_transform_swapped_re.png b/assets/img/project_transform_swapped_re.png new file mode 100644 index 0000000000000000000000000000000000000000..912edca951bfb541519250f54f755dedba8dbcd2 Binary files /dev/null and b/assets/img/project_transform_swapped_re.png differ diff --git a/project.md b/project.md index 57b9fc8e3ae52a533d94aee0f3f65f92b573494a..c7ece83310e4fc915fe5df86ec4344ac2a99ef96 100644 --- a/project.md +++ b/project.md @@ -143,6 +143,46 @@ specifically for polar resampling for CT reconstruction, but there are better al anyway so I'll move on. +### Outtakes + +I got a number of interesting failures before getting my code to work correctly. + + + + + + +These all started as attempts to project and reconstruct a disk, though I did experiment once +interesting mistakes started happening. They mostly result from indexing errors and an issue with my +integration with FFTW. The latter problem relates to the periodicity of discrete Fourier transforms +and the resulting ambiguity in frequency interpretation. In a nutshell, the DFT doesn't give you +samples of the continuous Fourier transform; it gives you samples of the periodic summation of the +continuous Fourier transform. So each sample isn't representative of one frequency, it's +representative of a whole equivalence class of frequencies. + +For this application it's very important that the center of the polar coordinate system used for +resampling is right at the DC sample. So though the raw Fourier transform of the image looks like +this (real and imaginary parts shown separately), + + + + +we want to permute the quadrants so that it looks like this: + + + + +Then the center of the image can be the center of the polar coordinate system. (Note: to make these +I linearly mapped the full range of each image to [1, e], then applied the natural logarithm. So +though they aren't the same color, both tend toward zero away from the center.) This is akin to +viewing the sample frequencies not as $$0$$, $$1/N$$, $$\ldots$$, $$(N - 1)/N$$, but as $$0$$, +$$1/N$$, $$\ldots$$, $$(N/2 - 1)/N$$, $$-1/2$$, $$\ldots$$, $$-1/N$$. + +Interestingly, you can do this by literally swapping quadrants of the image, or by multiplying the +results element-wise by a checker board of 1s and -1s. This seems like magic until you just write +out the math. + + ## Filtered Back Projection It would be nice if we could avoid the interpolation required for Fourier reconstruction. The