Skip to content
Snippets Groups Projects

Synthetic collection generation

2 files
+ 27
23
Compare changes
  • Side-by-side
  • Inline

Files

+ 3
3
@@ -10,7 +10,7 @@ def blob(
gamma: int = 1.0,
max_value: int = 255,
threshold: float = 0.5,
auto_clip: bool = False,
smooth_borders: bool = False,
dtype: str = "uint8",
) -> np.ndarray:
"""
@@ -24,7 +24,7 @@ def blob(
gamma (float, optional): Gamma correction factor. Defaults to 1.0.
max_value (int, optional): Maximum value for the volume intensity. Defaults to 255.
threshold (float, optional): Threshold value for clipping low intensity values. Defaults to 0.5.
auto_clip (bool, optional): Flag for automatic computation of the threshold value to ensure a blob with no straight edges. If True, the `threshold` parameter is ignored. Defaults to False.
smooth_borders (bool, optional): Flag for automatic computation of the threshold value to ensure a blob with no straight edges. If True, the `threshold` parameter is ignored. Defaults to False.
dtype (str, optional): Desired data type of the output volume. Defaults to "uint8".
Returns:
@@ -93,7 +93,7 @@ def blob(
# Scale the volume to the maximum value
volume = volume * max_value
if auto_clip:
if smooth_borders:
# Maximum value among the six sides of the 3D volume
max_border_value = np.max([
np.max(volume[0, :, :]), np.max(volume[-1, :, :]),
Loading