Skip to content

Instantly share code, notes, and snippets.

View NicoKiaru's full-sized avatar

Nicolas Chiaruttini NicoKiaru

View GitHub Profile
@NicoKiaru
NicoKiaru / DendritesAnalysis.groovy
Last active September 5, 2023 13:08
[Spine analysis] Analyse and output cropped images around each spine. Needs a Simple Neurite Tracer input - #BIOP #Fiji #SNT
/**
* Dendrite Info Display and Analysis
* PTBIOP update site should be enable
* NeuroMorpho update site should be enabled
*
* This script takes a dendrite image as an input and a SNT traces files where:
* - Spine branch should be tagged 'Spine' (at least)
* - The branches on which tagged spines are located should be tagged 'root'
*
* The script outputs:
package ch.epfl.biop.trackmategdsc;
import fiji.plugin.trackmate.*;
import fiji.plugin.trackmate.action.AbstractTMAction;
import fiji.plugin.trackmate.action.ExportTracksToXML;
import fiji.plugin.trackmate.action.TrackMateAction;
import fiji.plugin.trackmate.action.TrackMateActionFactory;
import fiji.plugin.trackmate.gui.TrackMateGUIController;
import fiji.plugin.trackmate.util.TMUtils;
import org.jdom2.Element;
@NicoKiaru
NicoKiaru / NikonStereologyBdvVisualizer.groovy
Created March 29, 2021 09:14
Takes a Nikon ND2 file and visualizes it lazily in BigDataViewer #BIOP #Fiji #BigDataViewer #NikonStereology
// You need to activate https://biop.epfl.ch/Fiji-Bdv-Playground/ for this script to function
// It takes a Nikon ND2 file and Visualizes it lazily in BigDataViewer, also opens some windows to control Brightness
// Of each channel present in the file
// Nicolas Chiaruttini, BIOP, EPFL, 2021
#@CommandService cs
#@SourceAndConverterService sac_service
#@File(label="Select your Nikon ND2 file (single timepoint only)", style="open") nikonNd2File
@NicoKiaru
NicoKiaru / NikonStereologyExporter.groovy
Created March 29, 2021 09:15
Takes a Nikon ND2 file and batch exports individual series, optionally Z Projected and rescaled #BIOP #Fiji #BigDataViewer #NikonStereology
// You need to activate https://biop.epfl.ch/Fiji-Bdv-Playground/ for this script to function
// It takes a Nikon ND2 file and batch exports individual series, optionally Z Projected and rescaled
// Nicolas Chiaruttini, BIOP, EPFL, 2021
#@CommandService cs
#@SourceAndConverterService sac_service
#@File(label="Select your Nikon ND2 file (single timepoint only)", style="open") nikonNd2File
#@File(label="Select directory to save images", style="directory", value="default") saveDir
@NicoKiaru
NicoKiaru / TestRegister.groovy
Last active October 29, 2024 09:45
Test Fiji / Elastix bridge of BigDataViewer-Playground
/**
* BIOP, EPFL, Nicolas Chiaruttini, 18th April 2021
* Simple script for a simple registration test
*/
import ij.IJ
import ch.epfl.biop.wrappers.elastix.ij2commands.Elastix_Register
import ch.epfl.biop.wrappers.transformix.ij2commands.Transformix_TransformImgPlus
import ij.gui.WaitForUserDialog
@NicoKiaru
NicoKiaru / RecursiFIJI.groovy
Last active May 17, 2023 18:46
#BIOP #BigDataViewer
/**
* Example of generative image (here a recursive Fiji logo) displayed in BigDataViewer
* The PTBIOP update site needs to be enabled
*/
import bdv.util.Procedural3DImageShort
import net.imglib2.RealRandomAccessible
import bdv.util.BdvFunctions
import bdv.util.BdvOptions
import bdv.util.BdvHandle
@NicoKiaru
NicoKiaru / bf2ometiff.groovy
Last active June 19, 2023 10:33
Batch conversion to pyramidal ome-tiff using Glencoe Software optimized workflow #BIOP #Fiji #OmeTiff #MRXS
/* Batch conversion of files to OME-TIFF following this install:
* https://c4science.ch/w/bioimaging_and_optics_platform_biop/image-processing/qupath/ome-tiff-conversion/
*
* Uses bioformats2raw and raw2ometiff
* https://www.glencoesoftware.com/blog/2019/12/09/converting-whole-slide-images-to-OME-TIFF.html
*
* Works with MRXS files
*
* Nicolas BIOP, EPFL, 2021
*/
#@ImageJ ij
#@Context ctx
// RISKY SCRIPT FOR THE HDD! RECOMMENDED TO TEST ON AN EMPTY USB STICK
def imp = IJ.openImage("http://imagej.nih.gov/ij/images/Spindly-GFP.zip");
File testExport = new File("F:/mitosis.ome.tiff");
@NicoKiaru
NicoKiaru / checkUpdateSites.groovy
Last active January 14, 2022 14:52
How to investigate the list of Update Sites enabled #BIOP #Fiji #UpdateSites
/**
* Simple script demoing how to check if an update site is enabled
* and how to list all enabled update sites
*
* @author Nicolas Chiaruttini
* BIOP, EPFL, 2022
**/
#@UpdateService updateService
@NicoKiaru
NicoKiaru / ImportABBARegions.groovy
Last active January 11, 2024 13:10
Import Atlas regions in QuPath from an ABBA registered project #BIOP #ABBA #QuPath
/**
* Import regions from an ABBA registered project into QuPath
* See https://biop.github.io/ijp-imagetoatlas/
* Author: Olivier Burri, Nicolas Chiaruttini, BIOP, EPFL
* Date: 2022-01-26
*/
// Erase and re import regions, the string should specify an existing key in the atlas ontology
// Available properties for Allen Brain Atlas are "acronym", "atlas_id", "color_hex_triplet", "graph_order", "hemisphere_id", "id", "name", "ontology_id", "parent_structure_id", "st_level"
importAbbaRegions( "acronym" )