Browse code

searchlight ready. missing nifti-image-write support. added timing to FBS

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@167 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on30/03/2009 17:54:25
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,120 @@
1
+
2
+- Examples to load, make and save a nii struct:
3
+
4
+	To load Analyze data or NIFTI data to a structure:
5
+
6
+		nii = load_nii(NIFTI_file_name, [img_idx], [old_RGB24]);
7
+
8
+	img_idx is a numerical array of image indices along the temporal
9
+	axis, which is only available in NIFTI data. After you specify 
10
+	img_idx, only those images indexed by img_idx will be loaded. If
11
+	there is no img_idx or img_idx is empty, all available images 
12
+	will be loaded.
13
+
14
+	For RGB image, most people use RGB triple sequentially for each
15
+	voxel, like [R1 G1 B1 R2 G2 B2 ...]. However, some program like
16
+	Analyze 6.0 developed by AnalyzeDirect uses old RGB24, in a way
17
+	like [R1 R2 ... G1 G2 ... B1 B2 ...] for each slices. In this
18
+	case, you can set old_RGB24 flag to 1 and load data correctly:
19
+
20
+		nii = load_nii(NIFTI_file_name, [], 1);
21
+
22
+	To get a total number of images along the temporal axis:
23
+
24
+		num_scan = get_nii_frame(NIFTI_file_name);
25
+
26
+	You can also load the header extension if it exists:
27
+
28
+		nii.ext = load_nii_ext(NIFTI_file_name);
29
+
30
+	You can just load the Analyze or NIFTI header:
31
+	(header contains: hk, dime, and hist)
32
+
33
+		hdr = load_nii_hdr(NIFTI_file_name);
34
+
35
+	You can also save the structure to a new file:
36
+	(header extension will be saved if there is nii.ext structure)
37
+
38
+		save_nii(nii, NIFTI_file_name);
39
+
40
+	To make the structure from any 3D (or 4D) data:
41
+
42
+		img = rand(91,109,91); or
43
+		img = rand(64,64,21,18);
44
+		nii = make_nii(img [, voxel_size, origin, datatype] );
45
+
46
+	Use "help load_nii", "help save_nii", "help make_nii" etc.
47
+	to get more detail information.
48
+
49
+
50
+- Examples to plot a nii struct:
51
+  (More detail descriptions are available on top of "view_nii.m")
52
+
53
+	Simple way to plot a nii struct:
54
+
55
+		view_nii(nii);
56
+
57
+	The default colormap will use the Gray if all data values are
58
+	non-negative; otherwise, the default colormap will use BiPolar.
59
+	You can choose other colormap, including customized colormap
60
+	from panel.
61
+
62
+	To imbed the plot into your existing figure:
63
+
64
+		h = gcf;
65
+		opt.command = 'init';
66
+		opt.setarea = [0.3 0.1 0.6 0.8];
67
+		view_nii(h, nii, opt);
68
+
69
+	To add a colorbar:
70
+
71
+		opt.usecolorbar = 1;
72
+		view_nii(gcf, opt);
73
+
74
+		Here, opt.command is implicitly set to 'update'.
75
+
76
+	To display in real aspect ratio:
77
+
78
+		opt.usestretch = 0;
79
+		view_nii(gcf, opt);
80
+
81
+	If you want the data value to be directly used as the index
82
+	of colormap, instead of scale to the whole colormap:
83
+
84
+		opt.useimagesc = 0;
85
+		view_nii(gcf, opt);
86
+
87
+	If you modified the data value without changing the dimension,
88
+	voxel_size, and origin, you can update the display by:
89
+
90
+		opt.command = 'updateimg';
91
+		view_nii(gcf, nii.img, opt);
92
+
93
+	If the data is completely different, display can be updated by:
94
+
95
+		opt.command = 'updatenii';
96
+		view_nii(gcf, nii, opt);
97
+
98
+
99
+- Contrast and Brightness are available under Gray and Bipolar colormap:
100
+
101
+
102
+	Increase contrast in Gray colormap will make high end values
103
+	more distinguishable by sacrificing the low end values; The
104
+	minimum contrast (default) will display the whole range.
105
+
106
+	Increase or decrease contrast in BiPolar colormap will shift
107
+	the distinguishable position for both positive and negative
108
+	values.
109
+
110
+	Increase or decrease brightness in Gray colormap will shift
111
+	the distinguishable position.
112
+
113
+	Increase or decrease brightness in BiPolar colormap will make
114
+	both positive and negative values more distinguishable.
115
+
116
+
117
+- Required files:
118
+
119
+	All files in this package.
120
+