DICOMReader#

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

DICOM Reader for reading .dcm files.

Wraps vtkDICOMImageReader.

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#

Download Python source code | Download Jupyter notebook

Read a DICOM stack.

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

Note

The example dataset is the CPTAC-SAR collection from The Cancer Imaging Archive, distributed under CC BY 3.0 and subject to the TCIA Data Usage Policy. See download_dicom_stack() for the required attribution and usage terms.

Inheritance#

Inherited members are documented on BaseReader, _FileIOBase.

See them all under Inherited Attributes and Inherited Methods.

Inherited Attributes#

_FileIOBase.extension_patterns

Return mapping from regex pattern matching associated with this class.

_FileIOBase.extensions

Return the file extensions associated with this class.

BaseReader.path

Return or set the filename or directory of the reader.

BaseReader.reader

Return the vtk Reader object.

Inherited Methods#

BaseReader.hide_progress

Hide the progress bar when loading the file.

BaseReader.read

Read data in file.

BaseReader.show_progress

Show a progress bar when loading the file.