This small project contains file to help segment czi files and display them with napari
- Create a python Virtual Env
- Install pip requirements
pip install -r requirements.txt
- Download Ark-Analysis (https://github.com/angelolab/ark-analysis)
- Look at the README for instructions. This is necessary for the project
- Get a .czi file and tile it using tile_czi.py
python3 tile_czi.py path/to/.czi/file
This should leave you with czi_filename_dir in this directory, which will be used for the next step
You can optionally add flags to argument parsing. Read comments at the top of the file for this information
- Run create_deepcell_dir_format_from_single_channel_fovs.py on the output directory from tile_czi.
python3 create_deepcell_dir_format_from_single_channel_fovs.py czi_filename_dir
This will set up the directory so it can be run for deepcell. Note: If you specify the target path to the ark-analysis folder it will automatically move it to ark-analysis/data folder. Optionally you can run:
mv -v cell_to_segment_dir LOCATION_OF_ARK_ANALYSIS/DATA
-
Copy the Segment_Image_Data-Final.ipynb in this directory to the scripts file of the ark-analysis project
-
Run Segment_Image_Data-Final.ipynb in the ark-analysis jupyter_notebook. This should give you a bunch of output in the cell_to_segment_dir. Move the completed directory over to the final_data directory here.
mv -v LOCATION_OF_ARK_ANALYSIS/DATA/cell_to_segent_dir ./final_data/
- Run view_main.py to use napari.
- For loading images: Use your initial czi files
- For loading points: look for /single_cell_output/cell_table_arcsinh_transformed_stitched-{cell_file_name}.csv
- For loading boundaries: Look for segmentation_borders_current-{cell_file_name}.npy
- Also note: you can load a completely overlayed and stitched version of the cell called final_overlay-cell_name.tiff