code: def nii_ones_like(in_file, value, dtype, newpath=None):
      
      import os
      import numpy as np
      import nibabel as nb
  
      nii = nb.load(in_file)
      data = np.ones(nii.shape, dtype=float) * value
  
      out_file = os.path.join(newpath or os.getcwd(), "filled.nii.gz")
      nii = nb.Nifti1Image(data, nii.affine, nii.header)
      nii.set_data_dtype(dtype)
      nii.to_filename(out_file)
  
      return out_file
docs: Create a NIfTI file filled with ``value``, matching properties of ``in_file``