[English]

Neuroshare.xop

Takashi KODAMA
01-Nov-2006

Download -> Neuroshare.XOP, User Manual

Neuroshareについて

近年、神経生理学の実験データは、専らデジタルデータとして保存・解析されます。しかしデータのフォーマット形式は、データ取得の際に用いたソフトウェアに依存するため、自分が使いたい解析環境(MatlabとかIgor)でデータファイルを開くことが出来ないという問題にしばしば直面します。こうした不便を解消することを目的として、Neuroshareと名付けられたワーキンググループが、様々なメーカーのデータファイル形式をある統一されたデータ形式に変換して操作するためのAPIを提供しようとしています(http://neuroshare.sourceforge.net/index.shtml)。

彼らはまず各メーカーに、自社のファイル形式のデータをNeuroshareの定めるデータ形式で読み出したり、編集したり出来るようにするAPI(DLL)を提供するように要請しました。後は提供されたDLLを自分の使いたい解析環境で利用できるように出来さえすれば、DLLがサポートする形式のファイルを自由に操作することが出来るようになります(もちろんNeuroshareが定めた仕様で)。例えて言うならば、DLLはデータファイルと解析環境の間の通訳のような役割のものです。あらゆる言語を英語に直す通訳がいれば、あとは自分が英語を理解できるようになるだけであらゆる言語でのコミニュケーションが可能になるでしょう。

また、メーカーの提供するDLLの仕様はNeuroshareによって定められているので、一度自分の解析環境でDLLを使えるようにしてしまえば、使うDLLを変えるだけで別の形式のファイルを全く同様の形式で扱うことが出来ます。これがこの方法の優れた点だと思います。

現時点(2006/11/01)でDLLを提供している会社は、

DLLのダウンロード: http://neuroshare.sourceforge.net/DLLLinks.shtml

Neuroshare.xopについて

現時点での大きな問題は、自分の使いたい解析環境において提供されたDLLを使えるようにするAPIがまだそれほど充実していないということです(上の通訳の例えで言えば、通訳はいても通訳の話す英語が理解できないという状態)。幸いにしてMatlabについては既にAPIが提供されていますので、それを参考にIgor用のAPI(XOP)を作成することが出来ました。ここに公開してあるXOPと上記のメーカーの提供するNeuroshare仕様のDLLの2つがあれば、そのメーカーの形式のファイルをIgorから操作することができます。

使用の手順

  1. Igorのインストールフォルダ内の”Igor Extensions”フォルダにNeuroshare.xopを移す
  2. 適当なメーカーのNeuroshare仕様のDLLを”NEUROSHARE.DLL”と名前を変更した後、C:\WINDOWSフォルダに移す
  3. Igorを(再)起動

正しく設定されていれば、Igorのコマンドラインに”ns_GetLibraryInfo”と入力して実行すると、NS_dwLibVersionMaj等のGlobal変数が作成されます。設定が失敗しているとエラーメッセージが出るはずです。導入された関数の具体的な使用法については”Operation Usage of NeuroShare XOP”を参照して下さい。また、このXOPを用いてデータの解析を行うにはNeuroshareのデータ仕様(4種類Entityとそれらのデータ構成など)について理解している必要がありますが、これは”Neuroshare API Specification”の”Representation of Data Types”等の項に詳しく説明があるので割愛します(http://neuroshare.sourceforge.net/standards.shtml)。

メモ

実際の解析の流れは、先ずns_GetFilePathでファイルパスを取得し、次にns_GetFileInfoとns_GetEntityInfoでファイルに含まれるEntityの番号(ID)や種類の情報を取得し、あとは各Entityの情報を適当な関数を使って読み出して解析する、という形になるでしょう。XOPで導入された関数群はIgor上で書いた自作のmacroやfunctionからでも呼べるので、解析作業を大幅に自動化することが出来るはずです。



Neuroshare.xop

About Neuroshare

Recently, experimental data in neurophysiology are directly stored in a digital form, which sometimes causes the “file-read problem”; we cannot analyze the data using our favorite software (e.g. Matlab, Igor) because the file format of the recorded data is not supported in the software. To overcome the problem, a working group named “Neuroshare” tries to provide the APIs by which we can operate data of any format types on any softwares (http://neuroshare.sourceforge.net/index.shtml).

First Neuroshare asked vendors to produce an API (DLL, in fact) which translates the data in their format into those in Neuroshare standardized format, and enable us to read the data. If you can make an appropriate API for your favorite software to use the DLL, the software can operate data of the DLL-supporting format in a Neuroshare standardized fashion. The relationship between a vendor-offering DLL and an API of analysis softwares is similar to that between an English translator and English. Given that you have an English translator who can translate any languages into English, you can communicate with people in all over the globe, only if you can use English. Because Neuroshare also standardizes the specification of the DLL, once you make the API for the analysis software, you can operate data of any types of format by swapping the DLL.

Vendors offering the DLL (2006/11/01):

DLL Download: http://neuroshare.sourceforge.net/DLLLinks.shtml

About Neuroshare.xop

A primary problem at present is that there are few APIs for analysis softwares (In the example of a translator above, this situation looks like that, although you have an English translator, you can not understand English!). Fortunately, the API for Matlab is already published, so, based on it, I could make an API for Igor, named Neuroshare.xop. Using both this XOP extension and the DLL offered by the vendor, we can operate (only read and duplicate, actually) data of the vendor’s specified format on Igor.

Install procedure (Windows)

  1. Move “Neuroshare.xop” to “Igor Extensions” folder in the Igor-installed folder
  2. Change the name of the DLL to “NEUROSHARE.DLL”, and move it to “C:\WINDOWS” folder
  3. Launch Igor

To check the success of installation, type “ns_GetLibraryInfo” in the command line of Igor, and you will obtain some global variables like “NS_dwLibVersionMaj”, if all set properly. For usage of the functions, see “Operation Usage of Neuroshare XOP”. To use this xop extension efficiently, you had better know the Neuroshare specification, which is extensively explained in “Neuroshare API Documentation” (http://neuroshare.sourceforge.net/standards.shtml: see the page of “Representation of Data Type”, and so on).

Note

In actual analysis, you first have to get the file path of the data file using ns_GetFilePath, and then get ID and type of the entities contained using ns_GetFileInfo and ns_GetEntityInfo. With the information, you can finally read and analyze the data by combining several functions. All functions offered by Neuroshare.xop can be called from user-defined macro and function in Igor, which must powerfully facilitate your analysis on Igor.