Skip to content

Commit f0dc1af

Browse files
authored
Merge pull request #3 from zoccoler/rev1
Rev1
2 parents 61ca7d1 + 6649849 commit f0dc1af

9 files changed

+506
-288
lines changed

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,50 @@ Clone this repository locally (for example using [Github Desktop](https://deskto
1313
From a command line prompt, navigate to where you cloned this repository locally (for example by typing `cd Lifetime-Separation`) and create a specific conda environment by typing the following line:
1414

1515
```bash
16-
mamba env create -f env.yml
16+
mamba env create -f env_pinned.yml
17+
```
18+
19+
## Data
20+
21+
The input raw data used by this repository can be found in the [BioImage Archive](https://www.ebi.ac.uk/biostudies/BioImages/studies/S-BIAD1967).
22+
23+
The code only needs local access to the `.zarr` and `.xml` files. Download these and place them in a folder structure like this (preferably inside the `Lifetime-Separation` local repository):
24+
25+
```
26+
Lifetime-Separation
27+
|
28+
├─ embryos_data
29+
| |
30+
| ├─ LP307_1_sptw
31+
| | |
32+
| | ├─ LP307_1_sptw.zarr
33+
| | └─ LP307_1.xml
34+
| |
35+
| |
36+
| ├─ LP307_2_sptw
37+
| | |
38+
| | ├─ LP307_2_sptw.zarr
39+
| | └─ LP307_2.xml
40+
| ⁞
41+
| # rest of the embryos data
42+
|
43+
├─ worms_data
44+
| |
45+
| ├─ AZ212_sptw
46+
| | |
47+
| | ├─ AZ212_sptw.zarr
48+
| | └─ AZ212.xml
49+
| |
50+
| |
51+
| └─ JJ1473_sptw
52+
| |
53+
| ├─ JJ1473_sptw.zarr
54+
| └─ JJ1473.xml
55+
|
56+
├─ code
57+
| |
58+
⁞ ⁞
59+
# rest of the repository code
1760
```
1861

1962
## Usage

code/phasor_plot_AZ212.ipynb

Lines changed: 31 additions & 67 deletions
Large diffs are not rendered by default.

code/phasor_plot_JJ1473.ipynb

Lines changed: 50 additions & 48 deletions
Large diffs are not rendered by default.

code/phasor_plot_analysis_batch_processing.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from napari_flim_phasor_plotter.filters import apply_binning
1111
from napari_flim_phasor_plotter._reader import read_stack
12-
from napari_flim_phasor_plotter._widget import make_flim_phasor_plot, manual_label_extract, smooth_cluster_mask
12+
from napari_flim_phasor_plotter.widgets import make_flim_phasor_plot, manual_label_extract, smooth_cluster_mask
1313

1414
from utilities import ellipse_vertices, format_metadata, set_plot_zoom_position, add_segmentation_metadata
1515
import time
@@ -23,9 +23,9 @@
2323
# Inputs
2424

2525
# Main folder path (each folder contains a zarr file and an xml file)
26-
main_folder_path = Path("/home/pol_haase/mazo260d/Data/I227_Lifetime_Unmixing_of_Dyes_with_Overlapping_Sprectra/Batch_Processing")
26+
main_folder_path = Path("../embryos_data/")
2727

28-
# Additional metadata in case the xml file is not available
28+
# Additional manual metadata if xml file was not available (not the case)
2929
z_pixel_size = 0.5*1e-6 # in m
3030
pixel_size_unit = 'm'
3131
time_resolution_per_slice = 0.663 # in seconds
@@ -282,7 +282,7 @@
282282
# Convert the segmentation result to a Dask array
283283
chunk_shape = summed_intensity_stack.chunksize
284284
cluster_labels_image_timelapse_dask = da.from_array(cluster_labels_image_timelapse_post_processed, chunks=chunk_shape)
285-
285+
286286
if store_phasor_mask:
287287
cluster_mask_timelapse = np.expand_dims(cluster_mask_timelapse.astype(summed_intensity_stack.dtype), axis=0)
288288
cluster_mask_timelapse_dask = da.from_array(cluster_mask_timelapse, chunks=chunk_shape)
@@ -307,6 +307,14 @@
307307
# Writing to the file
308308
with open(file_path, 'w') as file:
309309
file.write(f"sample_name = {sample_name}\n")
310+
file.write(f"data shape = {data.shape}\n")
311+
file.write(f"laser_frequency = {laser_frequency} MHz\n")
312+
file.write(f"x_pixel_size = {metadata_timelapse['PhysicalSizeX']} {metadata_timelapse['PhysicalSizeXUnit']}\n")
313+
file.write(f"y_pixel_size = {metadata_timelapse['PhysicalSizeY']} {metadata_timelapse['PhysicalSizeYUnit']}\n")
314+
file.write(f"z_pixel_size = {metadata_timelapse['PhysicalSizeZ']} {metadata_timelapse['PhysicalSizeZUnit']}\n")
315+
file.write(f"time_resolution = {metadata_timelapse['TimeIncrement']} {metadata_timelapse['TimeIncrementUnit']}\n")
316+
file.write(f"microtime_resolution = {metadata_single_timepoint['TimeIncrement']} {metadata_single_timepoint['TimeIncrementUnit']}\n")
317+
file.write(f"channel_names = {channel_names}\n")
310318
file.write(f"center = {center}\n")
311319
file.write(f"major-axis = {major}\n")
312320
file.write(f"minor-axis = {minor}\n")

code/phasor_plot_single_timepoint_LP307_3.ipynb

Lines changed: 47 additions & 43 deletions
Large diffs are not rendered by default.

code/phasor_plot_single_timepoint_TMR17_3.ipynb

Lines changed: 46 additions & 42 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)