Skip to content

Instantly share code, notes, and snippets.

@ofgulban
Last active October 31, 2019 13:56
Show Gist options
  • Select an option

  • Save ofgulban/3ed5fd784eff32594bc04bc17cab4da4 to your computer and use it in GitHub Desktop.

Select an option

Save ofgulban/3ed5fd784eff32594bc04bc17cab4da4 to your computer and use it in GitHub Desktop.
Brainvoyager's fmr format to nifti conversion.
% Convert FMR to NII
%
% Requires Neuroelf <http://neuroelf.net/>.
clear all;
% Set path with nii files
PATH_OUT = '/patt/to/output_folder';
% Set fmr names
PATH_FMR{1}=['/path/to/file1.fmr'];
PATH_FMR{2}=['/path/to/file2.fmr'];
%% Convert fmr to nii
disp('Converting fmr files to nii...')
for i=1:length(PATH_FMR);
temp_fmr = xff(PATH_FMR{i});
% Output name parsing/creating
[i_dir, i_name , i_ext] = fileparts(PATH_FMR{i});
i_ext = 'nii';
out_path = fullfile(PATH_OUT, [i_name,'.',i_ext]);
temp_fmr.Write4DNifti(out_path);
temp_fmr.ClearObject;
disp([out_path ' created.'])
end
disp('Finished.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment