Skip to content

Instantly share code, notes, and snippets.

View NicoKiaru's full-sized avatar

Nicolas Chiaruttini NicoKiaru

View GitHub Profile
#@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 / 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
*/
@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 / 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 / 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 / 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
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 / 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:
@NicoKiaru
NicoKiaru / IJMeasureLifeTimeBasic.ijm
Created November 23, 2020 16:54
[Simple Life Time Measurement in ImageJ] Estimate lifetime of ROIs based on single exponential fits ( ImageJ / FIJI ) #Fiji #ROI #FLIM #BIOP
/**
* Allows to compute in a simple manner different regions of a lifetime stack image
*
* REQUIREMENT : For Picoquant file reading, install PTU-Reader (https://github.com/ekatrukha/PTU_Reader)
*
* How to use the script:
* 0 open a PTU file
* 1 make regions of interest and store them into the ROI Manager
* 2 select the lifetime stack
* 3 execute the script and provide the necessary parameters
@NicoKiaru
NicoKiaru / DisplayRoisInBdv.groovy
Last active November 30, 2020 13:44
[Display ROIs in BigDataViewer] Display ROIs of the RoiManager linked to an ImagePlus using BigDataViewer ( ImageJ / FIJI ) #Fiji #ROI #BigDataViewer #BIOP
/**
* Allows to visualize the rois of a RoiManager linked to an ImagePlus
* into bigdataviewer.
*
* REQUIREMENT : install the bigdataviewer-playground update site ( still in development! expect things to break!! )
* Update site : https://biop.epfl.ch/Fiji-Bdv-Playground/
* Source code : https://github.com/bigdataviewer/bigdataviewer-playground
*
*
* A lazy image is generated which display a small square region around each ROI