Skip to content

Instantly share code, notes, and snippets.

@LeeKamentsky
Created June 11, 2018 13:01
Show Gist options
  • Save LeeKamentsky/f4e5b7b7c7a10e579eb44c429b0ce647 to your computer and use it in GitHub Desktop.
Save LeeKamentsky/f4e5b7b7c7a10e579eb44c429b0ce647 to your computer and use it in GitHub Desktop.
nuggt.yea_nay example
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import tifffile\n",
"points = np.load(\"/media/im1/Lee/FromWG_GUItests/PVimages/spots_filtered.npy\")\n",
"pv = tifffile.imread(\"/media/im1/Lee/FromWG_GUItests/PVimages/PV.tif\")\n",
"syto = tifffile.imread(\"/media/im1/Lee/FromWG_GUItests/PVimages/Syto.tif\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"from nuggt.yea_nay import sort_points"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"from nuggt.utils.ngutils import green_shader, red_shader"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"http://127.0.0.1:34831/v/064fc82c720111272aeb7a90e557941c8112dfe0/\n"
]
}
],
"source": [
"yea, nay = sort_points(((pv, \"PV\", red_shader),\n",
" (syto, \"Syto\", green_shader)), points[:, ::-1])"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([[ 2, 746, 5],\n",
" [ 2, 890, 6],\n",
" [ 3, 993, 9]]), array([[ 2, 34, 33],\n",
" [ 3, 224, 30]]))"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"yea[:, ::-1], nay[:, ::-1]"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function stop in module neuroglancer.server:\n",
"\n",
"stop()\n",
" Stop the server, invalidating any viewer URLs.\n",
" \n",
" This allows any previously-referenced data arrays to be garbage collected if there are no other\n",
" references to them.\n",
"\n"
]
}
],
"source": [
"import neuroglancer\n",
"help(neuroglancer.stop)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Environment (conda_nuggt)",
"language": "python",
"name": "conda_nuggt"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment