dbdicom.zeros#
- dbdicom.zeros(shape: tuple, coords: dict | None = None, **kwargs) Series [source]#
Create a DICOM series populated with zeros.
This is a convenience wrapper providing a numpy-like interface for
as_series()
.- Parameters:
- Returns:
DICOM series with zero values
- Return type:
Series
See also
Example
Create a series containing a 4-dimensional array of zeros:
>>> zeros = db.zeros((128, 128, 2, 3)) >>> zeros.print() ---------- SERIES -------------- Series 001 [New Series] Nr of instances: 6 MRImage 000001 MRImage 000002 MRImage 000003 MRImage 000004 MRImage 000005 MRImage 000006 --------------------------------
This is effectively shorthand for:
>>> array = np.zeros((128, 128, 2, 3)) >>> zeros = db.as_series(array)