diff --git a/fury/actor.py b/fury/actor.py index 346373bc9..ef5f24175 100644 --- a/fury/actor.py +++ b/fury/actor.py @@ -1091,8 +1091,8 @@ def odf_slicer( global_cm, colormap, opacity, - affine, - B_matrix, + affine=affine, + B=B_matrix, ) diff --git a/fury/actors/odf_slicer.py b/fury/actors/odf_slicer.py index fefbd5abe..1fe075b44 100644 --- a/fury/actors/odf_slicer.py +++ b/fury/actors/odf_slicer.py @@ -2,6 +2,7 @@ import numpy as np from fury.colormap import create_colormap +from fury.decorators import warn_on_args_to_kwargs from fury.lib import Actor, PolyData, PolyDataMapper from fury.utils import ( apply_affine, @@ -51,6 +52,7 @@ class OdfSlicerActor(Actor): """ + @warn_on_args_to_kwargs() def __init__( self, odfs, @@ -64,6 +66,7 @@ def __init__( global_cm, colormap, opacity, + *, affine=None, B=None, ): @@ -122,7 +125,8 @@ def display_extent(self, x1, x2, y1, y2, z1, z2): self._update_mapper() - def slice_along_axis(self, slice_index, axis="zaxis"): + @warn_on_args_to_kwargs() + def slice_along_axis(self, slice_index, *, axis="zaxis"): """Slice ODF field at given `slice_index` along axis in ['xaxis', 'yaxis', zaxis']. """ @@ -156,16 +160,17 @@ def slice_along_axis(self, slice_index, axis="zaxis"): else: raise ValueError("Invalid axis name {0}.".format(axis)) - def display(self, x=None, y=None, z=None): + @warn_on_args_to_kwargs() + def display(self, *, x=None, y=None, z=None): """Display a slice along x, y, or z axis.""" if x is None and y is None and z is None: self.slice_along_axis(self.grid_shape[2] // 2) elif x is not None: - self.slice_along_axis(x, "xaxis") + self.slice_along_axis(x, axis="xaxis") elif y is not None: - self.slice_along_axis(y, "yaxis") + self.slice_along_axis(y, axis="yaxis") elif z is not None: - self.slice_along_axis(z, "zaxis") + self.slice_along_axis(z, axis="zaxis") def update_sphere(self, vertices, faces, B): """Dynamically change the sphere used for SH to SF projection.""" diff --git a/fury/actors/peak.py b/fury/actors/peak.py index 931f9db5d..8fb1fa98d 100644 --- a/fury/actors/peak.py +++ b/fury/actors/peak.py @@ -3,6 +3,7 @@ import numpy as np from fury.colormap import boys2rgb, colormap_lookup_table, orient2rgb +from fury.decorators import warn_on_args_to_kwargs from fury.lib import ( VTK_OBJECT, Actor, @@ -62,10 +63,12 @@ class PeakActor(Actor): """ + @warn_on_args_to_kwargs() def __init__( self, directions, indices, + *, values=None, affine=None, colors=None, @@ -210,11 +213,12 @@ def __init__( self.__cross_section = self.__high_ranges // 2 self.__mapper.AddObserver( - Command.UpdateShaderEvent, self.__display_peaks_vtk_callback + Command.UpdateShaderEvent, self.__display_peaks_vtk_callback(None, None) ) + @warn_on_args_to_kwargs() @calldata_type(VTK_OBJECT) - def __display_peaks_vtk_callback(self, caller, event, calldata=None): + def __display_peaks_vtk_callback(self, caller, event, *, calldata=None): if calldata is not None: calldata.SetUniformi("isRange", self.__is_range) calldata.SetUniform3f("highRanges", self.__high_ranges) @@ -275,7 +279,8 @@ def min_centers(self): return self.__min_centers -def _orientation_colors(points, cmap="rgb_standard"): +@warn_on_args_to_kwargs() +def _orientation_colors(points, *, cmap="rgb_standard"): """ Parameters ---------- @@ -306,7 +311,8 @@ def _orientation_colors(points, cmap="rgb_standard"): return np.asarray(col_list) -def _peaks_colors_from_points(points, colors=None, points_per_line=2): +@warn_on_args_to_kwargs() +def _peaks_colors_from_points(points, *, colors=None, points_per_line=2): """Return a VTK scalar array containing colors information for each one of the peaks according to the policy defined by the parameter colors. @@ -376,7 +382,8 @@ def _peaks_colors_from_points(points, colors=None, points_per_line=2): return color_array, colors_are_scalars, global_opacity -def _points_to_vtk_cells(points, points_per_line=2): +@warn_on_args_to_kwargs() +def _points_to_vtk_cells(points, *, points_per_line=2): """Return the VTK cell array for the peaks given the set of points coordinates.