VBM8マニュアル 日本語版

VBMをされている方ならばChristian Gaserが開発しているVBM-toolsについて聞き及んだことがあると思います。
彼の許可を得て、このたびVBM8のマニュアルを訳しました。
訳がこなれていないところはありますが、英語を読むのがつらい方には多少はお役に立つかと。
それにしても、この世界にいる方々はみんな親切で協力的です。とてもありがたいことですね。

VBM8日本語マニュアルをダウンロード

*21/Aug/2013 リンク先をChristian Gaserのページに変更しました。
縦断解析の行列のところに修正がかかっています。
修正版をダウンロードしてご使用いただけたらと思います。
ご指摘いただいたM先生ありがとうございました。

VBMチュートリアル日本語版

これまで日本語でのVBMのドキュメントは非常に限られたものでした。
いいものが出てこないかなと思っていましたが、なかなか出てこないので、思い切って自分で日本語のドキュメントを作成してみました。といっても他の方々の協力をたくさん得てですが。

オリジナルは2010年5月にEdinburghで開催されたSPM couseのVBMクラスで使われた資料です。John Ashburner氏がSPMのメーリングリストで公開されていましたので、Johnから翻訳の承認をもらったうえで、翻訳しました。翻訳を助けてくださった高橋先生、草稿に目を通してくださってアドバイスをくださった松尾先生に感謝いたします。

興味のある方は以下のリンクからPDFをダウンロードしてみてください。

VBMチュートリアル日本語版

SPMのセットアップ方法

包括型脳科学研究推進支援ネットワークで、2011年1月16日に、ワークショップ「精神疾患の画像研究スタートアップ」が行われました。

私がそこで参加者の皆様にお配りしたSPMのセットアップに関しての手引きに関していくつかリクエストをいただいたので公開します。

SPMのセットアップに困っている方々のお役に立つかもしれません。

SPMのセットアップ方法をダウンロード

Introduction to SPM statistics 日本語版 (SPM統計入門)

私がSPMについて学び始めたころ、SPMの統計のところについての入門書的なリソースがないか探していた時に、Matthew Brett氏のIntroduction to SPM statisticsに出会いました。1999年に書かれたものなので、SPM96とSPM99を対象に書かれていますが、原則は同じですので、今でも十分に役立ちます。SPMの統計の基本を学びたい方にとっては必読と思います。

このたび、Matthew Brett氏から許可を得て日本語に翻訳しました。SPMの日本語リソースがまだまだ少ない中、お役に立てれば幸いです。

SPM統計入門(PDF)をダウンロード

AC-PC line

AC-PCラインについて聞かれることが時々あるので、BrainMapping.org Wikiの1ページを簡単に訳すことにします。僕はこのページでAC-PCについて勉強しました。

下に示すのは、Chris Rordenによって描かれた脳の矢状断のイラストです。前交連(anterior commissure; AC)は赤で示され、後交連(posterior commissure; PC)が黄色で示されています。Talairachのアトラスによると、公式には、AC-PCラインは、図に示すように、ACの上端から出発し、PCの真ん中を通ります。

これをMNI標準脳で示したものが以下になります。ACは赤線が交叉するところになります。

J. Talairach and P. Tournoux, “Co-planar Stereotaxic Atlas of the Human Brain: 3-Dimensional Proportional System – an Approach to Cerebral Imaging”, Thieme Medical Publishers, New York, NY, 1988

Run SPM2, SPM5, and SPM8 concurrently

Many SPMers use different versions of SPM. We can run different versions of SPM in one computer, but we need to set MATLAB path carefully.

I had some discussion with Volkmar Glauche and Guillaume Flandin, who kindly gave me advice how to write the script for running diferrent spms.

Below is the scripts which enables us to run SPM2, SPM5, and SPM8 concurrently.

  1. make a directory where you want to save scripts. (e.g. ~/spm_paths/)
  2. add the directory to the path in Matlab. (File -> Set Path -> Add path)
  3. put spm_rmpath.m in SPM2 folder.
  4. You find this file in SPM5 or SPM8 directory. You can just copy it from SPM5/8 to SPM2 directory.

  5. write scripts to run spm2, spm5, and spm8
  6. suppose your spm2, spm5, and spm8 directories are “/usr/local/spm2″, “/usr/local/spm5″, and “/usr/local/spm8″. (change the pathname to your circumstance)

    %%%%%%%%%%%%%%% spm2.m
    % remove spm path
    while true
    try, spm_rmpath; catch break; end
    end
    % add spm2 path
    addpath /usr/local/spm2;
    % run spm2
    spm;

    %%%%%%%%%%%%%%% spm5.m
    % remove spm path
    while true
    try, spm_rmpath; catch break; end
    end
    % add spm5 path
    addpath /usr/local/spm5;
    % run spm5
    spm;

    %%%%%%%%%%%%%%% spm8.m
    % remove spm path
    while true
    try, spm_rmpath; catch break; end
    end
    % add spm8 path
    addpath /usr/local/spm8;
    % run spm8
    spm;

    (Of course you can add any paths you like between “addpath /usr/local/spm/spm2/5/8″
    and “spm”)

  7. save these scripts in the directory ~/spm_paths/
  8. In a matlab window, type “spm2″
  9. In another matlab window, type “spm5″
  10. In another matlab window, type “spm8″

Now you can run different versions of SPM concurrently.

Matlab script for automatic AC-PC setting in SPM5, 8, or 12

ON 17 Oct 2008, Carlton Chu posted a nice script to SPM mailing list.
Though it doesn’t have any response from the list, I find it very useful, so I introduce the script on my blog.

The purpose of the script is simple: Set AC-PC automatically for you!

Though it takes time (around 5 minutes per subject in my circumstance), It’s so much time-saving for me who have more than 1000 subjects which I need to realign.

If you are interested, try the following script. It works for SPM5 and later (SPM8 or 12).

In the original post, function which calls select files window was commented out. I uncommented it and it runs without any problems.


function auto_reorient(p)
spmDir=which('spm');
spmDir=spmDir(1:end-5);
tmpl=[spmDir 'canonical/avg152T1.nii'];
vg=spm_vol(tmpl);
flags.regtype='rigid';
p=spm_select(inf,'image');
for i=1:size(p,1)
f=strtrim(p(i,:));
spm_smooth(f,'temp.nii',[12 12 12]);
vf=spm_vol('temp.nii');
[M,scal] = spm_affreg(vg,vf,flags);
M3=M(1:3,1:3);
[u s v]=svd(M3);
M3=u*v';
M(1:3,1:3)=M3;
N=nifti(f);
N.mat=M*N.mat;
create(N);
end

Usage: Download the file below, put the file into the SPM5, 8, or 12 directory, and run “auto_reorient” from Matlab window.

auto_reorient.m

Note on Bounding Box

Here I have an MRI data with the following parameters;


Vox dim: 91 109 91
Vox size: 2x2x2 mm
Origin: 46 64 37

Now I want to change the image into this;


Vox dim: 157 189 156
Vox size: 1x1x1 mm
Origin: 79 113 71

How can we set the Bounding Box?
As a result of trial and error, I got this.


[-78 -112 -70; 78 76 85]

Simple way to calculate this is the following;


Vox dim – Origin = positive value.

  • 157-79=78 <– positive value in X
  • 189-113=76 <– positive value in Y
  • 156-71=85 <– positive value in Z


-(Vox dim – positive value -1) = negative value

  • -(157-78-1)=-78 <– negative value in X
  • -(189-76-1)=-112 <– negative value in Y
  • -(156-85-1)=-70 <– negative value in Z

誰も教えてくれないBounding Boxの話

画像解析をするとBounding Boxという言葉にぶつかります。 Bounding Boxは何か?と調べると、

画像データをResliceするときの範囲。

といった表現は見つかりますが、それ以外に見つかりません。 さらに、SPMなどでは、Bounding Boxの設定の項目を見ると、

-90:90 -126:90 -72:108

なんて表現にぶつかる一方で、

-90 -126 -72; 90 90 108

なんて表現にもぶつかったりします。

で、いろいろ考えてみたらたいしたことはありませんでした。Bounding Boxとは、画像の中心を[0, 0, 0]と仮定したとき、画像がx, y, z軸方向にどれだけあるのかという情報のようです。

つまり、-90:90 -126:90 -72:108は、

x軸は中心から左右ともに90まで、y軸は前方には90、後方に126、z軸は上方に108、下方に72の範囲で画像がありますよ

という意味になります。ちょっとすっきりしました。