NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.nicom.dicomreaders.mosaic_to_nii

Next topic

nibabel.nicom.dicomreaders.read_mosaic_dwi_dir

This Page

Reggie -- the one

nibabel.nicom.dicomreaders.read_mosaic_dir

nibabel.nicom.dicomreaders.read_mosaic_dir(dicom_path, globber='*.dcm', check_is_dwi=False)

Read all Siemens mosaic DICOMs in directory, return arrays, params

Parameters :

dicom_path : str

path containing mosaic DICOM images

globber : str, optional

glob to apply within dicom_path to select DICOM files. Default is *.dcm

check_is_dwi : bool, optional

If True, raises an error if we don’t find DWI information in the DICOM headers.

Returns :

data : 4D array

data array with last dimension being acquisition. If there were N acquisitions, each of shape (X, Y, Z), data will be shape (X, Y, Z, N)

affine : (4,4) array

affine relating 3D voxel space in data to RAS world space

b_values : (N,) array

b values for each acquisition. nan if we did not find diffusion information for these images.

unit_gradients : (N, 3) array

gradient directions of unit length for each acquisition. (nan, nan, nan) if we did not find diffusion information.