Currently coreMRI is based on .mat files (MATLAB files). The .mat file of the pulse sequence should include the following variables:

**dt**: is the temporal step of the MR simulation experiment (in sec)

**N_pulse**: it holds the number of the total timesteps of the pulse sequence

**pulse_sequence**: it is an [8xN_pulse] matrix. The first row (pulse_sequence(1,:)) holds the time sequence of the magnitude of the RF events (B1), the second row (pulse_sequence(2,:)) holds the time sequence of the phase of the RF events (RFP), the third row (pulse_sequence(3,:)) holds the time sequence of the frequency of the RF events (RFfreq), the fourth row (pulse_sequence(4,:)) holds the time sequence of the gradients on the x axis, the fifth row (pulse_sequence(5,:)) holds the time sequence of the gradients on the y axis and the sixth row (pulse_sequence(6,:)) holds the time sequence of the gradients on the z axis. The last two rows are identical and each one is an array with increasing number from 1 to N_pulse (pulse_sequence(7,:) = 1:N_pulse and pulse_sequence(8,:) = 1:N_pulse). The last two rows are being used by an algorithm that allows for compression of the pulse sequence in order to accelerate the MR simulations.

B1 is given in T (Tesla), RFP is given in radians, RFfreq is given in Hz and gradients are given in T/m (Tesla per meter).

**soft_crushers**: it is an array of 0s or 1s and of size [1xN_pulse]. This array is pointing out when a nullification of the transverse components of the magnetization should be induced. It is being used to avoid the introduction of strong gradients in the pulse sequence.

**isInKspace**: it is an array of non-zero elements with incrementing values for the time points when the receiver is ON. When the receiver is OFF, the corresponding time-points are 0. For example, given that thedt=0.000001 sec (1μsec), if the receiver turns ON from the timepoint 4μsec till the timepoint 6μsec, then it turns OFF from the timepoint 7μsec till the timepoint 8μsec and then turns ON again from the timepoint 9μsec till the timepoint 15μsec the isInKspace array will be [0,0,0,1,2,3,0,0,4,5,6,7,8,9,10]

**Extra parameters:**

**info**: it is a structure array that holds information for the pulse sequence and for the reconstruction.

The user can further accelerate the performance of simulations by "compressing" the pulse sequence through the reduction of the total number of discrete time-steps. Before you upload your pulse sequence on coreMRI, run the MATLAB function coreMRI_qMR_pulse_optimization() and save your pulse sequence with the matrices and variables extracted from this function. Follow these steps:

- Load the pulse sequence in MATLAB
- Download the MATLAB function coreMRI_qMR_pulse_optimization (click HERE) and save it into the MATLAB working directory
- Execute the following command in the command window:

[pulse_sequence, times_fitting_single_point, soft_crushers, N_pulse] = coreMRI_qMR_pulse_optimization(pulse_sequence, times_fitting_single_point, soft_crushers, N_pulse);
- Save the variables found in the workspace under a new .mat file
- Upload the newly created .mat file to coreMRI

Currently coreMRI is based on .mat files (MATLAB files). All the coordinates are given in the Device Coordinate System (DCS). The .mat file should include the following variables:

**dt**: is the temporal step of the MR simulation experiment (in sec)

**N_pulse**: it holds the number of the total timesteps of the pulse sequence

**pulse_sequence**: it is an [8xN_pulse] matrix. The first row (pulse_sequence(1,:)) holds the time sequence of the magnitude of the RF events (B1), the second row (pulse_sequence(2,:)) holds the time sequence of the phase of the RF events (RFP), the third row (pulse_sequence(3,:)) holds the time sequence of the frequency of the RF events (RFfreq), the fourth row (pulse_sequence(4,:)) holds the time sequence of the gradients on the x axis, the fifth row (pulse_sequence(5,:)) holds the time sequence of the gradients on the y axis and the sixth row (pulse_sequence(6,:)) holds the time sequence of the gradients on the z axis. The last two rows are identical and each one is an array with increasing number from 1 to N_pulse (pulse_sequence(7,:) = 1:N_pulse and pulse_sequence(8,:) = 1:N_pulse). The last two rows are being used by an algorithm that allows for compression of the pulse sequence in order to accelerate the MR simulations (read more here CODE\fast-algorithm).

B1 is given in T (Tesla), RFP is given in radians, RFfreq is given in Hz and gradients are given in T/m (Tesla per meter).

**times_fitting_single_point**: it is an array of the timepoints for which the MR signal will be recorded in the database/dictionary of the simulated signals (for example the times_fitting_single_point = [1000, 2000, 3000, 4000, 5000] will record the simulated MR signal for timepoints 1000, 2000, 3000, 4000 and 5000. For a dt=0.000001 sec (1μsec), the simulated MR signal will be recorded for t = 1msec, 2msec, 3msec, 4msec and 5msec.)

**soft_crushers**: it is an array of 0s or 1s and of size [1xN_pulse]. This array is pointing out when a nullification of the transverse components of the magnetization should be induced. It is being used to avoid the introduction of strong gradients in the pulse sequence.

**Extra parameters:**

**gamma**: the gyromagnetic ratio in Hz/T. For example, the gyromagnetic ratio for the hydrogen nucleus is 42560000 Hz/T.

**coordCenterSlice_mm**: it is a [1x3] array that holds the center of the slice in millimeters.

**normalVectorSlice**: it is a [1x3] array that holds the normal vector of the slice. For example, a transversal slice would have a normalVectorCenterSlice equal to [0,0,1] in the DCS.