Skip to content

Instantly share code, notes, and snippets.

View nkicg6's full-sized avatar

Nick George nkicg6

View GitHub Profile
@nkicg6
nkicg6 / fit_paths.py
Created October 30, 2019 01:08
Jython script to fit paths automatically from a traces file and image in SNT
# @SNTService sntService
# script to fit paths from previous tracing session programatically via Jython and SNT
# single threaded fitting and slow. Will refactor to multithreaded in future....
# see: https://forum.image.sc/t/fit-paths-with-simple-neurite-tracer-api/30139/
# test traces file
traces_test = "path/to/traces_file.traces"
# test img file
image_test = "path/to/image_file.tif"
@nkicg6
nkicg6 / archive.py
Last active September 20, 2020 18:03
Example python script to format and add metadata from electrophysiology experiments to an SQLite metadata table
# example script to organize and add metadata to a database
# see https://nickgeorge.net/science/organizing-scientific-metadata-with-sqlite-and-python/
# for explanation
import argparse
import os
import csv
import sqlite3
import pyabf
# extract SQLite3 data to dict example, explained in this post:
# https://nickgeorge.net/programming/python-sqlite3-extract-to-dictionary/
# run with:
# python3 extract-to-dict.py
import os
import sqlite3
import sys
def sql_data_to_list_of_dicts(path_to_db, select_query):