Skip to content

Commit

Permalink
Merge branch '1-developing-practical-1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rasools authored Nov 13, 2024
2 parents 58cbda5 + 09faca6 commit 73fd93d
Show file tree
Hide file tree
Showing 8 changed files with 2,030 additions and 1 deletion.
257 changes: 257 additions & 0 deletions day_1/practical_1/3D Nucleus Segmentation with Cellpose.ipynb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions day_1/practical_1/cellpose_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: cellpose_env
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- pip
- tifffile
- matplotlib
- numpy
- scikit-image
- pip:
- cellpose
Binary file not shown.
380 changes: 380 additions & 0 deletions day_1/practical_1/custom/tenx_method_nb_helper_functions.py

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions day_1/practical_1/extract_tiff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python

import tifffile

# Variable 'LEVEL' determines the level to extract. It ranges from 0 (highest
# resolution) to 6 (lowest resolution) for morphology.ome.tif
LEVEL = 2

with tifffile.TiffFile('data/xenium_2.0.0_io/morphology.ome.tif') as tif:
image = tif.series[0].levels[LEVEL].asarray()

tifffile.imwrite(
'level_'+str(LEVEL)+'_morphology.ome.tif',
image,
photometric='minisblack',
dtype='uint16',
tile=(1024, 1024),
compression='JPEG_2000_LOSSY',
metadata={'axes': 'ZYX'},
)
8 changes: 8 additions & 0 deletions day_1/practical_1/extract_tiff_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python

import tifffile

with tifffile.TiffFile('data/xenium_2.0.0_io/morphology.ome.tif') as tif:
for tag in tif.pages[0].tags.values():
if tag.name == "ImageDescription":
print(tag.name+":", tag.value)
3 changes: 2 additions & 1 deletion day_1/practical_1/imaging_based_data_analysis_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ dependencies:
- jupyterlab-system-monitor
- jupyterlab-dash
- pip
- spatialdata_plot
- spatialdata_plot
- diptest
1,350 changes: 1,350 additions & 0 deletions day_1/practical_1/practical_1_2.ipynb

Large diffs are not rendered by default.

0 comments on commit 73fd93d

Please sign in to comment.