def load_level(self, level_image):
        if isinstance(level_image, Image):
            nz_coord = level_image.getNonZeroCoordinates()
            for i_level_slice, level_slice in enumerate(level_image.data):
                nz_val = []
                for coord in nz_coord:
                    if coord.x == i_level_slice:
                        nz_val.append(level_slice[coord.y, coord.z])
                try:
                    self.target[i_level_slice].set(level=int(round(sum(nz_val)/len(nz_val))))
                except ZeroDivisionError:
                            sct.printv('WARNING: No level label for slice ' + str(i_level_slice) + ' of target', self.model.param.verbose, 'warning')
                            self.target[i_level_slice].set(level=0)
        elif isinstance(level_image, str):
            self.target[0].set(level=get_key_from_val(self.model.dictionary.level_label, level_image.upper()))

    # ------------------------------------------------------------------------------------------------------------------
Adds (creates) user using form data.
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/sct_segment_gray_matter_asman/2015-08-17-full_scripts_before_cleaning/sct_asman.py/TargetSegmentationPairwise.load_level--crossover with--dataset/ETHPy150Open idlesign/django-sitegate/sitegate/signup_flows/base.py/SignupFlow.add_user