Skip to content

Instantly share code, notes, and snippets.

View Pablo1990's full-sized avatar
:shipit:
Focusing

Pablo Vicente Munuera Pablo1990

:shipit:
Focusing
View GitHub Profile
# APPLY VOLUME MERGE ANNOTATION
#
# This script applies a webKnossos merger mode annotation
# to a given segmentation layer. The script will output a
# TIFF image sequence.
#
# The --set_zero flag will relabel all non-annotated segments
# to 0.
#
# 1. Download the merger mode NML file.
@lacan
lacan / Export_Images_Folder.ijm
Last active February 24, 2024 12:27
Extract multi-series file and resave as TIFF stacks or slices #Fiji #ImageJ #Macro #BIOP
/*
* Complex Format EXPORT MACRO
* By Olivier Burri @ EPFL - SV - PTECH - BIOP
* Given a folder, extracts all series inside all multi-file files with given extension in new folders
* Last edit: 13.02.2017
*/
////////////////////// SET PARAMETERS //////////////////////
////////////////////////////////////////////////////////////
@postspectacular
postspectacular / tetrahedron-intersect.clj
Last active July 26, 2021 13:25
Tetrahedron intersection (currently runs in ~36% time than original revision of this gist)
;; Tetrahedron intersection based on this paper & algorithm:
;; http://vcg.isti.cnr.it/Publications/2003/GPR03/fast_tetrahedron_tetrahedron_overlap_algorithm.pdf
;;
;; Unlike original algorithm this implementation produces correct
;; results regardless of the orientation/ordering of points defining
;; the two tetrahedra. This is achieved via the orient-tetra function,
;; which ensures the correct ordering of vertices for this algorithm
;; to function properly.
;;
;; Implementation extracted from upcoming geometry library
@acdha
acdha / solr_grouping_backend.py
Last active December 14, 2017 13:45
Experimental django-haystack 2 backend which adds support for Solr's grouping / field collapsing
# encoding: utf-8
"""Experimental Solr Grouping / Field Collapsing backend for Haystack 2.0"""
# NOTE: You must be running the latest Pysolr master - no PyPI release yet!
# See https://gist.github.com/3750774 for the current version of this code
# See http://wiki.apache.org/solr/FieldCollapsing for the Solr feature documentation
from __future__ import absolute_import
import logging
from django.db.models.loading import get_model
@sheymann
sheymann / export_plot.R
Created April 16, 2012 16:01
R tip: Export a ggplot plot in PDF, EPS and PNG files
ExportPlot <- function(gplot, filename, width=2, height=1.5) {
# Export plot in PDF and EPS.
# Notice that A4: width=11.69, height=8.27
ggsave(paste(filename, '.pdf', sep=""), gplot, width = width, height = height)
postscript(file = paste(filename, '.eps', sep=""), width = width, height = height)
print(gplot)
dev.off()
png(file = paste(filename, '_.png', sep=""), width = width * 100, height = height * 100)
print(gplot)
dev.off()