Skip to content

Commit

Permalink
Merge pull request #1077 from CHrlS98/bf-visualize-fodf
Browse files Browse the repository at this point in the history
BF for asymmetric peaks
  • Loading branch information
arnaudbore authored Dec 17, 2024
2 parents 00f9303 + cb5fd80 commit 86675da
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions scilpy/viz/backends/fury.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scilpy/viz/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions scilpy/viz/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
"""
Expand Down Expand Up @@ -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):
"""
Expand Down
15 changes: 10 additions & 5 deletions scripts/scil_viz_fodf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 86675da

Please sign in to comment.