Skip to content

Developer Notes

Johan van der Meer edited this page Oct 8, 2017 · 1 revision

rtQC Developers' notes

Section 1

Hi everyone, please try to document any changes/additions you make in this online document. As far as I know, it is possible to edit it while it is open by multiple users and the changes appear in real-time. Just in case, please keep an additional copy offline.

Following our discussions, we arrived at the arrangement of starting with the functions and once we have something worth sharing with others, discuss what aspects should be organized as a GUI, preferably (as Johan suggested) in EEGlab style, where a user’s workflow can be documented in the history and then turned into a script.

We have a number of modules to develop, mostly based on procedures and scripts that we have already applied for the purposes of our own studies. On top of this we may also utilize existing functions from other open-source toolboxes while making them easier to call with standard parameters suitable for real-time QC (e.g. AQUA, CAT12, BAX etc). So, as a first step of ensuring compatibility lets use a structure called rtQC to store all the data and information.

Whenever one of us creates a function or adds a field to the data structure, please visit this document and make appropriate entries similar to the following example. Ideally, we would like these entries to be so well-written that they can automatically turn into the manual when we are done. Over the next few days, please add here a provisional description of what you are aiming to contribute so we may keep track and avoid duplicate efforts.

Note: these are just propositions for getting started. If you think we should organize in an alternative way, let’s please discuss this next Thursday.

Section 2

Example 1: Contributing a function

Function name: rtQC_xtc2nii

Description: This function converts data acquired from the Philips XTC real-time export module (PAR/REC files) to Nifti format.

Usage: rtNII_volume = rtQC_xtc2nii(xtc_ParRec_volume, template_volume)

Arguments, inputs and outputs:

xtc_ParRec_volume ~ Realtime volume dumped by XTC in Par/Rec format

template_volume ~ a volume acquired using the same scanning sequence that is used as reference to complete missing header attributes

rtNII_volume ~ typical nii file you can readily use in SPM or other software, corresponding exactly to what you would have gotten if you had exported the data offline into dicom and then converted it to nii using dcm2nii from MRIcro.

Special notes: not applicable

Dependencies: dcm2nii from MRIcro

Contributors: Stavros

Example 2: Adding a field to the rtQC structure

Field name: rtQC.rtData

Description: This field holds the raw real-time data in a 4D matrix. The 1st dimension is X, the 2nd is Y, the 3rd is Z and the 4th is time, according to the “SPM NIfTI voxel space”.

Modifiable by: This field can be modified by the following functions: rtQC_xtc2nii ; rtQC_read_data ….

Special notes: not applicable

Section 3

List of proposed modules/functions (PLEASE ADD MORE AS NECESSARY)

rtQC_log_timing Times latency between TTL scanner pulse (send during acquisition of 1st slice of each volume) and image availability for real-time processing. Must work for all types of possible TTL communication (USB, serial, parallel). Calculates mean latency, range and standard deviation for entire sequence. Current developers: Stavros

rtQC_validate_realtime_analysis Performs a validation of the real-time analysis implemented by comparing it to offline SPM, BAX and others. Can be done via correlating timeseries or comparing t-maps. Current developers: Susanne/Stavros for correlating timeseries; Lydia for comparing t-maps

rtQC_validate_acquisition Performs a validation of the real-time acquisition obtained using our standard audiovisual and motor paradigm (see section 4). This will be based on rtQC_validate_analysis where different data will be subjected to the same analysis. Current developers: Same as rtQC_validate_analysis

rtQC_simulate_data Produces a simulated timeseries from an ROI (and possibly later from each voxel). Current developers: Susanne

rtQC_id_artifacts Identifies artifacts based on AQUA metrics by comparing each volume to reference data (e.g. the preceding volumes or volumes from a reference/good acquisition using the same sequence). Can get rid of spikes and weird volumes. It can also provide metrics of overall data quality, decomposed into movement metrics, signal metrics … Current developers: Johan

rtQC_check_scanner Wrapper script for simplified AQUA scanner QC using a phantom to check for drifts and signal degradation. Ideally should be ran once a day or before a series of real-time acquisitions. Current developers: Johan

rtQC_correct_field_distortion (provisional feature – subject to successful implementation) Corrects field distortion volume by volume in real-time. Current developers: Johan/Stavros

rtQC_correct_movement (provisional feature – subject to successful implementation) Performs better movement correction than spm_realign, volume by volume in real-time. Current developers: Susanne/Stavros

rtQC_standard_analysis Performs a standard analysis (e.g. BAX) for the audiovisual and motor paradigm data and if possible for other datasets specified by a design file and ROI.

rtQC_compare_data Compares online and offline versions of same dataset. Current developers: Stavros

Section 4

Audiovisual and motor paradigm

The paradigm serves to provide a reference for all real-time experiments by performing the double role of:

a) allowing to validate any lab/scanner setup. By using the paradigm to acquire real-time data in any lab and apply one of the standard procedures (e.g. BAX), one can ensure that everything works as expected with regards to the data acquisition. This is accomplished by comparing the results of the acquisition(s) with the reference results of our paper (also available in Matlab variables downloadable with the toolbox). This comparison is automated via the function rtQC_validate_acquisition

b) allowing to validate the real-time analysis procedure of any lab/researcher. By applying any given analysis procedure to the example data from our task (which will be downloadable with the toolbox) a comparison of the performance of the analysis procedure will be possible, with reference to the other available/standard analyses (e.g. BAX; see Box 2 & Figure 3 from the paper draft). This comparison is automated via the function rtQC_validate_analysis

Clone this wiki locally