Skip to content

Instantly share code, notes, and snippets.

View jandoG's full-sized avatar

Gayathri Nadar jandoG

  • Discovery Life Sciences
  • Berlin
  • 19:32 (UTC +02:00)
  • X @gaya_jn
View GitHub Profile
@jandoG
jandoG / fiji_jython_bioformats_example.py
Created January 24, 2023 12:19
Open images using bio-formats API (run with FIJI)
from ij import IJ, ImagePlus
from loci.plugins import BF
from loci.formats import ImageReader, FilePattern
from loci.formats import MetadataTools
from loci.plugins.prefs import OptionsList
from loci.plugins.in import ImporterOptions
def openImageWithBF(path, virtual= True, groupfiles = False, seriesdata = False, openseries = 1):
"""
set options to open image using bio-formats- use virtual for quick loading
@jandoG
jandoG / fiji_jython_analyze_particles.py
Created January 24, 2023 12:45
FIJI Analyze Particles using jython
from ij import IJ, ImagePlus
from ij.gui import Roi
from ij.plugin.filter import ParticleAnalyzer as PA
from ij.measure import Measurements, ResultsTable
from ij.plugin.frame import RoiManager
def getRoisByParticleAnalysis(mask, measures, minsize=0.01, maxsize=100.0, mincirc=0.1, maxcirc=1.0):
"""
Function to get array of rois from input mask.
Input: