Skip to content

SyneRBI/siemens_to_ismrmrd

 
 

Repository files navigation

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.


Dependancies:


Linux instalation:

Installing dependancies:

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

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>
  -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:

  • Siemens dat file:

    This is the file that is being converted. The user should supply it using the option -f. Siemens dat file can be a VB file of a VD file. In case of VD file that contains multiple measurements, the user can specify which measurement to convert by using the option -z. The default value for the option z is 1.

    In this example, the user is converting second measurement from the meas_MID00832.dat file and storing the result in the resulting_file.h5 file

    $ siemens_to_ismrmrd -f meas_MID00832.dat -o resulting_file.h5 -z 2
  • Parameter map XML file:

    This file is used to extract all parameters from the Siemens file measurement header buffer and to put them in the XML structured file (xml_raw.xml). File xml_raw.xml can be extracted and viewed by the user by running the convertor in the debug mode (option -X).

    $ siemens_to_ismrmrd -f meas_MID00832.dat -o resulting_file.h5 -X
  • Parameter stylesheet XSL file:

    This is a stylesheet file that defines parameters that are usefull for the ISMRMRD header. It is applied on the xml_raw.xml file. After the stylesheet is applied, resulting XML file (processed.xml) is used to create ISMRMRD header. File processed.xml can also be extracted if using the convertor in the debug mode.

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 the VB scan is: IsmrmrdParameterMap_Siemens_VB17.xml.
    Default XML file for the VD scan is: IsmrmrdParameterMap_Siemens.xml.
    Default XSL file is: IsmrmrdParameterMap_Siemens.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 extract embedded files from the convertor (option -e)

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

    to modify them and to supply modified files (options --user-map and --user-stylesheet)

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

About

Siemens ISMRMRD converter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 70.2%
  • XSLT 27.4%
  • CMake 2.4%