Exemplo n.º 1
0
 def run_process(self):
   ''' Run indexing / integration of imported images '''
   cmd.Command.start("Processing {} images".format(len(self.img_objects)))
   self.img_list = [[i, len(self.img_objects) + 1, j] for i, j in
                     enumerate(self.img_objects, 1)]
   self.prog_count = 0
   self.gs_prog = cmd.ProgressBar(title='PROCESSING')
   self.img_objects = parallel_map(iterable=self.img_list,
                              func=self.proc_wrapper,
                              callback=self.callback,
                              processes=self.init.params.n_processors)
   cmd.Command.end("Processing {} images -- DONE "
                   "".format(len(self.img_objects)))
Exemplo n.º 2
0
  def run_import(self):
    ''' Import images or image objects '''
    if self.init.params.cctbx.selection.select_only.flag_on:
      msg = "Reading {} image objects".format(len(self.init.gs_img_objects))
      title = 'READING IMAGE OBJECTS'
      self.img_list = [[i, len(self.init.gs_img_objects) + 1, j] for i, j in
                       enumerate(self.init.gs_img_objects, 1)]
    else:
      msg = "Importing {} images".format(len(self.init.input_list))
      title = 'IMPORTING IMAGES'
      self.img_list = [[i, len(self.init.input_list) + 1, j] for i, j in
                       enumerate(self.init.input_list, 1)]

    cmd.Command.start(msg)
    self.prog_count = 0
    self.gs_prog = cmd.ProgressBar(title=title)
    self.img_objects = parallel_map(iterable=self.img_list,
                                    func=self.proc_wrapper,
                                    callback=self.callback,
                                    processes=self.init.params.n_processors)
Exemplo n.º 3
0
    def run_all(self):
        ''' Run the full processing in multiprocessing mode '''

        # Determine whether reading in image objects or images, create image list
        if self.init.params.cctbx.selection.select_only.flag_on:
            self.img_list = [[i, len(self.init.gs_img_objects) + 1, j]
                             for i, j in enumerate(self.init.gs_img_objects, 1)
                             ]
        else:
            self.img_list = [[i, len(self.init.input_list) + 1, j]
                             for i, j in enumerate(self.init.input_list, 1)]
        cmd.Command.start("Processing {} images".format(len(self.img_list)))

        # Run processing
        self.prog_count = 0
        self.gs_prog = cmd.ProgressBar(title='PROCESSING')
        self.img_objects = parallel_map(
            iterable=self.img_list,
            func=self.proc_wrapper,
            callback=self.callback,
            processes=self.init.params.n_processors)
        cmd.Command.end("Processing {} images -- DONE "
                        "".format(len(self.img_objects)))