Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocerrone committed Oct 9, 2024
1 parent 44d05fc commit 95bc9a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
11 changes: 9 additions & 2 deletions docs/notebooks/basic_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"roi_table = ngff_image.table.get_table(\"FOV_ROI_table\")\n",
"\n",
"print(f\"{roi_table.list_field_indexes=}\")\n",
"print(f\"{roi_table.get_roi(\"FOV_1\")=}\")\n",
"print(f\"{roi_table.get_roi('FOV_1')=}\")\n",
"\n",
"roi_table.table"
]
Expand Down Expand Up @@ -175,6 +175,13 @@
"print(f\"{new_ngff_image.num_levels=}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -199,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions docs/notebooks/processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"# - calculate the MIP\n",
"# - set the data in the MIP image\n",
"for roi in roi_table.list_rois:\n",
" print(f\" - Processing ROI {roi.infos.get(\"field_index\")}\")\n",
" print(f\" - Processing ROI {roi.infos.get('field_index')}\")\n",
" patch = source_image.get_array_from_roi(roi)\n",
" mip_patch = patch.max(axis=1, keepdims=True)\n",
" mip_image.set_array_from_roi(patch=mip_patch, roi=roi)\n",
Expand Down Expand Up @@ -162,7 +162,7 @@
"\n",
"roi_list = []\n",
"for roi in roi_table.list_rois:\n",
" print(f\" - Processing ROI {roi.infos.get(\"field_index\")}\")\n",
" print(f\" - Processing ROI {roi.infos.get('field_index')}\")\n",
" roi.z_length = 1 # In the MIP image, the z dimension is 1\n",
" roi_list.append(roi)\n",
"\n",
Expand Down Expand Up @@ -243,7 +243,7 @@
"print(\"Source image loaded with shape:\", source_image.shape)\n",
"\n",
"# Get a ROI table\n",
"roi_table = mip_ngff.table.get(\"FOV_ROI_table\")\n",
"roi_table = mip_ngff.table.get_table(\"FOV_ROI_table\")\n",
"print(\"ROI table loaded with\", len(roi_table.list_rois), \"ROIs\")\n",
"\n",
"# Find the DAPI channel\n",
Expand All @@ -255,8 +255,8 @@
"# - set the data in segmentation image\n",
"max_label = 0\n",
"for roi in roi_table.list_rois:\n",
" print(f\" - Processing ROI {roi.infos.get(\"field_index\")}\")\n",
" patch = source_image.array_from_roi(roi, c=dapi_idx)\n",
" print(f\" - Processing ROI {roi.infos.get('field_index')}\")\n",
" patch = source_image.get_array_from_roi(roi, c=dapi_idx)\n",
" segmentation = otsu_threshold_segmentation(patch, max_label)\n",
"\n",
" # Add the max label of the previous segmentation to avoid overlapping labels\n",
Expand Down Expand Up @@ -303,7 +303,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 95bc9a4

Please sign in to comment.