|
9 | 9 |
|
10 | 10 | from napari_flim_phasor_plotter.filters import apply_binning |
11 | 11 | 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 |
13 | 13 |
|
14 | 14 | from utilities import ellipse_vertices, format_metadata, set_plot_zoom_position, add_segmentation_metadata |
15 | 15 | import time |
|
23 | 23 | # Inputs |
24 | 24 |
|
25 | 25 | # 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/") |
27 | 27 |
|
28 | | -# Additional metadata in case the xml file is not available |
| 28 | +# Additional manual metadata if xml file was not available (not the case) |
29 | 29 | z_pixel_size = 0.5*1e-6 # in m |
30 | 30 | pixel_size_unit = 'm' |
31 | 31 | time_resolution_per_slice = 0.663 # in seconds |
|
282 | 282 | # Convert the segmentation result to a Dask array |
283 | 283 | chunk_shape = summed_intensity_stack.chunksize |
284 | 284 | cluster_labels_image_timelapse_dask = da.from_array(cluster_labels_image_timelapse_post_processed, chunks=chunk_shape) |
285 | | - |
| 285 | + |
286 | 286 | if store_phasor_mask: |
287 | 287 | cluster_mask_timelapse = np.expand_dims(cluster_mask_timelapse.astype(summed_intensity_stack.dtype), axis=0) |
288 | 288 | cluster_mask_timelapse_dask = da.from_array(cluster_mask_timelapse, chunks=chunk_shape) |
|
307 | 307 | # Writing to the file |
308 | 308 | with open(file_path, 'w') as file: |
309 | 309 | 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") |
310 | 318 | file.write(f"center = {center}\n") |
311 | 319 | file.write(f"major-axis = {major}\n") |
312 | 320 | file.write(f"minor-axis = {minor}\n") |
|
0 commit comments