def load_data_dictionary(self):
        """
        each slice of each subject will be loaded separately in a Slice object containing :

        - a slice id

        - the original T2star image crop around the spinal cord: im

        - a manual segmentation of the gray matter: seg

        :return slices: numpy array of all the slices of the data dictionary
        """
        # initialization
        slices = []
        j = 0
        # TODO: change the name of files to find to a more general structure
        for subject_dir in os.listdir(self.param.path_dictionary):
            subject_path = self.param.path_dictionary + '/' + subject_dir
            if os.path.isdir(subject_path):
                self.dic_data_info[subject_dir] = {'n_slices': 0, 'inverted_gm_seg': [], 'im_M': [], 'seg_M': []}

                subject_seg_in = ''
                subject_gm_seg = ''
                sct.run('mkdir ' + self.model_dic_name + '/' + subject_dir, verbose=self.param.verbose)
                for file_name in os.listdir(subject_path):
                    if 'GM' in file_name or 'gmseg' in file_name:
                        subject_gm_seg = file_name
                        '''
                        # copy of the seg image in the saved model folder
                        sct.run('cp ./' + self.param.path_dictionary + subject_dir + '/' + file_name
                                + ' ' + self.model_dic_name + '/' + subject_dir + '/' + subject_dir + '_seg.nii.gz')
                        '''
                    if file_name in 'seg_in' and 'gm' not in file_name.lower():
                        subject_seg_in = file_name
                        '''
                        # copy of the slice image in the saved model folder
                        sct.run('cp ./' + self.param.path_dictionary + subject_dir + '/' + file_name
                                + ' ' + self.model_dic_name + '/' + subject_dir + '/' + subject_dir + '_im.nii.gz')
                        '''

                im = Image(subject_path + '/' + subject_seg_in)
                seg = Image(subject_path + '/' + subject_gm_seg)

                for im_slice, seg_slice in zip(im.data, seg.data):
                    self.dic_data_info[subject_dir]['n_slices'] += 1
                    slices.append(Slice(slice_id=j, im=im_slice, gm_seg=seg_slice, reg_to_m=[]))
                    j += 1

        return np.asarray(slices)

    # ------------------------------------------------------------------------------------------------------------------
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/sct_segment_gray_matter_asman/sct_asman_old.py/ModelDictionary.load_data_dictionary/swapped operands of `in`