docs: def _classic_4d_to_nifti(grouped_dicoms, output_file):
      """
      This function will convert siemens 4d series to a nifti
      Some inspiration on which fields can be used was taken from
      http://slicer.org/doc/html/DICOMDiffusionVolumePlugin_8py_source.html
      """
      # Get the sorted mosaics
      all_dicoms = [i for sl in grouped_dicoms for i in sl]  # combine into 1 list for validating
      common.validate_orientation(all_dicoms)
  
      # Create mosaic block
      logger.info('Creating data block')
      full_block = _classic_get_full_block(grouped_dicoms)
  
      logger.info('Creating affine')
      # Create the nifti header info
      affine, slice_increment = common.create_affine(grouped_dicoms[0])
  
      logger.info('Creating nifti')
      # Convert to nifti
      nii_image = nibabel.Nifti1Image(full_block, affine)
      common.set_tr_te(nii_image, float(grouped_dicoms[0][0].RepetitionTime), float(grouped_dicoms[0][0].EchoTime))
      logger.info('Saving nifti to disk')
      # Save to disk
      if output_file is not None:
          nii_image.to_filename(output_file)
  
      if _is_diffusion_imaging(grouped_dicoms[0][0]):
          logger.info('Creating bval en bvec')
          bval_file = None
          bvec_file = None
          if output_file is not None:
              base_path = os.path.dirname(output_file)
              base_name = os.path.splitext(os.path.splitext(os.path.basename(output_file))[0])[0]
              logger.info('Creating bval en bvec files')
              bval_file = '%s/%s.bval' % (base_path, base_name)
              bvec_file = '%s/%s.bvec' % (base_path, base_name)
  
          bval = _create_bvals(grouped_dicoms, bval_file)
          bvec = _create_bvecs(grouped_dicoms, bvec_file)
  
          return {'NII_FILE': output_file,
                  'BVAL_FILE': bval_file,
                  'BVEC_FILE': bvec_file,
                  'NII': nii_image,
                  'BVAL': bval,
                  'BVEC': bvec,
                  'MAX_SLICE_INCREMENT': slice_increment}
  
      return {'NII_FILE': output_file,
              'NII': nii_image,
              'MAX_SLICE_INCREMENT': slice_increment}