diff --git a/scilpy/viz/backends/fury.py b/scilpy/viz/backends/fury.py index 3940dacfb..06db6d6de 100644 --- a/scilpy/viz/backends/fury.py +++ b/scilpy/viz/backends/fury.py @@ -148,7 +148,7 @@ def set_viewport(scene, orientation, slice_index, volume_shape, aspect_ratio): Ratio between viewport's width and height. """ - scene.projection('parallel') + scene.projection(proj_type='parallel') camera = initialize_camera( orientation, slice_index, volume_shape, aspect_ratio) scene.set_camera(position=camera[CamParams.VIEW_POS], @@ -162,7 +162,7 @@ def set_viewport(scene, orientation, slice_index, volume_shape, aspect_ratio): def create_scene(actors, orientation, slice_index, volume_shape, aspect_ratio, - bg_color=(0, 0, 0)): + *, bg_color=(0, 0, 0)): """ Create a 3D scene containing actors fitting inside a grid. The camera is placed based on the orientation supplied by the user. The projection mode @@ -201,7 +201,7 @@ def create_scene(actors, orientation, slice_index, volume_shape, aspect_ratio, return scene -def create_interactive_window(scene, window_size, interactor, +def create_interactive_window(scene, window_size, interactor, *, title="Viewer", open_window=True): """ Create a 3D window with the content of scene, equiped with an interactor. @@ -226,7 +226,7 @@ def create_interactive_window(scene, window_size, interactor, Object from Fury containing the 3D scene interactor. """ - showm = window.ShowManager(scene, title=title, + showm = window.ShowManager(scene=scene, title=title, size=window_size, reset_camera=False, interactor_style=interactor) diff --git a/scilpy/viz/screenshot.py b/scilpy/viz/screenshot.py index 50528db5c..346ca8b3b 100644 --- a/scilpy/viz/screenshot.py +++ b/scilpy/viz/screenshot.py @@ -127,7 +127,7 @@ def screenshot_peaks(img, orientation, slice_ids, size, mask_img=None): img.shape, size) -def compose_image(img_scene, img_size, slice_number, corner_position=(0, 0), +def compose_image(img_scene, img_size, slice_number, *, corner_position=(0, 0), transparency_scene=None, image_alpha=1.0, labelmap_scene=None, labelmap_overlay_alpha=0.7, overlays_scene=None, overlays_alpha=0.7, diff --git a/scilpy/viz/slice.py b/scilpy/viz/slice.py index ff73cc177..0df655c3e 100644 --- a/scilpy/viz/slice.py +++ b/scilpy/viz/slice.py @@ -14,7 +14,7 @@ from scilpy.viz.utils import affine_from_offset -def create_texture_slicer(texture, orientation, slice_index, mask=None, +def create_texture_slicer(texture, orientation, slice_index, *, mask=None, value_range=None, opacity=1.0, offset=0.5, lut=None, interpolation='nearest'): """ @@ -126,7 +126,7 @@ def create_contours_slicer(data, contour_values, orientation, slice_index, return contours_slicer -def create_peaks_slicer(data, orientation, slice_index, peak_values=None, +def create_peaks_slicer(data, orientation, slice_index, *, peak_values=None, mask=None, color=None, peaks_width=1.0, opacity=1.0, symmetric=False): """ diff --git a/scripts/scil_viz_fodf.py b/scripts/scil_viz_fodf.py index dfc2f2b73..e1223d265 100755 --- a/scripts/scil_viz_fodf.py +++ b/scripts/scil_viz_fodf.py @@ -156,6 +156,10 @@ def _build_arg_parser(): peaks.add_argument('--peaks_width', default=1.0, type=float, help='Width of peaks segments. [%(default)s]') + peaks.add_argument('--peaks_opacity', type=float, default=1.0, + help='Peaks opacity. 1 is opaque, 0 is transparent ' + '[%(default)s].') + peaks_scale = p.add_argument_group('Peaks scaling arguments', 'Choose ' 'between peaks values and arbitrary ' 'length.') @@ -325,11 +329,12 @@ def main(): peaks_actor = create_peaks_slicer(data['peaks'], args.axis_name, args.slice_index, - peaks_values, - mask, - args.peaks_color, - args.peaks_width, - not full_basis) + peak_values=peaks_values, + mask=mask, + color=args.peaks_color, + peaks_width=args.peaks_width, + opacity=args.peaks_opacity, + symmetric=not full_basis) actors.append(peaks_actor)