ismrmrd / siemens_to_ismrmrd

Siemens ISMRMRD converter
Other
37 stars 50 forks source link

DOI

siemens_to_ismrmrd convertor


The siemens_to_ismrmrd convertor is used to convert data from Siemens raw data format into ISMRMRD raw data format.


Dependencies:


Linux installation:

Installing dependencies:

The dependencies mentioned above should be included in most linux distributions. On Ubuntu, the user can install all required dependencies with:

$ sudo apt-get install g++ cmake git
$ sudo apt-get install libboost-all-dev xsdcxx libxerces-c-dev libhdf5-serial-dev h5utils hdf5-tools libtinyxml-dev libxml2-dev libxslt1-dev libpugixml-dev

Installing ISMRMRD:

Unpack the ismrmrd.tar.gz file or clone ISMRMRD from the repository:

$ tar -zxvf ismrmrd.tar.gz
$ git clone https://github.com/ismrmrd/ismrmrd.git

Install ISMRMRD

$ cd ismrmrd
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Set the ISMRMRD environmental variable:

$ echo "export ISMRMRD_HOME=/usr/local/ismrmrd" >> $HOME/.bash_profile
$ source $HOME/.bash_profile

Installing siemens_to_ismrmrd:

Unpack the siemens_to_ismrmrd.tar.gz file or clone siemens_to_ismrmrd from the repository:

$ tar -zxvf siemens_to_ismrmrd.tar.gz
$ git clone https://github.com/ismrmrd/siemens_to_ismrmrd.git

Install siemens_to_ismrmrd:

$ cd siemens_to_ismrmrd
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Short manual:

siemens_to_ismrmrd convertor is used to convert data from the Siemens raw data format to the ISMRMRD raw data format.

Using the convertor (basic case)

To use the convertor in the quick and simple way, the user only have to provide the Siemens dat file (option -f). Converted file will, by default, be stored in the output.h5 file.

Example of converting meas_MID00832.dat file:

$ siemens_to_ismrmrd -f meas_MID00832.dat

Using the convertor (advanced case)

There are multiple options that can be set in order to run the convertor in the more specific way. Running the convertor with no command line parameters (or using -h for help)

$ siemens_to_ismrmrd -h

will result in listing all allowed options:

Allowed options:
  -h [ --help ]           Produce HELP message
  -f [ --file ]           <SIEMENS dat file>
  -z [ --measNum ]        <Measurement number>
  -Z [ --allMeas ]        <All measurements flag>
  -M [ --multiMeasFile ]  <Multiple measurements in single file flag>
  -m [ --pMap ]           <Parameter map XML>
  -x [ --pMapStyle ]      <Parameter stylesheet XSL>
  --user-map              <Provide a parameter map XML file>
  --user-stylesheet       <Provide a parameter stylesheet XSL file>
  -o [ --output ]         <HDF5 output file>
  -g [ --outputGroup ]    <HDF5 output group>
  -l [ --list ]           <List embedded files>
  -e [ --extract ]        <Extract embedded file>
  -X [ --debug ]          <Debug XML flag>
  -F [ --flashPatRef ]    <FLASH PAT REF flag>

Important files

There are three different types of files that have important role in the process of conversion, and that the user should specify:

Embedded files

Multiple Parameter map XML and Parameter stylesheet XSL files are embedded in converter. To see the list of all the embedded files, the user should run the convertor with -l option specified:

$ siemens_to_ismrmrd -l
Embedded Files:
    IsmrmrdParameterMap.xml
    IsmrmrdParameterMap.xsl
    IsmrmrdParameterMap_Siemens.xml
    IsmrmrdParameterMap_Siemens.xsl
    IsmrmrdParameterMap_Siemens_EPI.xsl
    IsmrmrdParameterMap_Siemens_EPI_FLASHREF.xsl
    IsmrmrdParameterMap_Siemens_VB17.xml
    RadialParameterMap.xml
    SpiralParameterMap.xml
    SpiralParameterMap_MSH.xml

Any of these files can be extracted and saved locally by running the converter with -e option and specifying the file name. For example:

$ siemens_to_ismrmrd -e IsmrmrdParameterMap_Siemens.xsl
IsmrmrdParameterMap_Siemens.xsl successfully extracted.

Ways of providing XML/XSL files

There are three different ways of providing XML and XSL files to the converter:

  1. The user can choose not to provide XML and XSL files explicitly, but to use the default files that are embedded in convertor.

    $ siemens_to_ismrmrd -f meas_MID00832.dat -o resulting_file.h5

    Default XML file for Numaris/4 (VB) is: IsmrmrdParameterMap_Siemens_VB17.xml.

    Default XML file for Numaris/4 (VD+) and Numaris/X is: IsmrmrdParameterMap_Siemens.xml.

    Default XSL file for Numaris/4 is: IsmrmrdParameterMap_Siemens.xsl.

    Default XSL file for Numaris/X is: IsmrmrdParameterMap_Siemens_NX.xsl.

  2. The user can choose to use XML and XSL files from the list of embedded files. The files should be supplied using options -m and -x.

    $ siemens_to_ismrmrd -f meas_MID00832.dat -m IsmrmrdParameterMap_Siemens.xml -x IsmrmrdParameterMap_Siemens.xsl -o result.h5
  3. The user can choose to provide custom XML and/or XSL files using the --user-map and --user-stylesheet options respectively:

    $ siemens_to_ismrmrd -f meas_MID00832.dat --user-map IsmrmrdParameterMap_Siemens_modified.xml --user-stylesheet IsmrmrdParameterMap_Siemens_modified.xsl -o result.h5

For multi-measurement files, if only a single XML/XSL is provided, it is used for all measurements. A list of different XML/XSL files can also be specified for each measurement. A blank value can be used to use the default file (as above in point 1). In this example, multi-measurement file meas_MID00832.dat file has 2 measurements, with IsmrmrdParameterMap_Siemens.xml used for both measurements, IsmrmrdParameterMap_Siemens.xsl (default) for the first measurement, and IsmrmrdParameterMap_Siemens_modified for the second measurement:

$ siemens_to_ismrmrd -f meas_MID00832.dat -m IsmrmrdParameterMap_Siemens.xml --user-stylesheet ",IsmrmrdParameterMap_Siemens_modified.xsl" -o result.h5

The embedded files can be extracted from the convertor using option -e:

$ siemens_to_ismrmrd -e IsmrmrdParameterMap_Siemens.xml
$ siemens_to_ismrmrd -e IsmrmrdParameterMap_Siemens.xsl