Skip to content
Permalink
02f25a58e6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (21 sloc) 654 Bytes
function OPTIMA_recover_dwi2_BIDS_summer2019(myname,n_slices)
%
% copies the logfiles into BIDS format
%
% Required fields of convert_LOG_BIDS:
%
% file history:
% created M. Czisch & F. Binder 8.11.2017
% last M. Czisch 13.11.2019
% it is assumed that the first 5 volumes correspond to B0 images
cmd_str = ['cp ', myname, ' qqq.nii'];
system(cmd_str);
HeaderInfo = spm_vol('qqq.nii');
Data = spm_read_vols(HeaderInfo);
Data1 = zeros(256,256,n_slices,5);
for i=1:5
Data1(:,:,:,i) = Data(:,:,(i-1)*n_slices+1:i*n_slices);
end
figure
imagesc(squeeze(Data1(:,:,n_slices/2,2))-squeeze(Data1(:,:,n_slices/2,5)));
spm_write_vol(HeaderInfo,Data1);