Skip to content

ThreeStones1029/drr_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Learning Spine DRR Toolkit

license

drr_utils_examples

Open3d Visualization

Image 1 Image 2

Introduction

This repository mainly uses ITK to generate DRR, as well as the corresponding keypoints, detection boxes, and segmentation mask annotations. The generated dataset can be used for pre-trained model training to improve the robustness of deep learning.

TODO

see details
  • Detection(verse mask format)
  • Segmantation(verse mask format)
  • Keypoints dataset generate
  • 3D visualization(2024-07-13-complete!)

Quick start

Preliminary preparation

ITK tool installation

Official zip download address
windows:You can skip this step without installing ITK.
linux:Need to compile and install ITK tool, for specific installation can refer to itkSoftwareGuide.
Here is my install process.

Dataset preparation

ct dataset format preparation tutorial

Detection(Each vertebra is separated in mask format)

Dataset generation

python main_drr_detection_dataset.py -c config/detection_config.yml

Parameter Configuration Description(detection_config.yml)

Detection datasets to generate specific parameter descriptions

Code that is accidentally broken can be regenerated

The generated json file will be automatically saved after each CT generation. Due to accidental termination or active interruption, the generation can continue, and it is necessary to continue to generate and re-run the command

python main_drr_detection_dataset.py -c config/detection_config.yml

Note:the CT that has been projected in the json file will be automatically detected, starting from the CT that has not been projected.

Regenerate the specified cts.

Sometimes, we main generate single ct wrong, but we don't want to regenerate all cts' drrs. So if you need regenerate the specified cts, just add the ct name in regenerate ct name list. Then run the follow Similar command.Or if you need regenerate all the drrs, just input -r all.

python main_drr_detection_dataset.py -c config/detection_config.yml -r ["du_xiang.nii.gz"] 
python main_drr_detection_dataset.py -c config/detection_config.yml -r all # if -r==all then will regenerate all cts drrs.

Example

Image 1 Image 2
Segmantation(Each vertebra is separated in mask format)

Dataset generation

Running the command:

python main_drr_segmentation_dataset.py -c config/segmentation_config.yml

Parameter Configuration Description(segmentation_config.yml)

Segmentation datasets to generate specific parameter descriptions

Code that is accidentally broken can be regenerated

The generated json file will be automatically saved after each CT generation. Due to accidental termination or active interruption, the generation can continue, and it is necessary to continue to generate and re-run the command

python main_drr_segmentation_dataset.py -c config/segmentation_config.yml

Note:The CT that has been projected in the json file will be automatically detected, and the CT that has not been projected will be started from the CT that has not been projected.

Regenerate the specified cts.

Sometimes, we main generate single ct wrong, but we don't want to regenerate all cts' drrs. So if you need regenerate the specified cts, just add the ct name in regenerate ct name list. Then run the follow Similar command.Or if you need regenerate all the drrs, just input -r all.

python main_drr_segmentation_dataset.py -c config/segmentation_config.yml -r ["du_xiang.nii.gz"] 
python main_drr_segmentation_dataset.py -c config/segmentation_config.yml -r all # if -r==all then will regenerate all cts drrs.

Example

Image 1 Image 2
Visualize 3d mask and point in 2d image.
python visual_tools/vis_3d_point_and_mask.py

3D points and mask project in 2D image.

3D point and mask

open3d visualize
python main_3d_vis.py

Example

single view multi view detection view segmentation view

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published