def main(fname_in, freedom_degree,file_output):

    img = nib.load(fname_in)
    data = img.get_data()

    sigma, mask = piesno(data, N=freedom_degree, return_mask=True)

    sct.printv('\nWrite NIFTI volumes...')
    output_name = file_output
    nib.save(nib.Nifti1Image(mask, img.get_affine(), img.get_header()), output_name)
    sct.printv('\n.. The noise standard deviation is sigma = ' + str(sigma))

# START PROGRAM
# ==========================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/sct_dmri_create_noisemask.py/main/original