Beispiel #1
0
    def proc_wrapper(self, input_entry):
        ''' Wrapper for processing function using the image object
    @param input_entry: [image_number, total_images, image_object]
    @return: image object
    '''
        try:
            if self.stage == 'import':
                if self.init.params.cctbx.selection.select_only.flag_on:
                    img_object = input_entry[2]
                    img_object.import_int_file(self.init)
                else:
                    img_object = img.SingleImage(input_entry, self.init)
                    img_object.import_image()
            elif self.stage == 'process':
                img_object = input_entry[2]
                img_object.process()
            elif self.stage == 'all':
                if self.init.params.cctbx.selection.select_only.flag_on:
                    img_object = input_entry[2]
                    img_object.import_int_file(self.init)
                else:
                    img_object = img.SingleImage(input_entry, self.init)
                    img_object.import_image()
                img_object.process()
        except Exception as e:
            pass

        return img_object
def run_one_image(image, init):

    # Import image
    single_image = img.SingleImage(image, init, verbose=True)
    img_object = single_image.import_image()

    # Exit if the image does not have diffraction
    if img_object.fail == 'failed triage':
        return img_object

    # Process image
    img_object.process(single_image=True)

    return img_object
Beispiel #3
0
    def run(self):
        if self.input_type == 'image':
            img_object = img.SingleImage(self.input_entry, self.init)
            img_object.import_image()
        elif self.input_type == 'object':
            img_object = self.input_entry[2]
            img_object.import_int_file(self.init)
        else:
            img_object = None

        if self.init.params.image_conversion.convert_only:
            return img_object
        else:
            img_object.process()
            return img_object
    def run(self):
        if self.abort:
            raise Exception('IOTA: Run aborted by user')
        else:
            if self.input_type == 'image':
                img_object = img.SingleImage(self.input_entry, self.init)
                img_object.import_image()
            elif self.input_type == 'object':
                img_object = self.input_entry[2]
                img_object.import_int_file(self.init)

            if self.init.params.image_conversion.convert_only:
                return img_object
            else:
                img_object.process()
                return img_object
Beispiel #5
0
    def run(self):
        img_object = None
        if self.input_type == 'image':
            img_object = img.SingleImage(self.input_entry, self.init)
            img_object.import_image()
            print 'DEBUG: Imported image'
        elif self.input_type == 'object':
            img_object = self.input_entry[2]
            img_object.import_int_file(self.init)

        if self.init.params.image_conversion.convert_only:
            return img_object
        else:
            img_object.process()
            #result_file = os.path.splitext(img_object.obj_file)[0] + '.fin'
            #ep.dump(result_file, img_object)
            return img_object