dbdicom.extensions.numpy.maximum_intensity_projection#
- dbdicom.extensions.numpy.maximum_intensity_projection(series: Series, dims=('SliceLocation', 'InstanceNumber'), axis=-1) Series [source]#
Create a maximum intensity projection along a specified dimension.
- Parameters:
- Returns:
maximum intensity projection.
- Return type:
dbicom.Series
Example
Get the MIP function from the numpy extension to dbdicom:
>>> from db.extensions.numpy import maximum_intensity_projection
Create a zero-filled array, describing 8 MRI images each measured at 3 flip angles and 2 repetition times:
>>> coords = { ... 'SliceLocation': np.arange(8), ... 'FlipAngle': [2, 15, 30], ... 'RepetitionTime': [2.5, 5.0], ... } >>> series = db.zeros((128,128,8,3,2), coords)
Create a maximum intensity projection on the slice locations and check the dimensions:
>>> mip = maximum_intensity_projection(series) >>> array = mip.pixel_values(dims=('SliceLocation', 'ImageNumber')) >>> print(array.shape) (128, 128, 8, 1)
Create a maximum intensity projection along the Slice Location axis:
>>> mip = maximum_intensity_projection(series, dims=tuple(coords), axis=0) >>> array = mip.pixel_values(dims=tuple(coords)) >>> print(array.shape) (128, 128, 1, 3, 2)
Create a maximum intensity projection along the Flip Angle axis:
>>> mip = maximum_intensity_projection(series, dims=tuple(coords), axis=1) >>> array = mip.pixel_values(dims=tuple(coords)) >>> print(array.shape) (128, 128, 8, 1, 2)
Create a maximum intensity projection along the Repetition Time axis:
>>> mip = maximum_intensity_projection(series, dims=tuple(coords), axis=2) >>> array = mip.pixel_values(dims=tuple(coords)) >>> print(array.shape) (128, 128, 8, 3, 1)