Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jizhang02 committed Dec 22, 2023
1 parent b7a7061 commit 9ea1456
Show file tree
Hide file tree
Showing 116 changed files with 144 additions and 185 deletions.
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Header Image](/code/figures/dream_codeworld.jpg)
![Header Image](/figures/dream_codeworld.jpg)

# Code

Expand All @@ -10,17 +10,11 @@
This repo collects the python code and jupyter notebooks.

## Code lists
* [Cardiac images preprocessing](/code/cardiac-dataset-preprocess)
* [Compute model memory](https://gist.github.com/jizhang02/ef8eb45450f3d943fea37c6544d3808c)
* [Convert dcm to mhd](https://gist.github.com/jizhang02/6e395880c085f7c9884d9cec5490c710)
* [DenseNet-FCN](/code/densenetfcn)
* [Evaluation index](/code/basic-python-files/)
* [Traditional image segmentation algorithms](/code/traditional-segmentation-algorithms/)
* [U-Net](/code/u-net)
* [V-Net](/code/vnet.py)
* [plots](/code/basic-python-files/myplots.ipynb)
* [timm model list](/code/basic-python-files/timm_model_names.ipynb)
* [DNN Marathon](/code/dnn_marathon.ipynb)
* [Cardiac images preprocessing](/cardiac-dataset-preprocess)
* [Deep learning based image segmentation](/segmentation-dl/)
* [Image processing based image segmentation](/segmentation-mip/)
* [Various utils](/utils/)
* [DNN Marathon](/dnn_marathon.ipynb)



Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 0 additions & 70 deletions code/.ipynb_checkpoints/dnn_marathon-checkpoint.ipynb

This file was deleted.

4 changes: 0 additions & 4 deletions code/basic-python-files/ReadMe.md

This file was deleted.

46 changes: 0 additions & 46 deletions code/basic-python-files/meanstd.py

This file was deleted.

Binary file removed code/demo.pth
Binary file not shown.
Empty file removed code/u-net/readme.md
Empty file.
2 changes: 1 addition & 1 deletion code/dnn_marathon.ipynb → dnn_marathon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.6"
},
"vscode": {
"interpreter": {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 10 additions & 1 deletion code/basic-python-files/csvread_write.py → utils/file_csv.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
'''
-----------------------------------------------
File Name: file_csv.py
Description:
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

from tqdm import tqdm # progress bar
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image,ImageChops

import pandas as pd
import math
import glob
import os

def angle(a, b, c):
"""
Return angle between lines ab, bc
Expand Down
8 changes: 8 additions & 0 deletions code/basic-python-files/h5file.py → utils/file_h5.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
'''
-----------------------------------------------
File Name: file_h5.py
Description: read h5 file.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''
# python 2
#coding=utf-8
import datetime
Expand Down
9 changes: 9 additions & 0 deletions code/basic-python-files/mat2img.py → utils/file_mat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
'''
-----------------------------------------------
File Name: file_mat.py
Description: Processing mat file.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

import cv2
import scipy.io as scio
from PIL import Image
Expand Down
9 changes: 9 additions & 0 deletions code/basic-python-files/npyfile.py → utils/file_npy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
'''
-----------------------------------------------
File Name: file_npy.py
Description: npy file reading and writing.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

import numpy as np
import random
import math
Expand Down
12 changes: 10 additions & 2 deletions code/basic-python-files/tiff.py → utils/file_tiff.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
'''
-----------------------------------------------
File Name: file_tiff.py
Description: tiff file processing.
Author: Jing
Date: 9/28/2021
-----------------------------------------------
'''

import numpy as np
import tifffile as tiff
import matplotlib.image as mpimg # mpimg 用于读取图片
Expand Down Expand Up @@ -50,5 +59,4 @@ def readoneimg(imagepath):
im1[np.where(im1==170)]=2
im1[np.where(im1==255)]=3
im = Image.fromarray(im1)
im.save('new.png')

im.save('new.png')
6 changes: 3 additions & 3 deletions code/basic-python-files/HC_para.py → utils/image_HC_para.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'''
-----------------------------------------------
File Name: HC_para$
File Name: image_HC_para.py
Description: Draw the parameters of an ellipse; Sum up the number of pixels of an ellipse
Author: Jing$
Date: 7/21/2021$
Author: Jing
Date: 7/21/2021
-----------------------------------------------
'''
import glob
Expand Down
9 changes: 8 additions & 1 deletion code/basic-python-files/NIQE.py → utils/image_NIQE.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Natural Image Quality Evaluator
'''
-----------------------------------------------
File Name: image_NIQE.py
Description: Natural Image Quality Evaluator.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

import numpy as np
import scipy.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
'''
-----------------------------------------------
File Name: image_enhence.py
Description: Different image enhence methods.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''
import numpy as np
import cv2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
'''
-----------------------------------------------
File Name: image_process.py
Description: Different image processing methods.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

from PIL import Image,ImageChops
import os, sys
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
'''
-----------------------------------------------
File Name: image_reading.py
Description: Different image reading methods.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

#encoding=utf8
from PIL import Image
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
'''
Title: Calculate Dice score, hausdorff distance, assd
-----------------------------------------------
File Name: image_seg_evaluation.py
Description: Calculate Dice score, hausdorff distance, assd
between segmented images and ground truth images.
Compute p-value between two same metrics.
Author: Jing Zhang ([email protected])
Author: Jing ([email protected])
Date: 2021-04-23
-----------------------------------------------
'''

from PIL import Image
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 5 additions & 10 deletions code/basic-python-files/analysis.py → utils/plots_analysis.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
'''
-----------------------------------------------
File Name: log_curve$
Description:
Author: Jing$
Date: 7/5/2021$
File Name: plots_analysis.py
Description: Drawing learning curve in training,
validation, test stage from log file.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''
'''
Title: Drawing learning curve in training, validation, test stage
from log file.
Author: Jing Zhang
Date: 2021-04-23
'''

import glob
import cv2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
'''
-----------------------------------------------
File Name: log_curve$
Description:
Author: Jing$
Date: 7/5/2021$
File Name: plots_curvefromcsv.py
Description: Drawing learning curve in training,
validation, test stage from log file.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''
'''
Title: Drawing learning curve in training, validation, test stage
from log file.
Author: Jing Zhang
Date: 2021-04-23
'''

import os
import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
'''
-----------------------------------------------
File Name: plots_curvefromjson.py
Description: Drawing learning curve in training,
validation, test stage from log file.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''

import matplotlib.pyplot as plt
import os
from sklearn.preprocessing import MinMaxScaler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'''
-----------------------------------------------
File Name: error_bar$
Description:
Author: Jing$
Date: 8/20/2021$
File Name: plots_errorbar.py
Description: Drawing error bar.
Author: Jing ([email protected])
Date: 7/5/2021
-----------------------------------------------
'''
import matplotlib.pyplot as plt
Expand Down
File renamed without changes.
Loading

0 comments on commit 9ea1456

Please sign in to comment.