<commit_before>
from define_variables import *

# def return_img(mask_file,coords,data_vect):

#data_vect = np.array(data_vect)

#mask = nib.load(mask_file)

#mask_data_shape = mask.get_data().shape

# print mask_data_shape

#mask_header = mask.get_header()

#mask_affine = mask.get_affine()

# print mask_affine

# if np.any(mask.shape < np.amax(coords,axis = 0)):
# print "warning, mask shape not compatible with coords  {} {}".format(mask.shape,np.amax(coords,axis = 0))

# if coords.shape[0] < data_vect.shape[0]:
# print "warning, coords not compatible with data_vect: {} {}".format(coords.shape[0], data_vect.shape[0])

#data = np.zeros((mask.shape),dtype = data_vect.dtype)

#data[coords[:,0],coords[:,1],coords[:,2]] = data_vect

# print 'data img'
#data_img = nib.Nifti1Image(data,mask_affine,mask_header)

# return data_img


def return_data_img_from_roi_mask(roi_mask_file, data_vect):

    data_vect = np.array(data_vect)

    roi_mask = nib.load(roi_mask_file)

    roi_mask_data = roi_mask.get_data()

    roi_mask_data_shape = roi_mask.get_data().shape

    # print roi_mask_data_shape

    roi_mask_header = roi_mask.get_header()

    roi_mask_affine = roi_mask.get_affine()

    print(np.unique(roi_mask_data))<commit_msg>cleaning comments<commit_after>
from define_variables import *

def return_data_img_from_roi_mask(roi_mask_file, data_vect):

    data_vect = np.array(data_vect)

    roi_mask = nib.load(roi_mask_file)

    roi_mask_data = roi_mask.get_data()

    roi_mask_data_shape = roi_mask.get_data().shape

    # print roi_mask_data_shape

    roi_mask_header = roi_mask.get_header()

    roi_mask_affine = roi_mask.get_affine()

    print(np.unique(roi_mask_data))
{'fraction_non_alphanumeric': 0.12396694214876033, 'fraction_numerical': 0.0059031877213695395, 'mean_word_length': 5.208791208791209, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7020842', 'n_tokens_mistral': 684, 'n_tokens_neox': 685, 'n_words': 98}