Skip to content

Commit

Permalink
changing operations to compute function
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeigh committed Feb 27, 2024
1 parent 6558e26 commit 88fe6ad
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions mantidimaging/core/operations/circular_mask/circular_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from functools import partial
from typing import TYPE_CHECKING, List, Dict
from typing import TYPE_CHECKING, List, Dict, Any

import numpy as np
import tomopy
Expand All @@ -29,7 +29,7 @@ class CircularMaskFilter(BaseFilter):
filter_name = "Circular Mask"
link_histograms = True

@staticmethod
@classmethod
def filter_func(cls,
data: ImageStack,
circular_mask_ratio=0.95,
Expand All @@ -52,7 +52,7 @@ def filter_func(cls,
return data

@staticmethod
def compute_function(i: int, arrays: List[np.ndarray], params: Dict[str, any]):
def compute_function(i: int, arrays: List[np.ndarray], params: Dict[str, Any]):
tomopy.circ_mask(arrays[0][i], axis=0, ratio=params['circular_mask_ratio'], val=params['circular_mask_value'])

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions mantidimaging/core/operations/clip_values/clip_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from functools import partial
from typing import TYPE_CHECKING, List, Dict
from typing import TYPE_CHECKING, List, Dict, Any

import numpy as np

Expand All @@ -27,7 +27,7 @@ class ClipValuesFilter(BaseFilter):
filter_name = "Clip Values"
link_histograms = True

@staticmethod
@classmethod
def filter_func(cls,
data,
clip_min=None,
Expand Down Expand Up @@ -71,7 +71,7 @@ def filter_func(cls,
return data

@staticmethod
def compute_function(i: int, arrays: List[np.ndarray], params: Dict[str, any]):
def compute_function(i: int, arrays: List[np.ndarray], params: Dict[str, Any]):
array = arrays[0][i]

clip_min = params.get('clip_min', np.min(array))
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/core/operations/crop_coords/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# SPDX - License - Identifier: GPL-3.0-or-later
from __future__ import annotations

from .crop_coords import CropCoordinatesFilter, execute_single # noqa:F401
from .crop_coords import CropCoordinatesFilter # noqa:F401

FILTER_CLASS = CropCoordinatesFilter
2 changes: 1 addition & 1 deletion mantidimaging/core/operations/crop_coords/crop_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CropCoordinatesFilter(BaseFilter):
filter_name = "Crop Coordinates"
link_histograms = True

@staticmethod
@classmethod
def filter_func(cls,
images: ImageStack,
region_of_interest: Optional[Union[List[int], List[float], SensibleROI]] = None,
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/core/operations/divide/divide.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DivideFilter(BaseFilter):
filter_name = "Divide"
link_histograms = True

@staticmethod
@classmethod
def filter_func(cls, images: ImageStack, value: Union[int, float] = 0, unit="micron", progress=None) -> ImageStack:
"""
:param value: The division value.
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/core/operations/rebin/rebin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RebinFilter(BaseFilter):
filter_name = "Rebin"
link_histograms = True

@staticmethod
@classmethod
def filter_func(cls, images: ImageStack, rebin_param=0.5, mode=None, progress=None) -> ImageStack:
"""
:param images: Sample data which is to be processed. Expects radiograms
Expand Down

0 comments on commit 88fe6ad

Please sign in to comment.