# HG changeset patch # User rv43 # Date 1679420436 0 # Node ID 0891477bcb16e61eb3f11b2b68b2786e17ed1c9c # Parent fbbd829383036f17e8896e1f5ab5359f9df14d93 planemo upload for repository https://github.com/rolfverberg/galaxytools commit f8c4bdb31c20c468045ad5e6eb255a293244bc6c-dirty diff -r fbbd82938303 -r 0891477bcb16 run_tomo_reduce --- a/run_tomo_reduce Tue Mar 21 16:47:44 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -#!/bin/bash - -# From workflow -#python -m workflow run_tomo -i sobhani-3249-A.yaml -o sobhani-3249-A_reduce.nxs -n 48 -s 'only' --reduce_data -#python -m workflow run_tomo -i tenstom_1304r-1_one_stack.yaml -o tenstom_1304r-1_one_stack_reduce.nxs -n 48 -s 'only' --reduce_data -#python -m workflow run_tomo -i tenstom_1304r-1.yaml -o tenstom_1304r-1_reduce.nxs -n 48 -s 'only' --reduce_data - -# As Galaxy tool: -python tomo_reduce.py -i "../../../Tomo/sobhani-3249-A_start.nxs" -o sobhani-3249-A_reduce.nxs --log_level INFO -l tomo.log --galaxy_flag --img_x_bounds -1 -1 -#python tomo_reduce.py -i tenstom_1304r-1_one_stack_start.nxs -o tenstom_1304r-1_one_stack_reduce.nxs --log_level INFO -l tomo.log --galaxy_flag #--img_x_bounds 582 1509 -#python tomo_reduce.py -i tenstom_1304r-1_start.nxs -o tenstom_1304r-1_reduce.nxs --log_level INFO -l tomo.log --galaxy_flag #--img_x_bounds 713 1388 diff -r fbbd82938303 -r 0891477bcb16 tomo_find_center.xml --- a/tomo_find_center.xml Tue Mar 21 16:47:44 2023 +0000 +++ b/tomo_find_center.xml Tue Mar 21 17:40:36 2023 +0000 @@ -17,7 +17,7 @@ -
+
diff -r fbbd82938303 -r 0891477bcb16 tomo_reconstruct.xml --- a/tomo_reconstruct.xml Tue Mar 21 16:47:44 2023 +0000 +++ b/tomo_reconstruct.xml Tue Mar 21 17:40:36 2023 +0000 @@ -12,12 +12,22 @@ --center_file "$center_file" --output_file "output.nex" --galaxy_flag + --x_bounds $x_bounds.low $x_bounds.upp + --y_bounds $y_bounds.low $y_bounds.upp -l "$log" ]]> +
+ + +
+
+ + +
diff -r fbbd82938303 -r 0891477bcb16 tomo_reduce.xml --- a/tomo_reduce.xml Tue Mar 21 16:47:44 2023 +0000 +++ b/tomo_reduce.xml Tue Mar 21 17:40:36 2023 +0000 @@ -11,16 +11,25 @@ --input_file "$input_file" --output_file "output.nex" --galaxy_flag - --img_x_bounds $img_x_bounds.low $img_x_bounds.upp + #if str($img_bounds.type_selector) == "enter_range" + --img_x_bounds $img_bounds.low $img_bounds.upp + #end if -l "$log" ]]> -
- - -
+ + + + + + + + + + +
diff -r fbbd82938303 -r 0891477bcb16 workflow/run_tomo.py --- a/workflow/run_tomo.py Tue Mar 21 16:47:44 2023 +0000 +++ b/workflow/run_tomo.py Tue Mar 21 17:40:36 2023 +0000 @@ -517,10 +517,10 @@ y_bounds = self.test_config.get('y_bounds') z_bounds = None elif self.galaxy_flag: - if x_bounds is not None and not is_int_pair(x_bounds, ge=0, + if x_bounds is not None and not is_int_pair(x_bounds, ge=-1, lt=tomo_recon_stacks[0].shape[1]): raise ValueError(f'Invalid parameter x_bounds ({x_bounds})') - if y_bounds is not None and not is_int_pair(y_bounds, ge=0, + if y_bounds is not None and not is_int_pair(y_bounds, ge=-1, lt=tomo_recon_stacks[0].shape[1]): raise ValueError(f'Invalid parameter y_bounds ({y_bounds})') z_bounds = None @@ -887,11 +887,6 @@ # Select image bounds title = f'tomography image at theta={round(theta, 2)+0}' - if img_x_bounds is not None: - if is_int_pair(img_x_bounds) and img_x_bounds[0] == -1 and img_x_bounds[1] == -1: - img_x_bounds = None - elif not is_index_range(img_x_bounds, ge=0, le=first_image.shape[0]): - raise ValueError(f'Invalid parameter img_x_bounds ({img_x_bounds})') if nxentry.instrument.source.attrs['station'] in ('id1a3', 'id3a'): pixel_size = nxentry.instrument.detector.x_pixel_size # Try to get a fit from the bright field @@ -993,6 +988,8 @@ if self.galaxy_flag: if img_x_bounds is None: img_x_bounds = (0, first_image.shape[0]) + elif not is_index_range(img_x_bounds, ge=0, le=first_image.shape[0]): + raise ValueError(f'Invalid parameter img_x_bounds ({img_x_bounds})') else: quick_imshow(first_image, title=title) print('Select vertical data reduction range from first tomography image')