siemens¶
Subpackages¶
Submodules¶
dicom_parser.utils.siemens.mosaic module¶
Definition of 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_image_position(iop: numpy.ndarray) Tuple[float, float, float] ¶
Returns a fixed Image Position (Patient) header field value.
- Parameters
iop (np.ndarray) – Image Orientation (Patient) header field value
References
- get_mosaic_dimensions() tuple ¶
Returns the number of rows and columns that make up the mosaic.
- Returns
n_rows, n_columns
- Return type
- get_n_images() int ¶
Returns the number of images encoded in the mosaic.
- Returns
Number of images encoded in mosaic
- Return type
- get_tile(i_row: int, i_column: int) numpy.ndarray ¶
Cut out a tile of the mosaic by row and column indices.
- get_tiles() list ¶
Cuts out the tiles (2D slices) from the mosaic.
- Returns
Tiles collected by row
- Return type
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.B_MATRIX_INDICES = array([0, 1, 2, 1, 3, 4, 2, 4, 5])¶
The raw (6, 1) vector returned represents the upper triangle of a symmetric B matrix.
- dicom_parser.utils.siemens.private_tags.b_matrix_to_q_vector(b_matrix: numpy.ndarray, tol: Optional[float] = None) numpy.ndarray ¶
Estimate q-vector from B matrix.
References
- Parameters
b_matrix (np.ndarray (3, 3)) – B matrix
- Returns
q-vector
- Return type
np.ndarray
- dicom_parser.utils.siemens.private_tags.nearest_pos_semi_def(b_matrix: numpy.ndarray)¶
Least squares positive semi-definite tensor estimation.
References
Niethammer M, San Jose Estepar R, Bouix S, Shenton M, Westin CF. On diffusion tensor estimation. Conf Proc IEEE Eng Med Biol Soc. 2006;1:2622-5. PubMed PMID: 17946125; PubMed Central PMCID: PMC2791793.
- Parameters
b_matrix (np.ndrray) – B matrix
- Returns
npds – Estimated nearest positive semi-definite array to matrix B
- Return type
(3,3) array
Examples
>>> B = np.diag([1, 1, -1]) >>> nearest_pos_semi_def(B) array([[0.75, 0. , 0. ], [0. , 0.75, 0. ], [0. , 0. , 0. ]])
- dicom_parser.utils.siemens.private_tags.parse_siemens_b_matrix(value: bytes) numpy.ndarray ¶
Parses the Siemens B matrix header field value.
- Parameters
value (bytes) – Raw B matrix header field value
- Returns
Parsed B matrix
- Return type
np.ndarray
- dicom_parser.utils.siemens.private_tags.parse_siemens_bandwith_per_pixel_phase_encode(value: bytes)¶
- 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.
- 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.