dicom2nii: DICOM 2 NII Converter with BIDS Sidecars

View source: R/pipeline_convert.R

dicom2niiR Documentation

DICOM 2 NII Converter with BIDS Sidecars

Description

Function to convert DCM to nii, including the BIDS sidecar. This is a wrapper for dcm2niix by Chris Rorden.

Usage

dicom2nii(
  dcm_folder,
  inpath = NULL,
  out_filename = "%f_%p_%t_%s",
  outpath = getwd(),
  checkLines = F,
  compressFile = "y",
  bids_sidecar = "y",
  anon = "y"
)

Arguments

dcm_folder

The folder of the DICOM file which should be converted. This can either be the whole path, or it can be the specific foldername (with the path in inpath).

inpath

Optional: this is the path of the folder which contains the folder with the DICOM files. If the full path is specified as dcm_folder, then this argument should be left.

out_filename

Filename of the output file. Preferably without file extension. Defaults to same as the input filename. Should only be the filename. Path goes into outpath. Can also be specified in terms of the dcm2niix guidelines.

outpath

Path where the output file should be placed. Defaults to the working directory.

checkLines

hould the system commands be checked (and not run)? Default FALSE.

compressFile

Should the output be compressed as a .nii.gz file? Default TRUE.

bids_sidecar

Should the BIDS sidecar json file be produced. Options are 'y', 'n' or 'o' (only).

anon

Should the BIDS sidecar be anonymised? Options are 'y' or 'n'

Value

Creates the nii and json files as desired and returns the success message.

References

https://github.com/rordenlab/dcm2niix

Examples

dicom2nii(dcm_folder, checkLines = T)

mathesong/kipettools documentation built on Feb. 5, 2024, 10:10 p.m.