Skip to content

Latest commit

 

History

History
 
 

README.md

Oral Cell Data Preparation

Dependencies

Explanation

data_preparation.sh includes the steps to prepare all nucleus patches for classification.

Explanations of main steps
  1. ndpisplit uses NDPITools to split the NDPI files into smaller pieces.

    This should generate 512 jpg images of size 6496*3360px for each slide, indexing from i01j01 to i32j16. (It takes about 1h to split one whole slide.)

  2. predict_mask.py is used to infer fuzzy prediction masks for nucleus locations.

  3. ImageJ macro script particle_analysis_fixedDirectory.ijm (or particle_analysis.ijm) is called to run blob analysis and extract the detected nucleus coordinates to CSV files.

  4. extract_patch.py is used to cut out nuclei at all z-levels (according to the detected nucleus coordinates in CSV files).

  5. select_focus.py is used to select the most focused patch for each nucleus location.

    Or alternatively, ./select_focus_parallel.sh N does this step using N processes in parallel.

Usage

  1. Clone this repository to the directory of the NDPI files.

  2. There are two options for this step:

    1. Edit the path for inputFolder and outputFolder in particle_analysis_fixedDirectory.ijm :

      inputFolder="/PATH_TO/OralCellDataPreparation/PredMasks/";
      outputFolder="/PATH_TO/OralCellDataPreparation/CSVResults/";
      
    2. Or alternatively, replace

      ImageJ --headless -macro particle_analysis_fixedDirectory.ijm

      with

      ImageJ -macro particle_analysis.ijm

      in data_preparation.sh. Then the path for inputFolder and outputFolder will need to be selected when prompted.

  3. Run

    cd OralCellDataPreparation
    ./data_preparation.sh

    The focused patches will be generated in /PATH_TO/OralCellDataPreparation/Patches/Z_focused/.

    Or replace

    nohup python3 select_focus.py >./nohup.out 2>./nohup.err &

    with

    ./select_focus_parallel.sh N

    to run in parallel, where input argument N is the number of processes.

    The progress bar is redirected in /PATH_TO/OralCellDataPreparation/debugging/*.err, together with the error messages.

Known Problems

  • There might be some "imread error". This is due to trying to read some corrupted images. They are handled by being ignored.