Skip to content

Instantly share code, notes, and snippets.

View tarokiritani's full-sized avatar

Taro Kiritani tarokiritani

View GitHub Profile
@tarokiritani
tarokiritani / Preprocess_Stack_for_Cell_Counting.ijm
Created April 28, 2017 09:23
imagej macro that preprocesses confocal image stack for cell counting
run("Bandpass Filter...", "filter_large=100 filter_small=5.1 suppress=None tolerance=5 autoscale process");
for(i=1;i<nSlices + 1;i++){
setSlice(i);
getStatistics(area, mean, min, max, std, histogram);
setThreshold(mean + 2 * std, 255);
run("Make Binary", "slice");
}
@tarokiritani
tarokiritani / Count_helper.ijm
Created March 10, 2017 15:09
a helper imagej macro for counting objects in 3D
roiManager("Show All");
run("Remove Overlay");
for (i=0; i<roiManager("count"); i++){
roiManager("select",i);
roiManager("Measure");
x=getResult("X");
y=getResult("Y");
z=getResult("Slice");
for (j=-14; j<14; j++){
setSlice(z+j);
@tarokiritani
tarokiritani / jupyter_collapse_headings_html
Created January 22, 2017 12:51
small script to collapse headings in jupyter notebook after converted to html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
var all_cells = $("div.cell");
$.each(all_cells, function( index, value ) {
if ($(value).find("h1").length == 0){
$(value).hide()
} else{
var bare_h1 = $(value).find("h1").text()
@tarokiritani
tarokiritani / readroi.py
Created November 6, 2015 13:33 — forked from luispedro/readroi.py
Read ImageJ's ROI files
# Copyright: Luis Pedro Coelho <luis@luispedro.org>, 2012
# License: MIT
import numpy as np
def read_roi(fileobj):
'''
points = read_roi(fileobj)
Read ImageJ's ROI format
'''