Medical image processing related code sharing

The github link is: https://github.com/zuzhiang/MedicalImageProcess

The data is very complicated, so I don’t bother to organize them one by one. Many of them are experimental and there may be problems, but I have forgotten about them after a long time. If you have any problems, please read the code and solve them by yourself. What is the general use:

  • phi
    • my_show_grid.py: First generate a regular grid picture, and then use STN to deform it according to the read-in deformation field
    • show_grid.py: Read in the .nii file of the deformation field, and then generate a visualized picture of the deformation field
  • show_nii
    • show_nii.py: Display three-dimensional .nii images
    • show_nii3.py: Simultaneously display the three-dimensional .nii format organ, organ segmentation mask, and lesion segmentation mask images
  • ants.py: Use SyN in the ANTs package to register images
  • antspy.py: Use the python version of ANTs-antspy to register the image and its corresponding label at the same time
  • CBAM: Implementation of CBAM attention module
  • crop_resize.py: First find the smallest rectangular box containing the brain area, and then manually calculate the size of the rectangular box (each dimension should be a multiple of 16), and then use the commented out part to resize
  • data_augmentation.py: Data enhancement code, including B-spline sampling, inversion, translation, scaling, rotation, gray value equalization, etc., but B-spline sampling seems to be problematic
  • dcm2nii.py: Convert 3D images in dcm format to .nii format
  • FreeSurfer+FSL.py: First use FreeSurfer to peel off the brain image, and then use FSL to affine the image and label at the same time
  • FreeSurfer.py: Use FreeSurfer to perform skull peeling on brain images
  • image_combine_example.py: Someone else gave it, never used it
  • img2nii.py: Convert 3D images in .img format to .nii format
  • jacobian.py: Calculate the Jacobian Determinant of Deformation Field
  • resize_img.py: Resize the image
  • tor_datagenerators.py: Data generator based on pytorch

Guess you like

Origin blog.csdn.net/zuzhiang/article/details/109861649