jobs:
build:
steps:
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
dependencies: numpy pillow pynrrd tqdm | |
""" | |
from PIL import Image | |
from pathlib import Path | |
from tqdm import tqdm | |
import nrrd | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]): |
OlderNewer