def create_line(fname, coord, nz):

    # duplicate volume (assumes input file is nifti)
    sct.run('cp '+fname+' line.nii', param.verbose)

    # set all voxels to zero
    sct.run('sct_maths -i line.nii -mul 0 -o line.nii', param.verbose)

    cmd = 'sct_label_utils -i line.nii -o line.nii -p create-add -coord '
    for iz in range(nz):
        if iz == nz-1:
            cmd += str(int(coord[0]))+','+str(int(coord[1]))+','+str(iz)+',1'
        else:
            cmd += str(int(coord[0]))+','+str(int(coord[1]))+','+str(iz)+',1:'

    sct.run(cmd, param.verbose)

    return 'line.nii'


# create_mask2d
# ==========================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/sct_create_mask.py/create_line/original