# HG changeset patch # User rv43 # Date 1660940216 0 # Node ID ba5866d0251d9052a2ad4399f74412507f465d80 # Parent 87a4acead65cc8b7347bfe65ca19e7d03c73e87d "planemo upload for repository https://github.com/rolfverberg/galaxytools commit 3fde3e85030608a8a4d8e59308353b0144314dfe" diff -r 87a4acead65c -r ba5866d0251d general.py --- a/general.py Thu Aug 18 15:40:59 2022 +0000 +++ b/general.py Fri Aug 19 20:16:56 2022 +0000 @@ -739,7 +739,7 @@ # Find available index range if filetype == 'tif': if not isinstance(path, str) or not os.path.isdir(path): - illegal_value(path, 'path', 'findImageRange') + illegal_value(path, 'path', 'findImageFiles') return -1, 0, [] indexRegex = re.compile(r'\d+') # At this point only tiffs @@ -762,7 +762,7 @@ paths = [os.path.join(path, f) for f in files] elif filetype == 'h5': if not isinstance(path, str) or not os.path.isfile(path): - illegal_value(path, 'path', 'findImageRange') + illegal_value(path, 'path', 'findImageFiles') return -1, 0, [] # At this point only h5 in alamo2 detector style first_index = 0 @@ -771,7 +771,7 @@ last_index = num_imgs-1 paths = [path] else: - illegal_value(filetype, 'filetype', 'findImageRange') + illegal_value(filetype, 'filetype', 'findImageFiles') return -1, 0, [] logging.debug('\nNumber of available'+name+f'images: {num_imgs}') logging.debug('Index range of available'+name+f'images: [{first_index}, '+ diff -r 87a4acead65c -r ba5866d0251d tomo_combine.py --- a/tomo_combine.py Thu Aug 18 15:40:59 2022 +0000 +++ b/tomo_combine.py Fri Aug 19 20:16:56 2022 +0000 @@ -45,8 +45,8 @@ logging.basicConfig(format=logging_format, level=level, force=True, handlers=[logging.StreamHandler()]) + logging.debug(f'config = {args.config}') logging.debug(f'input_stacks = {args.input_stacks}') - logging.debug(f'config = {args.config}') logging.debug(f'x_bounds = {args.x_bounds} {type(args.x_bounds)}') logging.debug(f'y_bounds = {args.y_bounds} {type(args.y_bounds)}') logging.debug(f'z_bounds = {args.z_bounds} {type(args.z_bounds)}') @@ -68,7 +68,7 @@ # Combined reconstructed tomography stacks galaxy_param = {'x_bounds' : args.x_bounds, 'y_bounds' : args.y_bounds, 'z_bounds' : args.z_bounds, 'output_name' : args.output_data} - logging.info(f'galaxy_param = {galaxy_param}') + logging.debug(f'galaxy_param = {galaxy_param}') tomo.combineTomoStacks(galaxy_param) # Displaying memory usage diff -r 87a4acead65c -r ba5866d0251d tomo_combine.xml --- a/tomo_combine.xml Thu Aug 18 15:40:59 2022 +0000 +++ b/tomo_combine.xml Fri Aug 19 20:16:56 2022 +0000 @@ -38,7 +38,7 @@ - + - + - - + diff -r 87a4acead65c -r ba5866d0251d tomo_reconstruct.py --- a/tomo_reconstruct.py Thu Aug 18 15:40:59 2022 +0000 +++ b/tomo_reconstruct.py Fri Aug 19 20:16:56 2022 +0000 @@ -18,7 +18,7 @@ parser.add_argument('-c', '--config', help='Input config') parser.add_argument('--center_offsets', - required=True, nargs=2, type=float, help='Reconstruction center axis offsets') + nargs=2, type=float, help='Reconstruction center axis offsets') parser.add_argument('--output_config', help='Output config') parser.add_argument('--output_data', @@ -41,8 +41,8 @@ logging.basicConfig(format=logging_format, level=level, force=True, handlers=[logging.StreamHandler()]) + logging.debug(f'config = {args.config}') logging.debug(f'input_stacks = {args.input_stacks}') - logging.debug(f'config = {args.config}') logging.debug(f'center_offsets = {args.center_offsets} {type(args.center_offsets)}') logging.debug(f'output_config = {args.output_config}') logging.debug(f'output_data = {args.output_data}') @@ -56,12 +56,22 @@ raise ValueError('Invalid config file provided.') logging.debug(f'config:\n{tomo.config}') + # Set reconstruction center axis offsets + if args.center_offsets is None: + find_center = tomo.config.get('find_center') + if find_center is None: + raise ValueError('Invalid config file provided (missing find_center).') + center_offsets = [float(find_center.get('lower_center_offset')), + float(find_center.get('upper_center_offset'))] + else: + center_offsets = args.center_offsets + # Load preprocessed image files tomo.loadTomoStacks(args.input_stacks) # Reconstruct tomography stacks - galaxy_param = {'center_offsets' : args.center_offsets, 'output_name' : args.output_data} - logging.info(f'galaxy_param = {galaxy_param}') + galaxy_param = {'center_offsets' : center_offsets, 'output_name' : args.output_data} + logging.debug(f'galaxy_param = {galaxy_param}') tomo.reconstructTomoStacks(galaxy_param) # Displaying memory usage diff -r 87a4acead65c -r ba5866d0251d tomo_reconstruct.xml --- a/tomo_reconstruct.xml Thu Aug 18 15:40:59 2022 +0000 +++ b/tomo_reconstruct.xml Fri Aug 19 20:16:56 2022 +0000 @@ -9,7 +9,9 @@ $__tool_directory__/tomo_reconstruct.py -i '$red_stacks' -c '$config' - --center_offsets $center_offsets.lower_center_offset $center_offsets.upper_center_offset + #if str($center_offsets.type_selector) == "offsets_manual" + --center_offsets $center_offsets.lower_center_offset $center_offsets.upper_center_offset + #end if --output_data 'output_data.npz' --output_config 'output_config.yaml' -l '$log' @@ -17,10 +19,17 @@ -
- - -
+ + + + + + + + + + +
@@ -28,7 +37,7 @@ - + - +