Skip to content

TouHouE/ConvertScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert Scripts

1. Requirements

  • pydicom
  • nibabel
  • pandas
  • numpy

2. Converting .dcm to .nii.gz Files

  • dcm2niix_HsinChu.py
    • This script has been abandoned.
  • dcm2niix_Taipei.py
    • Do not use this script for decompression.

    • The dictionary should be like:

      /media/shard/data/ct_scan/raw/Taipei_2897/CGMH  <-- That is for argument `--data_root`
      ├── 0001  <-- here are the patient
      ├── 0003
      └── ......
      /media/shard/data/ct_scan/raw/Taipei_2897/ISP_annotation <-- That one should pass into `--isp_root`
      ├── 0001  # Almost like 502-CT
      ├── 0003
      └── ......
      
      • PS: To ignore parts that have already been processed, the --ignore_path should point to the --meta_dir.
    • The progress

      • A Skip ISP status indicates that the ISP folder does not contain any tissue labels.

3. Extract the centerline coordinates and names of each coronary artery and plaque.

python store_each_plq.py ...

4. To Merge Duplicate Plaque Labels

python combine_multi_plque.py ... 

5. To Match Text Report and CT

  1. Choosing a Script Based on CT Imaging Source (Taipei or Hsinchu)
    • For Taipei: Specify the --meta_path argument. Its value should be the same as the --meta argument used in dcm2niix_Taipei.py.
      • Example:
        python text_match/maek_taipei_image_table.py \
          --meta_path <path/to/your/meta/data>
        
    • For Hsinchu: Specify the --hsinchu_root argument. Its value should be the same as the dst_root argument used in dcm2niix_Taipei.py.
      • Example:
        python text_match/make_hsinchu_image_table.py \
          --hsinchu_root <path/to/your/destination/root>
        
  2. Merging Matched Image Cases and Reports To change the matching conditions, please modify the get_match_df method.
  • Example:
    python text_match/merge_image_report.py \
     --image_table_path <Path to the output from make_taipei_image_table.py or make_hsinchu_image_table.py> \
     --report_label_path <Path to the desired report storage file> \
     --mode [taipei / hsinchu]
    

PS

  • The dcm2niix program is available for download at dcm2niix
  • Cardiac Structure ID to Name
    1. Right Atrium
    2. Right Ventricle
    3. Left Atrium
    4. Left Ventricle
    5. MyocardiumLV
    6. Aorta
    7. Coronaries8
    8. Fat
    9. Bypass
    10. Plaque

About

Convert raw .dcm file into .nii.gz file for easier training and analysis.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •