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
package net.imglib2.benchmarks; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Fork; | |
import org.openjdk.jmh.annotations.Level; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; |
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
public static IterableInterval< RealPoint > usingConverters( RealInterval interval, int... numSteps ) | |
{ | |
final int nd = interval.numDimensions(); | |
final double[] steps = stepsFromSamples( interval, fillWithLast( nd, numSteps ) ); | |
final RandomAccessibleInterval< Localizable > samples = Localizables.randomAccessibleInterval( | |
new FinalInterval( Arrays.stream( steps ).mapToLong( x -> (long)x ).toArray() )); | |
RandomAccessibleInterval< RealPoint > positions = Converters.convert2( samples, (x,y) -> { | |
for( int i = 0; i < nd; i++ ) | |
y.setPosition( |
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
import java.io.IOException; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import org.janelia.saalfeldlab.n5.N5DatasetDiscoverer; | |
import org.janelia.saalfeldlab.n5.N5FSReader; | |
import org.janelia.saalfeldlab.n5.N5Reader; | |
import org.janelia.saalfeldlab.n5.N5TreeNode; | |
import org.janelia.saalfeldlab.n5.hdf5.N5HDF5Reader; | |
import org.janelia.saalfeldlab.n5.ij.N5Importer; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#@ ImagePlus imp | |
#@ UIService ui | |
/** | |
* Rigidly align slices with point rois. | |
* | |
* Usage: | |
* 1) Click at least 3 point landmarks in every slice of your image. | |
* There must be an equal number of landmarks in each slice. | |
* Landmarks must be clicked in the same order in each slice. |
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
#@ UIService ui | |
#@ DatasetService ds | |
/* | |
* Happy Pi Day 2022 | |
* | |
* This visualizes the bifurcation diagram for the "standard circle map" | |
* https://en.wikipedia.org/wiki/Arnold_tongue#Standard_circle_map | |
* | |
* (and its parameters are expressed in terms of pi) |
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
/** | |
* Happy Valentine's day 2022 | |
* | |
* author: John Bogovic | |
*/ | |
import net.imglib2.*; | |
import net.imglib2.view.*; | |
import net.imglib2.img.array.*; | |
import net.imglib2.img.imageplus.*; |
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
#!/bin/bash | |
isMac12 () { | |
hasSwVers=$(command -v sw_vers) | |
if [ ! -z $hasSwVers ] | |
then | |
ver=$(sw_vers | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') | |
if [[ $ver =~ ^12\..* ]] | |
then |
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
#@ Dataset source | |
#@ Dataset target | |
/** | |
* Pads/crops the source image such that its field of view matches that target image, | |
* respecting the target image origin. | |
* | |
* Currently only supports pixel-length shifts, and ignores source origin. | |
* | |
* see: |
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
#@File lut | |
lut = ij.plugin.LutLoader.openLut( lut.getCanonicalPath() ); | |
for( i in 0..<lut.getMapSize() ) | |
{ | |
println( [lut.getRed( i ), lut.getGreen(i), lut.getBlue(i)].join(" ") ) | |
} |