Skip to content

Instantly share code, notes, and snippets.

View jacobhepkema's full-sized avatar
🦆

Jacob Hepkema jacobhepkema

🦆
View GitHub Profile
@jacobhepkema
jacobhepkema / folder-batch.ijim
Created February 13, 2020 13:57
Folder batch processing with ImageJ
// Outputs pictures in source folder extra map "out".
// Make sure this folder is not yet there before running this script; otherwise errors
// at 'newArray' below, specify your
// "/main/directory/"
// which should contain subdirectories.
// The subdirectories contain your pictures,
// which are files containing three channels
// (red, green, blue)
@jacobhepkema
jacobhepkema / calculate_conv_out.py
Last active April 6, 2023 12:54
Calculate convolutional output size
import math
def conv_size(in_size, kernel_size, stride, padding):
out_size = in_size - kernel_size + (padding * 2)
if out_size % stride != 0:
print(f'Floor used for {out_size=}, {stride=}')
out_size = math.floor(out_size / stride)
out_size = out_size + 1
return out_size
@jacobhepkema
jacobhepkema / theme_Nice.R
Last active June 30, 2023 11:14
A nice theme for ggplots
theme_Nice <-
function(base_size = 14,
base_family = "Helvetica",
angled = TRUE,
show_legend = TRUE,
axis_text_size = 14) {
return(
theme_bw(base_size = base_size, base_family = base_family)
+ theme(
axis.text.x = element_text(