run nifti basics skl

%% NIFTI basics
% In this example, load a brain and visualize it in matlab
%
% #   For CoSMoMVPA's copyright information and license terms,   #
% #   see the COPYING file distributed with CoSMoMVPA.           #

% Set the path.
config = cosmo_config();
data_path = fullfile(config.tutorial_data_path, 'ak6', 's01');

% Set filename
fn = fullfile(data_path, 'brain.nii');

% Load with nifti
ni = load_nii(fn);

%% Show the contents of the nifti header
cosmo_disp(ni.hdr);

% print the dimensions
size(ni.img);

% plot a histogram of the intensities (use only values greater than zero)
% change the number of bins
%%%% >>> Your code here <<< %%%%
%% Plot slices
% plot a sagittal, coronal and axial slice
% at voxel positions (80,150,80) using squeeze and transpose ("'") where
% necessary.
% (bonus points for axis labels and proper orientations, i.e. in the
% sagittal view the front of the brain is on the left and the back
% is on the right)
ii = 80;
jj = 150;
kk = 80;
figure;
%%%% >>> Your code here <<< %%%%
%% Plot slice in all three dimensions
% This uses the cosmo_plot_slices helper function
slice_step = 15;
strView = {'SAG', 'COR', 'TRA'};

for dim = 1:3
    figure;
    %%%% >>> Your code here <<< %%%%
end