Skip to content

Latest commit

 

History

History

README.MD

Tissue (Internal Organs + Soft tissue) Module

Example

Requirements

  • Linux system with GPU (at least 24 GB GPU RAM) and CPU (at least 10 cores), and with 100 GB RAM.
  • Raw image data saved as a series of 16-bit TIFF files (.tif), one per z-plane.

Installation

  • Install CUDA and cuDNN.
  • Install Anaconda to create and control virtual environments.
  • Install Python 3.10 or higher version by Anaconda.
      conda create -n env python=3.10
      conda activate env
    
  • Install pytorch. Install nnUNETv2 following the instructions on their repository.
  • Install additional required libraries:
     pip install -r requirements.txt
    
  • Create folders nnUNet_raw, nnUNet_preprocessed, and nnUNet_results.

Organ segmentation

Example

Tissue segmentation on cropped data

Tissue segmentation on full uncropped data

  cd ../sliding_window_inference/
  python tif2zarr_single_or_dualCh.py -i /PATH_CHANEL_AUTOFLUO/ -i2 /PATH_CHANNEL_PI/ -o /PATH_INPUT_ZARR.zarr/ -c 2,128,128,128

	```  
* Run inference:

CUDA_VISIBLE_DEVICES=0 python predict_from_dask_tissue.py -i PATH_INPUT_ZARR.zarr -o PATH_OUTPUT_ZARR.zarr

```  

(Note: If you want to ensemble the result of 5 models in this setup, you manually need to run all 5 folds.)

  • Export the prediction to tiff:
  python postprocess_segmentation_from_zarr.py -i /PATH_OUTPUT_ZARR.zarr -o /PATH_OUT_TIFF_SLICES/

	``` 


![Example](./assets/mouse_map.png)

![Example](./assets/pipeline.png)