Exporting DICOM data sets as NIFTI images

daris-dicom-export-nifti  is a command line utility included in daris-clients  package can be used to download data from DaRIS.


Install daris-clients

daris-clients need to be installed on your local computer. See this page for more details.

After daris-clients  is installed, you can find daris-dicom-export-nifti  command in daris-clients-<version>/bin directory.

Usage of daris-dicom-export-nifti

Usage of daris-download
USAGE:
  daris-dicom-export-nifti [OPTIONS] CID...

PARAMETERS:
      CID...             The cid of the DICOM dataset or the parent
                           project/subject/study.

OPTIONS:
  -c, --mf.config <mflux.cfg>
                         Mediaflux/DaRIS server configuration file. Defaults to
                           $HOME/.Arcitecta/mflux.cfg
  -f, --filter <query>   A query to select DICOM datasets.
  -d, --dir <output-directory>
                         The output directory. Defaults to current working
                           directory.
  -n, --name <output-file-name-pattern>
                         The output filename pattern. If not specified,
                           defaults to the dataset cid.
  -o, --overwrite        Overwrite files already exist.
  -g, --gzip             GZip the output NIFTI files (to *.nii.gz).
  -j, --json             Include the JSON file describes the NIFTI image.
  -h, --help             output usage information

Name Pattern

The -n  or --name option specifies the output file name pattern. It supports resolving values from DICOM header elements by using the syntax below:

[gggg,eeee] where is gggg,eeee  is the DICOM element tag, for example [0010,0020] will resolve the PatientID value from the DICOM dataset.


You can use multiple DICOM element values to compose the output filename, for example:


  • -n "[0010,0020]_A4_ULTRA_[0054,1103]_[0018,1210]_[0018,1242]_[0008,0022]" 


Examples

  • Download all DICOM data sets as NIFTI images from subject 1.5.1.3 to the current working directory.
    • daris-dicom-export-nifti 1.5.1.3
  • Download all DICOM data sets with names end with '_dyn' from subject 1.7.25.7 to ~/Downloads directory
    • daris-dicom-export-nifti -f "xpath(daris:pssd-object/name) ends with ignore-case '_dyn'" -d ~/Downloads 1.7.25.7
  • More examples with selection filters and output file name patterns:
    • daris-dicom-export-nifti -d /tmp/d2n -g -o -f "xpath(daris:pssd-object/name) ends with ignore-case '_dyn'"  -n "[0010,0020]_A4_DYN_[0054,1103]_[0018,1210]_[0018,1242]_[0008,0022]" 1.7.25.7
      daris-dicom-export-nifti -d /tmp/d2n -g -o -f "xpath(daris:pssd-object/name) ends with ignore-case '_sum'" -n "[0010,0020]_A4_SUM_[0054,1103]_[0018,1210]_[0018,1242]_[0008,0022]" 1.7.25.7
      daris-dicom-export-nifti -d /tmp/d2n -g -o -f "xpath(daris:pssd-object/name) ends with ignore-case '_sum_ultra_allpass'" -n "[0010,0020]_A4_ULTRA_[0054,1103]_[0018,1210]_[0018,1242]_[0008,0022]" 1.7.25.7