Skip to content

Instantly share code, notes, and snippets.

View tferr's full-sized avatar

Tiago Ferreira tferr

View GitHub Profile
@tferr
tferr / Convert_Traces_to_SWC.py
Created October 27, 2016 17:26 — forked from mhl/Convert_Traces_to_SWC.py
Batch convert Simple Neurite Tracer's .traces files to SWC format
import os
import re
from tracing import PathAndFillManager
# An example script showing how to convert all the .traces
# files in a directory to SWC files. (The .traces format
# is the native file format of Simple Neurite Tracer.)
def run():
d = IJ.getDirectory("Choose your directory of .traces files...")
// yet another multichannel profile plotter
// with smart(?) lookuptables
Stack.getDimensions(w, h, c, z, t);
p = getProfile();
getStatistics(null, null, min, max);
Plot.create("Multi-Channel Profile Plot", "Distance (pixels)", "Value");
Plot.setLimits(0,p.length,min,max);
for (i=1;i<=c;i++) {
Stack.setChannel(i);