digraph inheritancee19e6c2a35 { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "SiemensWrapper" [shape=ellipse,URL="nibabel.nicom.dicomwrappers.SiemensWrapper.html#nibabel.nicom.dicomwrappers.SiemensWrapper",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "Wrapper" -> "SiemensWrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Wrapper" [shape=ellipse,URL="nibabel.nicom.dicomwrappers.Wrapper.html#nibabel.nicom.dicomwrappers.Wrapper",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "MosaicWrapper" [shape=ellipse,URL="#nibabel.nicom.dicomwrappers.MosaicWrapper",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=14,color=dodgerblue1,style=filled,height=0.75]; "SiemensWrapper" -> "MosaicWrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
Class for Siemens mosaic format data
Mosaic format is a way of storing a 3D image in a 2D slice - and it’s as simple as you’d imagine it would be - just storing the slices in a mosaic similar to a light-box print.
We need to allow for this when getting the data and (because of an idiosyncrasy in the way Siemens stores the images) calculating the position of the first voxel.
Adds attributes:
Initialize Siemens Mosaic wrapper
The Siemens-specific information is in the csa_header, either passed in here, or read from the input dcm_data.
Parameters : | dcm_data : None or object, optional
csa_header : None or mapping, optional
n_mosaic : None or int, optional
|
---|
Get scaled image data from DICOMs
Resorts data block from mosaic to 3D
Returns : | data : array
|
---|
Notes
The apparent image in the DICOM file is a 2D array that consists of blocks, that are the output 2D slices. Let’s call the original array the slab, and the contained slices slices. The slices are of pixel dimension n_slice_rows x n_slice_cols. The slab is of pixel dimension n_slab_rows x n_slab_cols. Because the arrangement of blocks in the slab is defined as being square, the number of blocks per slab row and slab column is the same. Let n_blocks be the number of blocks contained in the slab. There is also n_slices - the number of slices actually collected, some number <= n_blocks. We have the value n_slices from the ‘NumberOfImagesInMosaic’ field of the Siemens private (CSA) header. n_row_blocks and n_col_blocks are therefore given by ceil(sqrt(n_slices)), and n_blocks is n_row_blocks ** 2. Also n_slice_rows == n_slab_rows / n_row_blocks, etc. Using these numbers we can therefore reconstruct the slices from the 2D DICOM pixel array.
Return position of first voxel in data block
Adjusts Siemens mosaic position vector for bug in mosaic format position. See dicom_mosaic in doc/theory for details.
Parameters : | None : |
---|---|
Returns : | img_pos : (3,) array
|
Return image shape as returned by get_data()