pyvista.DICOMReader#

class DICOMReader(*args, **kwargs)[source]#

DICOM Reader for reading .dcm files.

This reader reads a single file or a path containing a several .dcm files (DICOM stack).

Parameters
pathstr

Path to the single DICOM (.dcm) file to be opened or the directory containing a stack of DICOM files.

Examples

Read a DICOM stack.

>>> import pyvista
>>> from pyvista import examples
>>> path = examples.download_dicom_stack(load=False)
>>> reader = pyvista.DICOMReader(path)
>>> dataset = reader.read()
>>> dataset.plot(volume=True, zoom=3, show_scalar_bar=False)
../../../_images/pyvista-DICOMReader-1_00_00.png

Methods

DICOMReader.hide_progress()

Hide the progress bar when loading the file.

DICOMReader.read()

Read data in file.

DICOMReader.show_progress([msg])

Show a progress bar when loading the file.

Attributes

DICOMReader.path

Return or set the filename or directory of the reader.

DICOMReader.reader

Return the vtk Reader object.