class_docstr: 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:
  
  * n_mosaic : int
  * mosaic_size : int
docstr: 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 : object
     object should allow 'get' and '__getitem__' access.  If `csa_header`
     is None, it should also be possible for to extract a CSA header from
     `dcm_data`. Usually this will be a ``dicom.dataset.Dataset`` object
     resulting from reading a DICOM file.  A dict should also work.
  csa_header : None or mapping, optional
     mapping giving values for Siemens CSA image sub-header.
  n_mosaic : None or int, optional
     number of images in mosaic.  If None, try to get this number
     from `csa_header`.  If this fails, raise an error
docstr_tok: ["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",":","object","object","should","allow","'get","'","and","'__getitem__","'","access",".","If","`","csa_header","`","is","None",",","it","should","also","be","possible","for","to","extract","a","CSA","header","from","`","dcm_data","`",".","Usually","this","will","be","a","``","dicom.dataset.Dataset","``","object","resulting","from","reading","a","DICOM","file",".","A","dict","should","also","work",".","csa_header",":","None","or","mapping",",","optional","mapping","giving","values","for","Siemens","CSA","image","sub-header",".","n_mosaic",":","None","or","int",",","optional","number","of","images","in","mosaic",".","If","None",",","try","to","get","this","number","from","`","csa_header","`",".","If","this","fails",",","raise","an","error"]
code: def __init__(self, dcm_data, csa_header=None, n_mosaic=None):
      """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 : object
         object should allow 'get' and '__getitem__' access.  If `csa_header`
         is None, it should also be possible for to extract a CSA header from
         `dcm_data`. Usually this will be a ``dicom.dataset.Dataset`` object
         resulting from reading a DICOM file.  A dict should also work.
      csa_header : None or mapping, optional
         mapping giving values for Siemens CSA image sub-header.
      n_mosaic : None or int, optional
         number of images in mosaic.  If None, try to get this number
         from `csa_header`.  If this fails, raise an error
      """
      SiemensWrapper.__init__(self, dcm_data, csa_header)
      if n_mosaic is None:
          try:
              n_mosaic = csar.get_n_mosaic(self.csa_header)
          except KeyError:
              pass
          if n_mosaic is None or n_mosaic == 0:
              raise WrapperError(
                  "No valid mosaic number in CSA header; is this really Siemens mosiac data?"
              )
      self.n_mosaic = n_mosaic
      self.mosaic_size = int(np.ceil(np.sqrt(n_mosaic)))
  
imports: import operator
  import warnings
  import numpy
  from nibabel.optpkg import optional_package
  from ..onetime import auto_attr
  from ..openers import ImageOpener
  from .None import csareader
  from .dwiparams import B2q, nearest_pos_semi_def, q2bg
label_desc: Use image node_id 1 to create a new MosaicWrapper object from inherited base classes: SiemensWrapper with example: obj = MosaicWrapper(dcm_data, csa_header, n_mosaic)