dicom_parser.utils.siemens package

Submodules

dicom_parser.utils.siemens.mosaic module

Defines the Mosaic class that decodes the 2D encoding of 3D volumes used by Siemens. For more information read this NiBabel article or see pages 10-12 in here.

class dicom_parser.utils.siemens.mosaic.Mosaic(mosaic_array: numpy.ndarray, header: dicom_parser.header.Header)

Bases: object

A Siemens mosaic of 2D images representing a single volume.

fold() → numpy.ndarray

Folds the 2D mosaic to become a 3D volume.

Returns

3D volume

Return type

np.ndarray

get_mosaic_dimensions()tuple

Returns the number of rows and columns that make up the mosaic.

Returns

n_rows, n_columns

Return type

tuple

get_tile(i_row: int, i_column: int) → numpy.ndarray

Cut out a tile of the mosaic by row and column indices.

Parameters
  • i_row (int) – Row index

  • i_column (int) – Column index

Returns

A single tile at the (i_row, i_column) position

Return type

np.ndarray

get_tiles()list

Cuts out the tiles (2D slices) from the mosaic.

Returns

Tiles collected by row

Return type

list

get_volume_shape()tuple

Returns the dimensions of the volume that will be created.

Returns

x_dim, y_dim, z_dim

Return type

tuple

tiles_to_volume(tiles: list) → numpy.ndarray

Transforms a list of tiles to a correctly oriented volume.

Parameters

tiles (list) – List of 2D slices as parsed from the mosaic

Returns

Orientation-fixed volume

Return type

np.ndarray

dicom_parser.utils.siemens.private_tags module

Siemens specific private tags they may not be accessible by keyword using pydicom.

dicom_parser.utils.siemens.private_tags.parse_siemens_b_matrix(value: bytes)list
dicom_parser.utils.siemens.private_tags.parse_siemens_bandwith_per_pixel_phase_encode(value: bytes)
dicom_parser.utils.siemens.private_tags.parse_siemens_csa_header(value: bytes)dict
dicom_parser.utils.siemens.private_tags.parse_siemens_gradient_direction(value: bytes)list

Parses a SIEMENS MR image’s B-vector as represented in the private (0019, 100E) DiffusionGradientDirection DICOM tag.

Parameters

value (bytes) – SIEMENS private DiffusionGradientDirection data element.

Returns

Gradient directions (B-vector)

Return type

list

dicom_parser.utils.siemens.private_tags.parse_siemens_number_of_slices_in_mosaic(value: bytes)int
dicom_parser.utils.siemens.private_tags.parse_siemens_slice_timing(value: bytes)list

Parses a SIEMENS MR image’s slice timing as saved in the private (0019, 1029) MosaicRefAcqTimes tag to a list of floats representing slice times in milliseconds.

Parameters

value (bytes) – SIEMENS private MosaicRefAcqTimes data element

Returns

Slice times in milliseconds

Return type

list

Module contents

Utilities for handling Siemens DICOM data.