Skip to content

Instantly share code, notes, and snippets.

View ctrueden's full-sized avatar
🛸
Experiencing technical difficulties

Curtis Rueden ctrueden

🛸
Experiencing technical difficulties
View GitHub Profile
@ctrueden
ctrueden / Squash_Plugins_Menu.groovy
Created October 25, 2023 14:30
Fiji Plugins menu too tall
/*
* Is your Fiji installation's Plugins menu too tall on Linux,
* where it runs past the bottom of your screen?
* Here is a hacky script to shrink the font, so that you can
* fit more items before running out of screen real estate!
*
* License: CC0
*/
#@ Float squashFactor (value=0.75f)
@ctrueden
ctrueden / IDE_shortcuts.md
Last active October 11, 2023 08:45
IDE shortcuts
Operation IntelliJ calls it IntelliJ (Win/Linux) IntelliJ (macOS) Eclipse calls it Eclipse (Win/Linux) Eclipse (macOS)
Look up where a variable or class is actually used/referenced Find usages alt+shift+7 alt+F7 Global lookup ctrl+shift+G cmd+shift+G
Move the cursor to the next compile error or warning Jump to next problem F2 F2 Next ctrl+. cmd+.
Show recommended fixes for the selected problem Pop up context actions alt+enter alt+enter Show quick fixes ctrl+1
@ctrueden
ctrueden / MeshCursorTest.java
Created June 14, 2023 10:14
Hacky way to check whether points of a point cloud lie within a mesh
package net.imglib2.mesh.alg;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.function.BiConsumer;
import net.imglib2.Localizable;
import net.imglib2.mesh.io.ply.PLYMeshIO;
@ctrueden
ctrueden / Voxelize.java
Last active June 12, 2023 22:52
Convert a mesh to a binary mask using ImageJ Ops
import java.io.File;
import java.io.IOException;
import net.imagej.Dataset;
import net.imagej.ImageJ;
import net.imagej.mesh.Mesh;
import net.imagej.mesh.io.ply.PLYMeshIO;
import net.imagej.ops.OpService;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.converter.Converters;
@ctrueden
ctrueden / calibrated-axes-transform.groovy
Created April 28, 2023 17:54
Display an image with non-linear calibrated axes
#@ DatasetService ds
#@ net.imagej.units.UnitService units
#@ UIService ui
// Parameters to play with!
// log-linear equation: cal(raw) = a + b * ln(c + d*raw)
xa = 0; xb = 10; xc = 1; xd = 1 // cal(xRaw) = 10*ln(1+xRaw)
ya = 0; yb = 5000; yc = 1; yd = 3000 // cal(yRaw) = 5000*ln(1+3000*yRaw)
// units
@ctrueden
ctrueden / BOM-Testing.md
Last active September 16, 2022 19:36
Testing BOM components

Background and Context

We have a set of many components (software libraries and/or applications) known as a Bill of Materials (BOM). Many of these components depend on other components, forming a dependency graph (no cycles).

These components are under active development, with new versions being released over time. The BOM lists each component at a specific version, with the idea that all components of the BOM will work successfully together when used as dependencies of a derivative work.

For example, suppose we have the following components:

  • Guava v21 ← no dependencies
  • Math v1 ← depends on Guava v21
@ctrueden
ctrueden / generate-pyramid-resolutions.py
Created September 28, 2021 21:06
Generate OME-TIFF pyramids using Python
#!/usr/env/bin python
# Generate pyramidal OME-TIFF.
# Adapted from:
# https://github.com/ome/bio-formats-examples/blob/88d3f109093fb3350242061b00624af001f495e8/src/main/java/GeneratePyramidResolutions.java#L39-L43
import sys
import scyjava
@ctrueden
ctrueden / console.log
Last active September 17, 2021 14:26
sciview-canary crash 2021-09-17
Started application as PID 272117
imagej-launcher version bigger that non-working version (6.0.1 vs. 4.0.5), all good.
This is sciview / scenery, development version ( / (9877ce))
Resetting language to Python
WARNING did not load JythonAutoCompletions
Loaded Deferred Shading (Deferred Shading, with HDR postprocessing and FXAA)
Creating Vulkan instance with extensions VK_KHR_xlib_surface,VK_KHR_surface and layers
Physical devices:
0: Nvidia NVIDIA GeForce GT 1030 (DiscreteGPU, driver version 470.252.64, Vulkan API 1.2.175) (selected)
1: (Unknown vendor) llvmpipe (LLVM 12.0.0, 256 bits) (CPU, driver version 0.0.1, Vulkan API 1.0.2)
@ctrueden
ctrueden / notes.groovy
Created October 15, 2020 14:36
2020-10-15 ImageJ2.js meeting notes
#@ CommandService cs
#@ ModuleService ms
#@ ScriptService ss
modules = ms.getModules() // get all modules!
future = ms.run(modules[0], true, listOrMapOfArguments)
// if you want to block till completion:
m = future.get()
outputs = m.getOutputs() // is a dict
@ctrueden
ctrueden / imagej-js.pom
Created October 13, 2020 14:38
imagej-js.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>29.2.0</version>
<relativePath />
</parent>