docs: def _singleframe_to_nifti(grouped_dicoms, output_file):
      """
      This function will convert a philips singleframe series to a nifti
      """
  
      # Create mosaic block
      logger.info('Creating data block')
      full_block = _singleframe_to_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))
  
      if output_file is not None:
          # Save to disk
          logger.info('Saving nifti to disk %s' % output_file)
          nii_image.to_filename(output_file)
  
      if _is_singleframe_diffusion_imaging(grouped_dicoms):
          bval_file = None
          bvec_file = None
          # Create the bval en bvec files
          if output_file is not None:
              base_name = os.path.splitext(output_file)[0]
              if base_name.endswith('.nii'):
                  base_name = os.path.splitext(base_name)[0]
  
              logger.info('Creating bval en bvec files')
              bval_file = '%s.bval' % base_name
              bvec_file = '%s.bvec' % base_name
          nii_image, bval, bvec, bval_file, bvec_file = _create_singleframe_bvals_bvecs(grouped_dicoms,
                                                                                        bval_file,
                                                                                        bvec_file,
                                                                                        nii_image,
                                                                                        output_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}