I use git from scoop. Open git bash to access the gpg
binary. If you install gpg
from scoop it will not work as git doesn't know about it.
gpg --import private.key
from concurrent.futures import ThreadPoolExecutor | |
from pathlib import Path | |
from tqdm import tqdm | |
import cv2 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def find_best_img_match(target_img: np.array, imgpaths: list[Path]): |
""" | |
Convert exported, rect OCT images to aligned rect and radial, save as NRRD files. | |
1. Change the `input_folder` to point to the directory containing images. | |
2. Change the row range used for correlation by changing `rowStart` and `rowEnd` to make sure they only include the tubing and avoid any tissue in this window. | |
Install dependencies: | |
``` | |
python3 -m pip install numpy matplotlib pillow pynrrd tqdm opencv-python |
""" | |
dependencies: numpy pillow pynrrd tqdm | |
""" | |
from PIL import Image | |
from pathlib import Path | |
from tqdm import tqdm | |
import nrrd | |
import numpy as np |
function(copy_to_target_dir target resource) | |
add_custom_command( | |
TARGET ${target} POST_BUILD | |
COMMAND ${CMAKE_COMMAND} -E copy_directory | |
"$<TARGET_PROPERTY:${target},SOURCE_DIR>/${resource}" | |
"$<TARGET_FILE_DIR:${target}>/${resource}" | |
) | |
endfunction() | |
copy_to_target_dir(${EXE_NAME} shaders) |
#include <iostream> | |
#include <fstream> | |
#include <armadillo> | |
// T is the type of value stored in the binary file. | |
template <typename T> | |
auto load_bin(const fs::path &filename) -> arma::Mat<T> { | |
std::ifstream file(filename, std::ios::binary | std::ios::ate); |
jobs:
build:
steps:
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
""" | |
typed_mat_mixin.py provides a mixin `InitMixin` that tries | |
to generate a `.init` method to a typed Dataclass to automatically | |
deserialize .mat files exported from MATLAB to a Python Dataclass. | |
Supported types: | |
- strings | |
- int, float, np.uint8, and most np typedefs | |
- np.ndarray (1D and 2D tested) | |
- Type arrays as np.array[ndims, dtype] |
""" | |
B. S. Reddy and B. N. Chatterji, “An FFT-based technique for translation, rotation, and scale-invariant image registration,” IEEE Transactions on Image Processing, vol. 5, no. 8, pp. 1266–1271, Aug. 1996, doi: 10.1109/83.506761. | |
Implemented in Numpy/OpenCV and Numpy/Scikit-Image | |
The OpenCV version is about 4 times faster than the Scikit-Image version. | |
""" | |
# Numpy/OpenCV implementation | |
import cv2 | |
from scipy import signal |
import numpy as np | |
import cv2 | |
def polar2cart(img: np.ndarray): | |
""" | |
Convert image (B-scan) from Polar coordinates to Cartesian coordinates | |
""" | |
# Resize image to square first |