def get_nb_voxel_in_WM(atlas_folder, file_label):

    import sct_extract_metric
    import nibabel
    import numpy

    label_id, label_name, label_file, combined_labels_ids, combined_labels_names, combined_labels_id_groups = sct_extract_metric.read_label_file(atlas_folder, file_label)
    nb_label = len(label_file)

    # sum of all the labels
    sum_all_labels = nibabel.load(atlas_folder + label_file[0]).get_data()
    for i_label in range(1, nb_label):
        sum_all_labels = numpy.add(sum_all_labels, nibabel.load(atlas_folder + label_file[i_label]).get_data())

    # count the number of non-zero voxels
    nb_voxel_in_WM = numpy.count_nonzero(sum_all_labels)

    return nb_voxel_in_WM
Convert `obj` to (unicode) text string
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/isct_get_fractional_volume.py/get_nb_voxel_in_WM--crossover with--dataset/ETHPy150Open winpython/winpython/winpython/py3compat.py/to_text_string