Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mzouink committed Oct 23, 2024
1 parent 5690eda commit 8c74991
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions docs/source/notebooks/minimal_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@

# %%
datasplit = datasplit_config.datasplit_type(datasplit_config)
viewer = datasplit._neuroglancer()
# viewer = datasplit._neuroglancer()

# %%
config_store.store_datasplit_config(datasplit_config)
Expand Down Expand Up @@ -351,14 +351,10 @@
for snapshot in range(num_snapshots):
snapshot_it = snapshot * run_config.trainer_config.snapshot_interval
# break
raw = zarr.open(
f"/Users/pattonw/dacapo/example_run/snapshot.zarr/{snapshot_it}/volumes/raw"
)[:]
target = zarr.open(
f"/Users/pattonw/dacapo/example_run/snapshot.zarr/{snapshot_it}/volumes/target"
)[0]
raw = zarr.open(f"{run_path}/snapshot.zarr/{snapshot_it}/volumes/raw")[:]
target = zarr.open(f"{run_path}/snapshot.zarr/{snapshot_it}/volumes/target")[0]
prediction = zarr.open(
f"/Users/pattonw/dacapo/example_run/snapshot.zarr/{snapshot_it}/volumes/prediction"
f"{run_path}/snapshot.zarr/{snapshot_it}/volumes/prediction"
)[0]
c = (raw.shape[1] - target.shape[1]) // 2
ax[snapshot, 0].imshow(raw[raw.shape[0] // 2, c:-c, c:-c])
Expand All @@ -371,6 +367,8 @@
# Visualize validations
import zarr

run_path = config_store.path / run_config.name

num_validations = run_config.num_iterations // run_config.validation_interval
fig, ax = plt.subplots(num_validations, 4, figsize=(10, 2 * num_validations))

Expand All @@ -383,14 +381,10 @@
dataset = run.datasplit.validate[0].name
validation_it = validation * run_config.validation_interval
# break
raw = zarr.open(
f"/Users/pattonw/dacapo/example_run/validation.zarr/inputs/{dataset}/raw"
)[:]
gt = zarr.open(
f"/Users/pattonw/dacapo/example_run/validation.zarr/inputs/{dataset}/gt"
)[0]
pred_path = f"/Users/pattonw/dacapo/example_run/validation.zarr/{validation_it}/ds_{dataset}/prediction"
out_path = f"/Users/pattonw/dacapo/example_run/validation.zarr/{validation_it}/ds_{dataset}/output/WatershedPostProcessorParameters(id=2, bias=0.5, context=(32, 32, 32))"
raw = zarr.open(f"{run_path}/validation.zarr/inputs/{dataset}/raw")[:]
gt = zarr.open(f"{run_path}/validation.zarr/inputs/{dataset}/gt")[0]
pred_path = f"{run_path}/validation.zarr/{validation_it}/ds_{dataset}/prediction"
out_path = f"{run_path}/validation.zarr/{validation_it}/ds_{dataset}/output/WatershedPostProcessorParameters(id=2, bias=0.5, context=(32, 32, 32))"
output = zarr.open(out_path)[:]
prediction = zarr.open(pred_path)[0]
c = (raw.shape[1] - gt.shape[1]) // 2
Expand Down

0 comments on commit 8c74991

Please sign in to comment.