Skip to content

Instantly share code, notes, and snippets.

View kouichi-c-nakamura's full-sized avatar

Kouichi C. Nakamura kouichi-c-nakamura

View GitHub Profile
@kouichi-c-nakamura
kouichi-c-nakamura / activateHyperlinks.vba
Last active October 10, 2022 17:52
Taken from this site https://www.extendoffice.com/documents/excel/4321-excel-activate-hyperlinks.html with a modification (`xTitleId` had to be declared in advance). Copy this into a Module in VBA editor. Make a selection of a range on a spreadsheet. And then press F5.
@kouichi-c-nakamura
kouichi-c-nakamura / CEDS64ChanList.m
Last active June 12, 2019 11:21
CEDS64ChanList MATLAB function returns a table of channels in the Spike2 data file specified by a handle fhand.
function T = CEDS64ChanList(fhand)
% CEDS64ChanList returns a table of channels in the Spike2 data file
% specified by a handle fhand.
%
% SYNTAX
% T = CEDS64ChanList(fhand)
%
%
% INPUT ARGUMENTS
% fhand integer
@kouichi-c-nakamura
kouichi-c-nakamura / removeFCVartifactForFreya.s2s
Created May 10, 2019 15:37
Removal of large FCV artefact online using TTL puses in CED Spike2
'removeFCVartifactForFreya.s2s
' See onskel.zip at http://ced.co.uk/downloads/scriptspkmeth
''
'it contains toolbar to enable the user to open
' a new data file for sampling and start and stop sampling.
'It displays the log view at the botton of the screen to place
' values in that the user may wish to extract
'All on-line analysis should be placed in the idle routine
'
'Note this script is UNDER DEVELOPMENT BY CED and is included for
@kouichi-c-nakamura
kouichi-c-nakamura / writeMapAnnotation.m
Created January 28, 2019 14:55
A modified writeMapAnnotation.m to support Java gateway as input
function ma = writeMapAnnotation(session, keys, values, varargin)
% WRITEMAPANNOTATION Create and upload a map annotation onto OMERO
%
% ma = writeMapAnnotation(session, keys, values) creates and uploads a
% map annotation owned by the session user containing one or multiple
% key/value pair(s). The keys and values input must be either strings or
% cell arrays of strings with the same number of elements.
%
% ma = writeMapAnnotation(session, keys, values, 'description',
% description) also specifies the description of the map annotation.
@kouichi-c-nakamura
kouichi-c-nakamura / Edit_LineData_ROIs_in_OMERO.m
Created January 28, 2019 10:58
MATLAB code of editing ROIs using Java Gateway. See Discussion here: https://www.openmicroscopy.org/community/viewtopic.php?f=4&t=8666
%% use Java Gateway from MATLAB
host = 'xxxxxxx.xxxx.xxxxx';
userName = 'XXXXXXXX';
password = inputdlg('password:');
password = password{1};
[gateway,user,cred] = loadOmeroGateway(userName, password, host) % https://gist.github.com/kouichi-c-nakamura/c8d335bfe45ee15e3bd86771a8578596
%% Retrieve the list of ROIs attached to an image in a dataset
function fac = getGatewayFacility(gateway,classname)
% getGatewayFacility is a MATLAB function to be used with OMERO Java
% Gateway.
%
% in Java, the following code returns the XxxxxFacility object fac.
% XxxxxFacility fac = gateway.getFacility(XxxxxFacility.class)
%
% However, running the same code in MATLAB requires special handling and
% this functions does that for you. For more details, see
% https://docs.openmicroscopy.org/latest/omero/developers/Java.html
@kouichi-c-nakamura
kouichi-c-nakamura / bfTiffComment.m
Last active November 19, 2018 15:33
bfTiffComment allows you to extract, inject, indent or validate OME-XML embeeded in an OME-TIFF file or an XML file.
function [xml, res] = bfTiffComment(imgfile, varargin)
% bfTiffComment allows you to extract, inject, indent or validate OME-XML
% embeeded in an OME-TIFF file or an XML file.
%
% SYNTAX
% xml = bfTiffComment(imgfile)
% xml = bfTiffComment(xmlfile)
% xml = bfTiffComment(xmlstr)
% [xml,res] = bfTiffComment(____,'Param',value)
%
function [gateway,user,cred] = loadOmeroGateway(userName, password, host, varargin)
% loadOmeroGateway opens a connection to an OMERO server using Java gateway
% (https://docs.openmicroscopy.org/latest/omero/developers/Java.html#gatewayconnect).
%
% SYNTAX
% [gateway,user,cred] = loadOmeroGateway(userName, password, host)
% [gateway,user,cred] = loadOmeroGateway(userName, password, host, port)
%
%
% INPUT ARGUMENTS
@kouichi-c-nakamura
kouichi-c-nakamura / Society for Neuroscience Abstract 2016.js
Last active October 16, 2017 21:34
A Zotero translator for SfN (Society for Neuroscience) Meeting Planner ref: http://qiita.com/kouichi-c-nakamura/items/cec0830f381bfa91668d
{
"translatorID": "1ed36c21-de68-4ba4-a27f-d724ce258db4",
"label": "Society for Neuroscience Abstract 2016",
"creator": "Kouchi C. Nakamura, PhD; kouichi.c.nakamura@gmail.com",
"target": "^https?://www\\.abstractsonline\\.com/pp8/#!/\\d+/presentation/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
@kouichi-c-nakamura
kouichi-c-nakamura / the-journal-of-neuroscience-doi.csl
Last active October 16, 2017 21:27
Useful CSL style definition for adding reference to email etc with DOI link or URL of each article. ref: http://qiita.com/kouichi-c-nakamura/items/148816cc95ecca426a65
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="expanded" default-locale="en-US">
<!-- This style was edited with the Visual CSL Editor (http://editor.citationstyles.org/visualEditor/) -->
<info>
<title>The Journal of Neuroscience-DOI</title>
<id>http://www.zotero.org/styles/the-journal-of-neuroscience-doi</id>
<link href="http://www.zotero.org/styles/the-journal-of-neuroscience-doi" rel="self"/>
<link href="http://www.zotero.org/styles/harvard-cite-them-right" rel="template"/>
<link href="http://www.jneurosci.org/site/misc/ifa_organization.xhtml#References" rel="documentation"/>
<author>