Skip to content

Instantly share code, notes, and snippets.

View bogovicj's full-sized avatar

John Bogovic bogovicj

  • HHMI Janelia Research Campus
  • Washington DC metro area
View GitHub Profile
@bogovicj
bogovicj / shapeDemo.groovy
Created April 2, 2024 14:12
ImageJ2 script that displays a Diamond or Hypersphere neighborhood for a given radius
#@ DatasetService ds
#@ UIService ui
#@ Long radius = 13
#@ String (choices={"Diamond", "Hypersphere"}, style="listBox") shapeType
/*
* Displays a Diamond or Hypersphere neighborhood for a given radius
*/
if( shapeType.equals("Diamond"))
shp = new DiamondShape(radius);
@bogovicj
bogovicj / skimage_affine.ipynb
Created March 20, 2024 14:06
Apply an affine or scaling transform with scikit-image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bogovicj
bogovicj / CompressionExamples.java
Created December 8, 2023 18:16
Create example n5 array datasets for a variety of compression methods.
package org.janelia.saalfeldlab.n5.generateExamples;
import org.janelia.saalfeldlab.n5.Bzip2Compression;
import org.janelia.saalfeldlab.n5.Compression;
import org.janelia.saalfeldlab.n5.GzipCompression;
import org.janelia.saalfeldlab.n5.Lz4Compression;
import org.janelia.saalfeldlab.n5.N5Writer;
import org.janelia.saalfeldlab.n5.RawCompression;
import org.janelia.saalfeldlab.n5.XzCompression;
import org.janelia.saalfeldlab.n5.blosc.BloscCompression;
@bogovicj
bogovicj / image_geometry.ipynb
Last active July 18, 2024 01:12
Image geometry and indexing in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bogovicj
bogovicj / awsCredentialsCheck.groovy
Last active August 4, 2023 20:49
Fiji S3 credentials tests
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.AnonymousAWSCredentials;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.ListObjectsV2Request;
@bogovicj
bogovicj / iterateRows.groovy
Created June 22, 2023 20:57
ImageJ2 script to perform an operation over the rows of a dataset
#@ Dataset img
/**
* Perform an operation on every row of the input image.
*
* This sets every pixel in the first row to have value zero,
* the second row will have value one, etc.
*
* https://forum.image.sc/t/best-way-to-iterate-over-columns-rows/82472
*/
@bogovicj
bogovicj / zarrObjs.ipynb
Created February 15, 2023 22:20
Playing with zarr object stores
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bogovicj
bogovicj / composeDfields.groovy
Created December 22, 2022 21:45
ImageJ2 script to compose displacement fields
#@ Dataset da
#@ Dataset db
dap = Views.moveAxis( da, 2, 0 );
dbp = Views.moveAxis( da, 2, 0 );
spacing = [1, 1, 1] as double[];
dfA = new DisplacementFieldTransform( dap, spacing );
dfB = new DisplacementFieldTransform( dbp, spacing );
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bogovicj
bogovicj / zarrQuantization.ipynb
Created September 29, 2022 18:29
Quantizing and compressing with zarr.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.