Matlab R2016aでも動作するための修正版spm_figure.m

21/Oct/2016 SPM12がアップデートされました。このアップデートで下記の対処はもう必要なくなります。したがって、この記事は意味がないです。私のウェブサイトからの配布も終了します。

過日、Matlab R2016a日本語版では、SPM12を起動するときにエラーが出るという記事を投稿しました。その後、修正版spm_figure.mがあるという情報をいただき、さらに、開発者のGuillaume Flandinからも了承をいただきましたので、ここに修正版spm_figure.mを公開します。


なお、Guillaume Flandinからの情報だと、この修正は、次のSPM12のアップデートで適応されるとのこと。

A Matlab script to generate ROI masks using an Atlas in SPM12

SPM12 introduces some useful functions such as spm_atlas or new atlas “labels_Neuromorphometrics.” We find the description about labels_Neuromorphometrics in SPM12 Release note.

Maximum probability tissue labels derived from the “MICCAI 2012 Grand Challenge and Workshop on Multi-Atlas Labeling” are available in files tpm/labels Neuromorphometrics.{nii,xml}. These
data were released under the Creative Commons Attribution-NonCommercial (CC BY-NC) with no end date. Users should credit the MRI scans as originating from the OASIS project and the labeled
data as “provided by Neuromorphometrics, Inc. under academic subscription”. These references should be included in all workshop and final publications. See spm for more details about the generation of this file.

I wanted to generate masks of some regions using this labels_Neuromorphometrics.

Below is the tiny script which generates masks from your preferred atlas.
Running script brings up a file selector. You can choose any atlas you want.
Then it brings up another dialog which lists the region within the atlas. You can choose as many regions as you want, and the scripts generates masks whose file name is the name of the regions.

%This script generate mask files from any atlases you prefer.
%K. Nemoto 25 April 2015


for i = 1:size(S,2)

Download generate_masks_from_atlas.m (right click and save as)