Spine Dataset
├── verse2019
├── sub-verse012
│ ├── sub-verse012_ct.nii.gz
│ ├── sub-verse012_seg-subreg_ctd.json
│ ├── sub-verse012_seg-vert_msk.nii.gz
│ └── sub-verse012_seg-vert_snp.png
├── sub-verse013
│ ├── sub-verse013_ct.nii.gz
│ ├── sub-verse013_seg-subreg_ctd.json
│ ├── sub-verse013_seg-vert_msk.nii.gz
│ └── sub-verse013_seg-vert_snp.png
└── sub-verse014
├── sub-verse014_ct.nii.gz
├── sub-verse014_seg-subreg_ctd.json
├── sub-verse014_seg-vert_msk.nii.gz
└── sub-verse014_seg-vert_snp.png
The verse dataset has some subfolders that are empty, some subfolders that have multiple CTS, and some subfolders that only have CT without mask.
python nii_tools/verse_check_images.py
- (1) Delete empty sub folders directly.
- (2) Delete only one nii.gz sub folders directly.
- (3) Manually divide subfolders containing multiple CTs.
The CT and the ct mask need to be renamed for use easy.
python nii_tools/verse_rename_images.py
In order to generate DRR for projection, the coordinate system and the origin need to be unified.
- The unified coordinate system direction is LPS.
- The unified origin is [0, 0, 0]
- The json file will also be modified.
python nii_tools/reoriented_images.py
you can run this command to check that the reorientation is correct.
python visual_tools/vis_3d_point_and_mask.py
In order to add Number of CTs available, we run the follow command to crop the long spine which contain T9-L6.
python nii_tools/crop_images.py
when you after crop the image, you should add "bottom" in the subfolder name to sure subfolder name same as ct name.example
sub-verse014 -->> sub-verse014bottom
also you can run the follow command to check the reorientation of croppped images is correct.
python visual_tools/vis_3d_point_and_mask.py
Some CT scans include upper thoracic and cervical vertebrae that need to be discarded. So you need choose the categories you need.
Default selection category list is [T9 T10 T11 T12 L1 L2 L3 L4 L5 L6]
python nii_tools/verse_separate_mask.py
├── verse2019
├── sub-verse012
│ ├── L1_seg.nii.gz
│ ├── L2_seg.nii.gz
│ ├── L3_seg.nii.gz
│ ├── L4_seg.nii.gz
│ ├── L5_seg.nii.gz
│ ├── T11_seg.nii.gz
│ ├── T12_seg.nii.gz
│ └── sub-verse012.nii.gz
├── sub-verse013
│ ├── L1_seg.nii.gz
│ ├── L2_seg.nii.gz
│ ├── L3_seg.nii.gz
│ ├── L4_seg.nii.gz
│ ├── L5_seg.nii.gz
│ ├── T11_seg.nii.gz
│ ├── T12_seg.nii.gz
│ └── sub-verse013.nii.gz
├── sub-verse014bottom
│ ├── L1_seg.nii.gz
│ ├── L2_seg.nii.gz
│ ├── L3_seg.nii.gz
│ ├── L4_seg.nii.gz
│ ├── L5_seg.nii.gz
│ ├── T11_seg.nii.gz
│ ├── T12_seg.nii.gz
│ └── sub-verse014bottom.nii.gz
python main_drr_detection_dataset.py
The Separate mask dataset format process is tedious,so we hope we don't separate the original seg mask and don't rename the ct masks.
the init formart is the final format.
├── verse2019
├── sub-verse012
│ ├── sub-verse012_ct.nii.gz
│ ├── sub-verse012_seg-subreg_ctd.json
│ ├── sub-verse012_seg-vert_msk.nii.gz
│ └── sub-verse012_seg-vert_snp.png
├── sub-verse013
│ ├── sub-verse013_ct.nii.gz
│ ├── sub-verse013_seg-subreg_ctd.json
│ ├── sub-verse013_seg-vert_msk.nii.gz
│ └── sub-verse013_seg-vert_snp.png
└── sub-verse014
├── sub-verse014_ct.nii.gz
├── sub-verse014_seg-subreg_ctd.json
├── sub-verse014_seg-vert_msk.nii.gz
└── sub-verse014_seg-vert_snp.png
so just run the follow command can generate dataset.
To be update!!!