10. File formats
imgfile: This is a MATLAB v7.3 (HDF5).matfile that stores multicontrast MRI images. It contains four variables:data,resolution,spatial_dimandtransform.Variable name
Dimension/example & details
dataThis variable contains the multidimensional MR image as a matrix of following dimension
– \(N_a \times N_1 \times N_2 \times N_3\) (for 3D volume): Each \(N_3\) slice is processed sequentially
– \(N_a \times N_1 \times N_2\) (for 2D volume)
\(N_a\): number of acquired multicontrast MRI images
\(N_i\): \(i\)-th spatial dimension (\(i=1,2,3\))
resolution[vox_dim_1 vox_dim_2 vox_dim_3]
vox_dim_i: pixel dimension along i-th spatial dimension
spatial_dimA vector storing the spatial dimension values
– [N1 N2 N3] or [N1 N2]
\(N_i\): \(i\)-th spatial dimension
Spatial dimension can’t be 1D
transform4 x 4 transform matrix
spatmaskfile: This is a MATLAB v7.3 (HDF5).matfile that contains contains a binary spatial mask variableim_mask.Variable name
Dimension/example & details
im_maskThis variable contains the spatial mask for the MRI images. This matrix takes binary values - 1 indicates the spatial locations that should be considered, and 0 indicates the spatial location that are excluded. Notice that the spatial dimensions for the MRI images must match with the dimension of the mask.
– \(N_1 \times N_2 \times N_3\) (for 3D volume)
– \(N_1 \times N_2\) (for 2D volume)
\(N_i\): \(i\)-th spatial dimension (\(i=1,2,3\))
spect_infofile: This is a MATLAB v7.3 (HDF5) .mat file containing variables that define the spectral parameters and dictionary matrix for spectroscopic image estimation. This contains variableKand a structure array variableaxes(array dimension defined by the number of spectral dimension) with fields described below:Variable name
Dimension/example & details
KThis variable defines the dictionary for spectroscopic image estimation. The matrix dimension should match the following convention, e.g.,
– \(N_a \times M_1 \times M_2\) (for 2D spectra)
– \(N_a \times M_1\) (for 1D spectra)
\(N_a\): number of acquired multicontrast images
\(M_p\): The number of spectral parameter gridpoints along the \(p\)th spectral dimension.
spectral_dimA vector storing the spectral dimension values: – \([M_1 \; M_2 \; \cdots \; M_P]\) for \(P\)-dimensional spectrum \(M_i\): \(i\)-th spectral dimension.
axes(p).sampleThis stores a vector array of spectral parameter gridpoints for \(p\)th spectral dimension, which should correspond to how the dictionary
Kwas created. It should be a vector of dimension \(M_p \times 1\).axes(p).nameThis is a string variable defined by user to name the \(p\)th spectral dimension. e.g., if the user is interested in \(T_2\) relaxation data, then this value could be the string
"T_2".axes(p).unitThis is a string variable defined by user to store the units for the \(p\)th spectral dimension.
axes(p).spacingIf the dictionary is constructed using linear or logarithmic spacing of the parameter gridpoints, then this variable should be set to one of the following strings:
"linear","log"(case sensitive).
configfile: This is a.inifile consisting of parameters for the algorithm.Variable name
Dimension/example & details
solver.namestring variable denoting the name of the algorithm user wants to implement. Can only be one of the following strings -
"LADMM","ADMM","NNLS". Note that if the string is"NNLS", then the followingconfigvariables are redundant.solver.num_iterThis stores an integer value denoting the number of iteration to run for (L)ADMM algorithm. Its is a required input. If this is set to a low value, the solver may not converge to global minima, and the result may not look as expected.
solver.betaThis is the (L)ADMM parameter. Takes a floating point number as input. Its a required input for (L)ADMM algorithm. This value tunes the convergence speed, but does not change the converged solution.
solver.save_interThis stores an integer value denoting the iteration interval to show progress for Spectrum Estimation tool and to save intermediate cost function values for the beta calculation tool.
– Default value,
solver.num_iter/10.solver.tolThis is a floating point value denoting the tolerance level of min-normalised succesive error. If the calculated tolerance as described below, is lower than
solver.tol, then the solver stops execution.– For \(ij\)-th iteration, its calculated as, \(\frac{\|spectrum_{ij}-spectrum_{(i-1)j}\|}{min(\|spectrum_{ij}\|,\|spectrum_{(i-1)j}\|)}\), where \(j=\)
solver.save_interand \(i=2,3,...\).– Default value, \(10^{-5}\).
– Note that if
solver.save_interis very low value, that the two spectra of interest may not change much, then also thissolver.tolvalue might be reached but the result may not actually converge to the actual solution. So the user need to keep a balance between these two variables.solver.check_tolThis stores an integer value denoting iteration number after which the tolerance value is checked. This is due to the reason that, when we start the estimated spectrum does not significantly change, so we want the solver to reach to some iteration, after which the we check the tolerance.
– Default value,
solver.num_iter/2.low_rank.flagThis takes binary value, 1 if user wants to use low rank approximation of the dictionary matrix,
K. This significantly increases the speed of convergence. Also, note that, this is used only forLADMMalgorithm.low_rank.rankAn integer value depicting the rank of the approximated matrix form of the K tensor. This value is ignored if
low_rank.flagis 0. Note that on this documentation the dictionary is in a tensor form. To Approximate the rank, you need to flatten all the spectral dimension of the tensor and create a matrix of dimension \(N_a \times M_1M_2\) (for 2D spectra) or \(N_a \times M_1\) (for 1D spectra). Then you need to choose the approximate rank of the resulted matrix.dc_compTakes either 1 or 0 as input.
lambdaSpatial-Regulariser value. Take floating point number as input.
spect_imagefile: This is a MATLAB v7.3 (HDF5).matfile storing an estimated spectroscopic image.Variable name
Dimension/example & details
spectral_imageThis matrix variable stores the spectroscopic image. The matrix dimension should match the following convention, e.g.,
– \(M_1 \times M_2 \times \cdots \times M_P \times N_1 \times N_2 \times N_3\) (for \(P\)-Dimensional spectrum and 3D volume)
– \(M_1 \times M_2 \times N_1 \times N_2\) (for 3-Dimensional spectrum and 2D volume)
Note: In this variable, spectral dimension is followed by spatial dimension.
spectral_dimA vector storing the spectral dimension values:
– \([M_1 \; M_2 \; \cdots \; M_P]\) for \(P\)-dimensional spectrum
\(M_i\): \(i\)-th spectral dimension.
spatial_dimA vector storing the spatial dimension values:
– \([N_1 \; N_2 \; N_3]\) or \([N_1 \; N_2]\) or \([N_1]\)
\(N_i\): \(i\)-th spatial dimension.
axes(k).sampleFor \(k=1,2,\cdots,P\): stores a vector array of spectral sample points of the \(k\)-th spectral dimension. It should be a vector of dimension \(M_k \times 1\). This variable is directly passed from the input with a similar name. For \(k=P+1,\cdots\) it is an empty vector.
axes(k).typeA string variable taking value either
"spectral"or"spatial"depending on the \(k\)-th dimension of the spectroscopic image.axes(k).nameA string variable denoting the name of the \(k\)-th dimension of the spectroscopic image. Note: For spatial dimensions, the first spatial dimension is automatically assigned the name
"x"followed by"y","z".axes(k).unitA string variable denoting the unit for the \(k\)-th dimension of the spectroscopic image. For spatial dimensions, its value is always
"mm".axes(k).spacingThe spacing between the sample points of the \(k\)-th dimension of the spectroscopic image. For spatial dimensions, its value is always
"linear".resolution\([vox\_dim_1 \; vox\_dim_2 \; vox\_dim_3]\) where \(vox\_dim_i\) is the pixel dimension along the \(i\)-th spatial dimension.
transformA \(4 \times 4\) transform matrix.
spectmaskfile: This is a MATLAB v7.3 (HDF5).matfile that stores binary spectral masks for use in visualizing microstructural component maps.Variable name
Dimension/example & details
num_compThis variable contain the total number of discrete components chosen (\(=N_c\)).
spec_maskThis variable contains the spectral mask. For \(c\)-th component, this matrix takes binary values - 1 indicates the spectral location to be summed over for that component and 0 other wise.
– \(M_1 \times M_2 \times \cdots \times M_P \times N_c\) (for :math>`P`-dimensional spectrum )
– \(M_1 \times M_2 \times N_c\) (2D spectra)
– \(M_1 \times N_c\) (1D spectra)
\(M_p\): \(p\)-th spectral dimension (\(p=1,2,3\))
color: This is the name of the.matfile that contains the color RGB values used to render component maps. It stores a single variable,color, and is used by Plot Component Maps tool.Variable name
Dimension/example & details
colorRGB triplets for each component. Values are in
[0, 1]. Rows correspond to channels and columns to \(N_c\) components:– \(3 \times N_c`\) : row 1 = R, row 2 = G, row 3 = B; column
jgives the color for componentj.