File Exchange

image thumbnail

ReadPhilipsScanPhys​Log(filename, channels, skipprep)

version 1.2.0.1 (6.24 KB) by Paul Groot
ReadPhilipsScanPhysLog.m reads Philips scanphyslog files, which are created by Philips MRI scanners.

4 Downloads

Updated 30 Jun 2020

View License

This function can be used to load header information and data samples from Philips scanner logfiles. It can load all data available in the file, or only selected channels. In addition to the raw data, a special marker table will be returned which contains indexing information of all detected events in the marker channel.
Examples:
D = ReadPhilipsScanPhysLog('SCANPHYSLOG20110420142406.log');
Reads all physiological channels and marker flags. The marker index
information will automatically put into D.M and D.I.
D = ReadPhilipsScanPhysLog('SCANPHYSLOG20110420142406.log',{'v1','v2','resp'});
Reads both artefact corrected VCG and respiration channels. The marker index
information will automatically put into D.M and D.I.
D = ReadPhilipsScanPhysLog('SCANPHYSLOG20110420142406.log','none');
Ignore channels, and only load markers (i.e. DATA.C==[])

[D H] = ReadPhilipsScanPhysLog('SCANPHYSLOG20110420142406.log');
Also parses the header and stores info in H.

Use start/stop markers to extract epochs:

beginindex = D.M(find(D.M(:,1)==16),2);
endindex = D.M(find(D.M(:,1)==32),2);
epoch = D.C(beginindex:endindex,:);

However, the start marker is not properly synchronized with the onset of the
first volume. As a workaround you could use the end-marker and real duration of
the scan and calculate the start index yourself:

freq=496; % for wireless or 500Hz for older wired VCG systems
TR=2.3;
nrvolumes=200;
endindex = D.M(find(D.M(:,1)==16),2);
beginindex = endindex - nrvolumes * TR * freq;
epoch = logdata.C(beginindex:endindex,:);

Compatibility
Developed and tested with Matlab R2009a (7.8.0) - Windows 64-bit.
bitand behavior was changed in Version 7 (R14), so you might have
compatibility issues with release before R14.

Cite As

Paul Groot (2020). ReadPhilipsScanPhysLog(filename, channels, skipprep) (https://www.mathworks.com/matlabcentral/fileexchange/42100-readphilipsscanphyslog-filename-channels-skipprep), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Baashaas

The sampling frequency is actually 496.03 Hz!

Amir Eissa

Thank you for this work.
How do I import a .raw Philips file?
Alternatively, what is the best way to save k-space data from a Philips scanner to import it into Matlab ?

Updates

1.2.0.1

Updated comments with remark about different sampling rates for wired and wireless VCG systems

1.2.0.0

Fixed a typo that caused format errors in R2014b+

1.2.0.0

Uploaded the updated script.

1.1.0.0

2014-12-22: Added a few new markers that are available in the newer scanner releases.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux