SHARE
TWEET

Untitled

a guest May 19th, 2017 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. % Delete unwanted volumes from timeseries data (Brainvoyager, FMR format).
  2. clear all;
  3.  
  4. % Enter FMR file path and volume indices to be erased
  5. fmr_path = '/path/to/your/file.fmr';
  6. vol_erase = [50:60, 100:103];
  7.  
  8. % Load FMR (headers) and STC (data)
  9. fmr = xff(fmr_path);
  10. data = fmr.Slice.STCData(:, :, :, :);
  11.  
  12. % Remove unwanted volumes
  13. data(:, :, vol_erase, :) = [];
  14. new_NrOfVolumes = size(data, 3);
  15.  
  16. % Update fmr
  17. fmr.Slice.STCData = data;
  18. fmr.NrOfVolumes = new_NrOfVolumes;
  19.  
  20. % Save
  21. fmr.SaveAs([fmr_path(1:end-4), '_cropped.fmr']);
  22. disp('Done.')
RAW Paste Data
Top