comparison tomo.py @ 33:afb612b64f26 draft

"planemo upload for repository https://github.com/rolfverberg/galaxytools commit c566c32f7c1506ab271ae08eb14a2982ee511938"
author rv43
date Tue, 19 Apr 2022 14:59:12 +0000
parents b1f92b63f84c
children 63de912323e5
comparison
equal deleted inserted replaced
32:b1f92b63f84c 33:afb612b64f26
1457 def genTomoStacks(self, galaxy_param=None, num_core=None): 1457 def genTomoStacks(self, galaxy_param=None, num_core=None):
1458 """Preprocess tomography images. 1458 """Preprocess tomography images.
1459 """ 1459 """
1460 if num_core is None: 1460 if num_core is None:
1461 num_core = self.num_core 1461 num_core = self.num_core
1462 logging.info(f'num_core = {self.num_core}') 1462 logging.info(f'num_core = {num_core}')
1463 # Try loading any already preprocessed stacks (skip in Galaxy) 1463 # Try loading any already preprocessed stacks (skip in Galaxy)
1464 # preprocessed stack order for each one in stack: row,theta,column 1464 # preprocessed stack order for each one in stack: row,theta,column
1465 stack_info = self.config['stack_info'] 1465 stack_info = self.config['stack_info']
1466 stacks = stack_info['stacks'] 1466 stacks = stack_info['stacks']
1467 num_tomo_stacks = stack_info['num'] 1467 num_tomo_stacks = stack_info['num']
1541 def findCenters(self, galaxy_param=None, num_core=None): 1541 def findCenters(self, galaxy_param=None, num_core=None):
1542 """Find rotation axis centers for the tomography stacks. 1542 """Find rotation axis centers for the tomography stacks.
1543 """ 1543 """
1544 if num_core is None: 1544 if num_core is None:
1545 num_core = self.num_core 1545 num_core = self.num_core
1546 num_core = 1 1546 logging.info(f'num_core = {num_core}')
1547 logging.info(f'num_core = {self.num_core}')
1548 logging.debug('Find centers for tomography stacks') 1547 logging.debug('Find centers for tomography stacks')
1549 stacks = self.config['stack_info']['stacks'] 1548 stacks = self.config['stack_info']['stacks']
1550 available_stacks = [stack['index'] for stack in stacks if stack.get('preprocessed', False)] 1549 available_stacks = [stack['index'] for stack in stacks if stack.get('preprocessed', False)]
1551 logging.debug('Available stacks: {available_stacks}') 1550 logging.debug('Available stacks: {available_stacks}')
1552 if self.galaxy_flag: 1551 if self.galaxy_flag:
1894 def reconstructTomoStacks(self, galaxy_param=None, num_core=None): 1893 def reconstructTomoStacks(self, galaxy_param=None, num_core=None):
1895 """Reconstruct tomography stacks. 1894 """Reconstruct tomography stacks.
1896 """ 1895 """
1897 if num_core is None: 1896 if num_core is None:
1898 num_core = self.num_core 1897 num_core = self.num_core
1899 logging.info(f'num_core = {self.num_core}') 1898 logging.info(f'num_core = {num_core}')
1900 if self.galaxy_flag: 1899 if self.galaxy_flag:
1901 assert(galaxy_param) 1900 assert(galaxy_param)
1902 if not os.path.exists('center_slice_pngs'): 1901 if not os.path.exists('center_slice_pngs'):
1903 os.mkdir('center_slice_pngs') 1902 os.mkdir('center_slice_pngs')
1904 logging.debug('Reconstruct tomography stacks') 1903 logging.debug('Reconstruct tomography stacks')