From 7d0c3431dc1356ff925788396bc6d87973f90eec Mon Sep 17 00:00:00 2001 From: Felipe <fima@dtu.dk> Date: Mon, 27 May 2024 09:21:29 +0200 Subject: [PATCH] identation hotfix --- qim3d/utils/img.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qim3d/utils/img.py b/qim3d/utils/img.py index c75aa93c..13f181fa 100644 --- a/qim3d/utils/img.py +++ b/qim3d/utils/img.py @@ -61,7 +61,7 @@ def generate_volume( threshold=0.5, dtype="uint8", ): - """ + """ Generate a 3D volume with Perlin noise, spherical gradient, and optional scaling and gamma correction. Args: @@ -86,7 +86,7 @@ def generate_volume( vol = qim3d.utils.generate_volume() qim3d.viz.slices(vol, vmin=0, vmax=255) """ - + if not isinstance(final_shape, tuple) or len(final_shape) != 3: raise ValueError("Size must be a tuple") if not np.issubdtype(dtype, np.number): @@ -109,9 +109,9 @@ def generate_volume( ) / np.sqrt(3 * ((base_shape[0] / 2) ** 2)) # Generate Perlin noise and adjust the values based on the distance from the center # This creates a spherical shape with noise - volume[i][j][k] = (1 + pnoise3(i * noise_scale, j * noise_scale, k * noise_scale)) * ( - 1 - dist - ) + volume[i][j][k] = ( + 1 + pnoise3(i * noise_scale, j * noise_scale, k * noise_scale) + ) * (1 - dist) # Normalize volume = (volume - np.min(volume)) / (np.max(volume) - np.min(volume)) -- GitLab