Skip to content

Commit

Permalink
#5 Added down to scale 8 to use the on-disk diffusion for debugging p…
Browse files Browse the repository at this point in the history
…urposes.
  • Loading branch information
carljohnsen committed Apr 11, 2024
1 parent 30026cf commit 7cde694
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/processing_steps/0900_generate_gauss_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,21 @@ def gauss_kernel(sigma):

kernel = gauss_kernel(sigma_voxels)

if scale < 4:
if scale <= 8:
# Dump the mask
masks_dir = f"{binary_root}/masks/{scale}x"
pathlib.Path(masks_dir).mkdir(parents=True, exist_ok=True)
input_path = f"{masks_dir}/{sample}-implant_solid.{np.dtype(np.uint8).name}"
output_path = f"{output_dir}/{sample}.{np.dtype(np.uint8).name}"
output_path = f"{output_dir}/{sample}.{np.dtype(result_type).name}"
write_slice(implant_mask.astype(np.uint8), input_path, (0,0,0), implant_mask.shape)

gigabyte = 1024**3
gigabyte_internal = gigabyte / np.dtype(internal_type).itemsize
n_layers = int(np.floor((1 * gigabyte_internal) / (ny*nx)))
n_layers = min(n_layers, nz)
if scale == 8:
n_layers = nz // 2 + 1
else:
gigabyte = 1024**3
gigabyte_internal = gigabyte / np.dtype(internal_type).itemsize
n_layers = int(np.floor((1 * gigabyte_internal) / (ny*nx)))
n_layers = min(n_layers, nz)

if verbose >= 1:
print(f"Repeated Gauss blurs ({reps} iterations, sigma_voxels={sigma_voxels}, kernel length={kernel.shape} coefficients)")
Expand Down

0 comments on commit 7cde694

Please sign in to comment.