├── Glioma_grading ├── main.py ├── model1.yaml ├── model1.yaml.h5 ├── model2.yaml ├── model2.yaml.h5 ├── t1ce_example.mat └── t2flair_example.mat ├── Portal hypertension ├── l_cnn_best0.h5 ├── liver.bmp ├── s_cnn_best0.h5 ├── spleen.bmp └── test.py ├── README.md ├── ccRCC_prognosis └── ccRCC_prognosis.zip └── osteoporosis ├── __pycache__ └── shili_pre.cpython-36.pyc ├── main.py ├── mat ├── example1_for_lumoral.mat └── example2_for_lumoral.mat ├── models ├── modelYao.json ├── modelYaoC-1.h5 ├── modelYaoC.h5 ├── modelYaoZ-1.h5 └── modelYaoZ.h5 └── shili_pre.py /Glioma_grading/main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Jun 17 10:28:14 2019 4 | @author: luojiaxiu 5 | """ 6 | 7 | import scipy.io as sio 8 | import os 9 | import numpy as np 10 | from keras.models import load_model 11 | from keras.models import model_from_yaml 12 | from keras import backend 13 | backend.set_image_data_format('channels_first') 14 | 15 | data1 = sio.loadmat('./t2flair_example.mat') 16 | t2flair_X = (data1['t2flair_example'].astype('float32')) 17 | t2flair_X = (t2flair_X.reshape(t2flair_X.shape[0], 1, 24, 24, 24)) 18 | 19 | data2 = sio.loadmat('./t1ce_example.mat') 20 | t1ce_X = (data2['t1ce_example'].astype('float32')) 21 | t1ce_X = (t2flair_X.reshape(t2flair_X.shape[0], 1, 24, 24, 24)) 22 | 23 | with open('./model1.yaml','r') as file1: 24 | model_yaml1 = file1.read() 25 | model_t2flair = model_from_yaml(model_yaml1) 26 | model_t2flair.load_weights('./model1.yaml.h5') 27 | 28 | with open('./model2.yaml','r') as file2: 29 | model_yaml2 = file2.read() 30 | model_t1ce = model_from_yaml(model_yaml2) 31 | model_t1ce.load_weights('./model2.yaml.h5') 32 | 33 | t2flair_result=model_t2flair.predict(t2flair_X) 34 | t1ce_result=model_t1ce.predict(t1ce_X) 35 | 36 | print('Predicting probability of t2flair example: ', t2flair_result[0][1]) 37 | print('Predicting probability of t1ce example: ', t1ce_result[0][1]) -------------------------------------------------------------------------------- /Glioma_grading/model1.yaml: -------------------------------------------------------------------------------- 1 | backend: tensorflow 2 | class_name: Sequential 3 | config: 4 | layers: 5 | - class_name: Conv3D 6 | config: 7 | activation: relu 8 | activity_regularizer: null 9 | batch_input_shape: !!python/tuple 10 | - null 11 | - 1 12 | - 24 13 | - 24 14 | - 24 15 | bias_constraint: null 16 | bias_initializer: 17 | class_name: Zeros 18 | config: {} 19 | bias_regularizer: null 20 | data_format: channels_first 21 | dilation_rate: &id001 !!python/tuple 22 | - 1 23 | - 1 24 | - 1 25 | dtype: float32 26 | filters: 32 27 | kernel_constraint: null 28 | kernel_initializer: 29 | class_name: RandomNormal 30 | config: 31 | mean: 0.0 32 | seed: null 33 | stddev: 0.05 34 | kernel_regularizer: 35 | class_name: L1L2 36 | config: 37 | l1: 0.0010000000474974513 38 | l2: 0.0 39 | kernel_size: !!python/tuple 40 | - 2 41 | - 2 42 | - 2 43 | name: conv3d_1 44 | padding: same 45 | strides: &id002 !!python/tuple 46 | - 1 47 | - 1 48 | - 1 49 | trainable: true 50 | use_bias: true 51 | - class_name: Conv3D 52 | config: 53 | activation: relu 54 | activity_regularizer: null 55 | bias_constraint: null 56 | bias_initializer: 57 | class_name: Zeros 58 | config: {} 59 | bias_regularizer: null 60 | data_format: channels_first 61 | dilation_rate: *id001 62 | filters: 32 63 | kernel_constraint: null 64 | kernel_initializer: 65 | class_name: VarianceScaling 66 | config: 67 | distribution: uniform 68 | mode: fan_avg 69 | scale: 1.0 70 | seed: null 71 | kernel_regularizer: null 72 | kernel_size: !!python/tuple 73 | - 2 74 | - 2 75 | - 2 76 | name: conv3d_2 77 | padding: same 78 | strides: *id002 79 | trainable: true 80 | use_bias: true 81 | - class_name: AveragePooling3D 82 | config: 83 | data_format: channels_first 84 | name: average_pooling3d_1 85 | padding: valid 86 | pool_size: &id003 !!python/tuple 87 | - 2 88 | - 2 89 | - 2 90 | strides: *id003 91 | trainable: true 92 | - class_name: Dropout 93 | config: 94 | name: dropout_1 95 | noise_shape: null 96 | rate: 0.2 97 | seed: null 98 | trainable: true 99 | - class_name: Conv3D 100 | config: 101 | activation: relu 102 | activity_regularizer: null 103 | bias_constraint: null 104 | bias_initializer: 105 | class_name: Zeros 106 | config: {} 107 | bias_regularizer: null 108 | data_format: channels_first 109 | dilation_rate: *id001 110 | filters: 64 111 | kernel_constraint: null 112 | kernel_initializer: 113 | class_name: VarianceScaling 114 | config: 115 | distribution: uniform 116 | mode: fan_avg 117 | scale: 1.0 118 | seed: null 119 | kernel_regularizer: null 120 | kernel_size: !!python/tuple 121 | - 2 122 | - 2 123 | - 2 124 | name: conv3d_3 125 | padding: same 126 | strides: *id002 127 | trainable: true 128 | use_bias: true 129 | - class_name: Conv3D 130 | config: 131 | activation: relu 132 | activity_regularizer: null 133 | bias_constraint: null 134 | bias_initializer: 135 | class_name: Zeros 136 | config: {} 137 | bias_regularizer: null 138 | data_format: channels_first 139 | dilation_rate: *id001 140 | filters: 64 141 | kernel_constraint: null 142 | kernel_initializer: 143 | class_name: VarianceScaling 144 | config: 145 | distribution: uniform 146 | mode: fan_avg 147 | scale: 1.0 148 | seed: null 149 | kernel_regularizer: null 150 | kernel_size: !!python/tuple 151 | - 2 152 | - 2 153 | - 2 154 | name: conv3d_4 155 | padding: same 156 | strides: *id002 157 | trainable: true 158 | use_bias: true 159 | - class_name: AveragePooling3D 160 | config: 161 | data_format: channels_first 162 | name: average_pooling3d_2 163 | padding: valid 164 | pool_size: &id004 !!python/tuple 165 | - 2 166 | - 2 167 | - 2 168 | strides: *id004 169 | trainable: true 170 | - class_name: Dropout 171 | config: 172 | name: dropout_2 173 | noise_shape: null 174 | rate: 0.2 175 | seed: null 176 | trainable: true 177 | - class_name: Conv3D 178 | config: 179 | activation: relu 180 | activity_regularizer: null 181 | bias_constraint: null 182 | bias_initializer: 183 | class_name: Zeros 184 | config: {} 185 | bias_regularizer: null 186 | data_format: channels_first 187 | dilation_rate: *id001 188 | filters: 64 189 | kernel_constraint: null 190 | kernel_initializer: 191 | class_name: VarianceScaling 192 | config: 193 | distribution: uniform 194 | mode: fan_avg 195 | scale: 1.0 196 | seed: null 197 | kernel_regularizer: null 198 | kernel_size: !!python/tuple 199 | - 2 200 | - 2 201 | - 2 202 | name: conv3d_5 203 | padding: same 204 | strides: *id002 205 | trainable: true 206 | use_bias: true 207 | - class_name: Conv3D 208 | config: 209 | activation: relu 210 | activity_regularizer: null 211 | bias_constraint: null 212 | bias_initializer: 213 | class_name: Zeros 214 | config: {} 215 | bias_regularizer: null 216 | data_format: channels_first 217 | dilation_rate: *id001 218 | filters: 64 219 | kernel_constraint: null 220 | kernel_initializer: 221 | class_name: VarianceScaling 222 | config: 223 | distribution: uniform 224 | mode: fan_avg 225 | scale: 1.0 226 | seed: null 227 | kernel_regularizer: null 228 | kernel_size: !!python/tuple 229 | - 2 230 | - 2 231 | - 2 232 | name: conv3d_6 233 | padding: same 234 | strides: *id002 235 | trainable: true 236 | use_bias: true 237 | - class_name: Dropout 238 | config: 239 | name: dropout_3 240 | noise_shape: null 241 | rate: 0.3 242 | seed: null 243 | trainable: true 244 | - class_name: Flatten 245 | config: 246 | data_format: channels_first 247 | name: flatten_1 248 | trainable: true 249 | - class_name: Dense 250 | config: 251 | activation: relu 252 | activity_regularizer: null 253 | bias_constraint: null 254 | bias_initializer: 255 | class_name: Zeros 256 | config: {} 257 | bias_regularizer: null 258 | kernel_constraint: null 259 | kernel_initializer: 260 | class_name: VarianceScaling 261 | config: 262 | distribution: uniform 263 | mode: fan_avg 264 | scale: 1.0 265 | seed: null 266 | kernel_regularizer: null 267 | name: dense_1 268 | trainable: true 269 | units: 512 270 | use_bias: true 271 | - class_name: Dense 272 | config: 273 | activation: relu 274 | activity_regularizer: null 275 | bias_constraint: null 276 | bias_initializer: 277 | class_name: Zeros 278 | config: {} 279 | bias_regularizer: null 280 | kernel_constraint: null 281 | kernel_initializer: 282 | class_name: VarianceScaling 283 | config: 284 | distribution: uniform 285 | mode: fan_avg 286 | scale: 1.0 287 | seed: null 288 | kernel_regularizer: null 289 | name: dense_2 290 | trainable: true 291 | units: 16 292 | use_bias: true 293 | - class_name: Dense 294 | config: 295 | activation: sigmoid 296 | activity_regularizer: null 297 | bias_constraint: null 298 | bias_initializer: 299 | class_name: Zeros 300 | config: {} 301 | bias_regularizer: null 302 | kernel_constraint: null 303 | kernel_initializer: 304 | class_name: VarianceScaling 305 | config: 306 | distribution: uniform 307 | mode: fan_avg 308 | scale: 1.0 309 | seed: null 310 | kernel_regularizer: null 311 | name: dense_3 312 | trainable: true 313 | units: 2 314 | use_bias: true 315 | name: sequential_1 316 | keras_version: 2.2.4 317 | -------------------------------------------------------------------------------- /Glioma_grading/model1.yaml.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Glioma_grading/model1.yaml.h5 -------------------------------------------------------------------------------- /Glioma_grading/model2.yaml: -------------------------------------------------------------------------------- 1 | backend: tensorflow 2 | class_name: Sequential 3 | config: 4 | layers: 5 | - class_name: Conv3D 6 | config: 7 | activation: relu 8 | activity_regularizer: null 9 | batch_input_shape: !!python/tuple 10 | - null 11 | - 1 12 | - 24 13 | - 24 14 | - 24 15 | bias_constraint: null 16 | bias_initializer: 17 | class_name: Zeros 18 | config: {} 19 | bias_regularizer: null 20 | data_format: channels_first 21 | dilation_rate: &id001 !!python/tuple 22 | - 1 23 | - 1 24 | - 1 25 | dtype: float32 26 | filters: 32 27 | kernel_constraint: null 28 | kernel_initializer: 29 | class_name: RandomNormal 30 | config: 31 | mean: 0.0 32 | seed: null 33 | stddev: 0.05 34 | kernel_regularizer: 35 | class_name: L1L2 36 | config: 37 | l1: 0.0010000000474974513 38 | l2: 0.0 39 | kernel_size: !!python/tuple 40 | - 2 41 | - 2 42 | - 2 43 | name: conv3d_1 44 | padding: same 45 | strides: &id002 !!python/tuple 46 | - 1 47 | - 1 48 | - 1 49 | trainable: true 50 | use_bias: true 51 | - class_name: Conv3D 52 | config: 53 | activation: relu 54 | activity_regularizer: null 55 | bias_constraint: null 56 | bias_initializer: 57 | class_name: Zeros 58 | config: {} 59 | bias_regularizer: null 60 | data_format: channels_first 61 | dilation_rate: *id001 62 | filters: 32 63 | kernel_constraint: null 64 | kernel_initializer: 65 | class_name: VarianceScaling 66 | config: 67 | distribution: uniform 68 | mode: fan_avg 69 | scale: 1.0 70 | seed: null 71 | kernel_regularizer: null 72 | kernel_size: !!python/tuple 73 | - 2 74 | - 2 75 | - 2 76 | name: conv3d_2 77 | padding: same 78 | strides: *id002 79 | trainable: true 80 | use_bias: true 81 | - class_name: MaxPooling3D 82 | config: 83 | data_format: channels_first 84 | name: max_pooling3d_1 85 | padding: valid 86 | pool_size: &id003 !!python/tuple 87 | - 2 88 | - 2 89 | - 2 90 | strides: *id003 91 | trainable: true 92 | - class_name: SpatialDropout3D 93 | config: 94 | name: spatial_dropout3d_1 95 | noise_shape: null 96 | rate: 0.3 97 | seed: null 98 | trainable: true 99 | - class_name: Conv3D 100 | config: 101 | activation: relu 102 | activity_regularizer: null 103 | bias_constraint: null 104 | bias_initializer: 105 | class_name: Zeros 106 | config: {} 107 | bias_regularizer: null 108 | data_format: channels_first 109 | dilation_rate: *id001 110 | filters: 64 111 | kernel_constraint: null 112 | kernel_initializer: 113 | class_name: VarianceScaling 114 | config: 115 | distribution: uniform 116 | mode: fan_avg 117 | scale: 1.0 118 | seed: null 119 | kernel_regularizer: null 120 | kernel_size: !!python/tuple 121 | - 2 122 | - 2 123 | - 2 124 | name: conv3d_3 125 | padding: same 126 | strides: *id002 127 | trainable: true 128 | use_bias: true 129 | - class_name: Conv3D 130 | config: 131 | activation: relu 132 | activity_regularizer: null 133 | bias_constraint: null 134 | bias_initializer: 135 | class_name: Zeros 136 | config: {} 137 | bias_regularizer: null 138 | data_format: channels_first 139 | dilation_rate: *id001 140 | filters: 64 141 | kernel_constraint: null 142 | kernel_initializer: 143 | class_name: VarianceScaling 144 | config: 145 | distribution: uniform 146 | mode: fan_avg 147 | scale: 1.0 148 | seed: null 149 | kernel_regularizer: null 150 | kernel_size: !!python/tuple 151 | - 2 152 | - 2 153 | - 2 154 | name: conv3d_4 155 | padding: same 156 | strides: *id002 157 | trainable: true 158 | use_bias: true 159 | - class_name: MaxPooling3D 160 | config: 161 | data_format: channels_first 162 | name: max_pooling3d_2 163 | padding: valid 164 | pool_size: &id004 !!python/tuple 165 | - 2 166 | - 2 167 | - 2 168 | strides: *id004 169 | trainable: true 170 | - class_name: SpatialDropout3D 171 | config: 172 | name: spatial_dropout3d_2 173 | noise_shape: null 174 | rate: 0.3 175 | seed: null 176 | trainable: true 177 | - class_name: Conv3D 178 | config: 179 | activation: relu 180 | activity_regularizer: null 181 | bias_constraint: null 182 | bias_initializer: 183 | class_name: Zeros 184 | config: {} 185 | bias_regularizer: null 186 | data_format: channels_first 187 | dilation_rate: *id001 188 | filters: 64 189 | kernel_constraint: null 190 | kernel_initializer: 191 | class_name: VarianceScaling 192 | config: 193 | distribution: uniform 194 | mode: fan_avg 195 | scale: 1.0 196 | seed: null 197 | kernel_regularizer: null 198 | kernel_size: !!python/tuple 199 | - 2 200 | - 2 201 | - 2 202 | name: conv3d_5 203 | padding: same 204 | strides: *id002 205 | trainable: true 206 | use_bias: true 207 | - class_name: Conv3D 208 | config: 209 | activation: relu 210 | activity_regularizer: null 211 | bias_constraint: null 212 | bias_initializer: 213 | class_name: Zeros 214 | config: {} 215 | bias_regularizer: null 216 | data_format: channels_first 217 | dilation_rate: *id001 218 | filters: 64 219 | kernel_constraint: null 220 | kernel_initializer: 221 | class_name: VarianceScaling 222 | config: 223 | distribution: uniform 224 | mode: fan_avg 225 | scale: 1.0 226 | seed: null 227 | kernel_regularizer: null 228 | kernel_size: !!python/tuple 229 | - 2 230 | - 2 231 | - 2 232 | name: conv3d_6 233 | padding: same 234 | strides: *id002 235 | trainable: true 236 | use_bias: true 237 | - class_name: SpatialDropout3D 238 | config: 239 | name: spatial_dropout3d_3 240 | noise_shape: null 241 | rate: 0.4 242 | seed: null 243 | trainable: true 244 | - class_name: Flatten 245 | config: 246 | data_format: channels_first 247 | name: flatten_1 248 | trainable: true 249 | - class_name: Dense 250 | config: 251 | activation: relu 252 | activity_regularizer: null 253 | bias_constraint: null 254 | bias_initializer: 255 | class_name: Zeros 256 | config: {} 257 | bias_regularizer: null 258 | kernel_constraint: null 259 | kernel_initializer: 260 | class_name: VarianceScaling 261 | config: 262 | distribution: uniform 263 | mode: fan_avg 264 | scale: 1.0 265 | seed: null 266 | kernel_regularizer: null 267 | name: dense_1 268 | trainable: true 269 | units: 512 270 | use_bias: true 271 | - class_name: Dense 272 | config: 273 | activation: relu 274 | activity_regularizer: null 275 | bias_constraint: null 276 | bias_initializer: 277 | class_name: Zeros 278 | config: {} 279 | bias_regularizer: null 280 | kernel_constraint: null 281 | kernel_initializer: 282 | class_name: VarianceScaling 283 | config: 284 | distribution: uniform 285 | mode: fan_avg 286 | scale: 1.0 287 | seed: null 288 | kernel_regularizer: null 289 | name: dense_2 290 | trainable: true 291 | units: 16 292 | use_bias: true 293 | - class_name: Dense 294 | config: 295 | activation: sigmoid 296 | activity_regularizer: null 297 | bias_constraint: null 298 | bias_initializer: 299 | class_name: Zeros 300 | config: {} 301 | bias_regularizer: null 302 | kernel_constraint: null 303 | kernel_initializer: 304 | class_name: VarianceScaling 305 | config: 306 | distribution: uniform 307 | mode: fan_avg 308 | scale: 1.0 309 | seed: null 310 | kernel_regularizer: null 311 | name: dense_3 312 | trainable: true 313 | units: 2 314 | use_bias: true 315 | name: sequential_1 316 | keras_version: 2.2.4 317 | -------------------------------------------------------------------------------- /Glioma_grading/model2.yaml.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Glioma_grading/model2.yaml.h5 -------------------------------------------------------------------------------- /Glioma_grading/t1ce_example.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Glioma_grading/t1ce_example.mat -------------------------------------------------------------------------------- /Glioma_grading/t2flair_example.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Glioma_grading/t2flair_example.mat -------------------------------------------------------------------------------- /Portal hypertension/l_cnn_best0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Portal hypertension/l_cnn_best0.h5 -------------------------------------------------------------------------------- /Portal hypertension/liver.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Portal hypertension/liver.bmp -------------------------------------------------------------------------------- /Portal hypertension/s_cnn_best0.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Portal hypertension/s_cnn_best0.h5 -------------------------------------------------------------------------------- /Portal hypertension/spleen.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/Portal hypertension/spleen.bmp -------------------------------------------------------------------------------- /Portal hypertension/test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed Feb 20 20:22:23 2019 4 | 5 | @author: 15129 6 | """ 7 | 8 | import numpy as np 9 | import scipy.io as sio 10 | from PIL import Image 11 | from keras import backend 12 | from keras.models import load_model 13 | 14 | backend.set_image_data_format('channels_first') 15 | 16 | def test(): 17 | patch_liver = Image.open("liver.bmp") 18 | patch_spleen = Image.open("spleen.bmp") 19 | 20 | width,height = patch_liver.size 21 | patch_liver = patch_liver.getdata() 22 | patch_liver = np.matrix(patch_liver,dtype='float')/255.0 23 | patch_liver = np.reshape(patch_liver, (width,height)) 24 | liver_input =np.zeros((1, 1, width, height)) 25 | liver_input[0,0,:,:]=patch_liver 26 | 27 | patch_spleen = patch_spleen.getdata() 28 | patch_spleen = np.matrix(patch_spleen,dtype='float')/255.0 29 | patch_spleen = np.reshape(patch_spleen,(width, height)) 30 | patch_spleen = patch_spleen.reshape((1, 1, width,height)) 31 | spleen_input=np.zeros((1, 1, width, height)) 32 | spleen_input[0,0,:,:]=patch_spleen 33 | 34 | model_l = load_model('F:/门脉高压/activate/3/sigmoid/l_cnn_best0.h5') 35 | model_s = load_model('F:/门脉高压/activate/3/sigmoid/s_cnn_best0.h5') 36 | 37 | predict_liver = model_l.predict(liver_input) 38 | predict_spleen = model_s.predict(spleen_input) 39 | 40 | print('The Probability of Portal Hypertension of liver : ', predict_liver[0][1]) 41 | print('The Probability of Portal Hypertension of spleen : ', predict_spleen[0][1]) 42 | 43 | 44 | if __name__ == '__main__': 45 | test() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Zhang's lab aims to provide a model or GUI of algorithm for example and further studies. ALL of them are used just for research, 2 | but not for commercy. And the web are updating consistently. If you have any questions, do not hesitate to contact us! (E-mail: 843155331@qq.com, Zhenyuan Ning; or yuzhang@smu.edu.cn, Yu Zhang) 3 | 4 | 1. Osteoporosis 5 | (1) run main.py 6 | (2) Path 2 is the name of the lumbar mat file 7 | (3) The mat folder is an example of what you need to run 8 | (4) environment: python3.6 needed packages:numpy keras tensorflow scipy 9 | 10 | 11 | 2. Portal hypertension 12 | (1) run test.py 13 | 14 | 15 | 3. ccRCC_prognosis 16 | (1) This file contains the GUI of BFPS algorithm (available at https://1drv.ms/u/s!AnbmXaW9INvBgZwSL1jIDq4O7RR2eg), deep CNN for deep feature extraction, and the pakages used for gene analysis. 17 | 18 | 19 | 4. Glioma_grading 20 | (1) run main.py 21 | -------------------------------------------------------------------------------- /ccRCC_prognosis/ccRCC_prognosis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/ccRCC_prognosis/ccRCC_prognosis.zip -------------------------------------------------------------------------------- /osteoporosis/__pycache__/shili_pre.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/__pycache__/shili_pre.cpython-36.pyc -------------------------------------------------------------------------------- /osteoporosis/main.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | import os, sys 4 | import numpy as np 5 | 6 | from shili_pre import pre_lumoral 7 | 8 | if __name__ == '__main__': 9 | path2 = 'example1_for_lumoral.mat' 10 | pre_lumoral(path2) 11 | -------------------------------------------------------------------------------- /osteoporosis/mat/example1_for_lumoral.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/mat/example1_for_lumoral.mat -------------------------------------------------------------------------------- /osteoporosis/mat/example2_for_lumoral.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/mat/example2_for_lumoral.mat -------------------------------------------------------------------------------- /osteoporosis/models/modelYao.json: -------------------------------------------------------------------------------- 1 | {"class_name": "Sequential", "config": {"name": "sequential_2", "layers": [{"class_name": "Conv2D", "config": {"name": "conv2d_7", "trainable": true, "batch_input_shape": [null, 64, 64, 1], "dtype": "float32", "filters": 32, "kernel_size": [4, 4], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_7", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_8", "trainable": true, "activation": "relu"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_8", "trainable": true, "filters": 64, "kernel_size": [4, 4], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_8", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_9", "trainable": true, "activation": "relu"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_9", "trainable": true, "filters": 64, "kernel_size": [4, 4], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_9", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_10", "trainable": true, "activation": "relu"}}, {"class_name": "MaxPooling2D", "config": {"name": "max_pooling2d_2", "trainable": true, "pool_size": [2, 2], "padding": "valid", "strides": [2, 2], "data_format": "channels_last"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_10", "trainable": true, "filters": 128, "kernel_size": [1, 1], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_10", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_11", "trainable": true, "activation": "relu"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_11", "trainable": true, "filters": 128, "kernel_size": [4, 4], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_11", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_12", "trainable": true, "activation": "relu"}}, {"class_name": "Conv2D", "config": {"name": "conv2d_12", "trainable": true, "filters": 256, "kernel_size": [4, 4], "strides": [1, 1], "padding": "valid", "data_format": "channels_last", "dilation_rate": [1, 1], "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "BatchNormalization", "config": {"name": "batch_normalization_12", "trainable": true, "axis": 3, "momentum": 0.99, "epsilon": 0.001, "center": true, "scale": true, "beta_initializer": {"class_name": "Zeros", "config": {}}, "gamma_initializer": {"class_name": "Ones", "config": {}}, "moving_mean_initializer": {"class_name": "Zeros", "config": {}}, "moving_variance_initializer": {"class_name": "Ones", "config": {}}, "beta_regularizer": null, "gamma_regularizer": null, "beta_constraint": null, "gamma_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_13", "trainable": true, "activation": "relu"}}, {"class_name": "Flatten", "config": {"name": "flatten_2", "trainable": true, "data_format": "channels_last"}}, {"class_name": "Dropout", "config": {"name": "dropout_2", "trainable": true, "rate": 0.5, "noise_shape": null, "seed": null}}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Activation", "config": {"name": "activation_14", "trainable": true, "activation": "sigmoid"}}]}, "keras_version": "2.2.4", "backend": "tensorflow"} -------------------------------------------------------------------------------- /osteoporosis/models/modelYaoC-1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/models/modelYaoC-1.h5 -------------------------------------------------------------------------------- /osteoporosis/models/modelYaoC.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/models/modelYaoC.h5 -------------------------------------------------------------------------------- /osteoporosis/models/modelYaoZ-1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/models/modelYaoZ-1.h5 -------------------------------------------------------------------------------- /osteoporosis/models/modelYaoZ.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang-de-lab/zhang-lab/5ef1054d5297c67f3b38c75e2e1512f742fe0ead/osteoporosis/models/modelYaoZ.h5 -------------------------------------------------------------------------------- /osteoporosis/shili_pre.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | import os, sys 4 | import scipy.io as sio 5 | import numpy as np 6 | from keras.models import model_from_json 7 | 8 | def loadmodels(): 9 | 10 | modelC1 = model_from_json(open('models/modelYao.json').read()) 11 | modelC1.load_weights('models/modelYaoC.h5') 12 | modelC2 = model_from_json(open('models/modelYao.json').read()) 13 | modelC2.load_weights('models/modelYaoC-1.h5') 14 | 15 | modelZ1 = model_from_json(open('models/modelYao.json').read()) 16 | modelZ1.load_weights('models/modelYaoZ.h5') 17 | modelZ2 = model_from_json(open('models/modelYao.json').read()) 18 | modelZ2.load_weights('models/modelYaoZ-1.h5') 19 | 20 | return modelC1, modelC2, modelZ1, modelZ2 21 | 22 | 23 | # modelC1, modelC2, modelZ1, modelZ2 = loadmodels() 24 | 25 | def pre_one(pre_batch, model): 26 | out = model.predict_on_batch(pre_batch) 27 | return np.mean(out) 28 | 29 | def pre_lumoral(path): 30 | data = sio.loadmat('mat/'+path) 31 | x1C = data['dataL1C'].astype('float32') 32 | x1C /= 255. 33 | x1Z = data['dataL1Z'].astype('float32') 34 | x1Z /= 255. 35 | x2C = data['dataL2C'].astype('float32') 36 | x2C /= 255. 37 | x2Z = data['dataL2Z'].astype('float32') 38 | x2Z /= 255. 39 | x3C = data['dataL3C'].astype('float32') 40 | x3C /= 255. 41 | x3Z = data['dataL3Z'].astype('float32') 42 | x3Z /= 255. 43 | x4C = data['dataL4C'].astype('float32') 44 | x4C /= 255. 45 | x4Z = data['dataL4Z'].astype('float32') 46 | x4Z /= 255. 47 | y = data['label'] 48 | modelC1, modelC2, modelZ1, modelZ2 = loadmodels() 49 | num11 = pre_one(x1C, modelC1) 50 | num12 = pre_one(x2C, modelC1) 51 | num13 = pre_one(x3C, modelC1) 52 | num14 = pre_one(x4C, modelC1) 53 | num21 = pre_one(x1Z, modelZ1) 54 | num22 = pre_one(x2Z, modelZ1) 55 | num23 = pre_one(x3Z, modelZ1) 56 | num24 = pre_one(x4Z, modelZ1) 57 | num = np.mean([num11, num21, num12, num22, num13, num23, num14, num24]) 58 | if num>=0.5: 59 | print('The predicted results are less than -2.5, The corresponding label is 0') 60 | print('The probability that the predicted result is less than -2.5 is ', num, ' label is:', y[0][0], '(0 means that T value is less than - 2.5, 1 means that T value is greater than - 2.5 is less than - 1, and 2 means that T value is greater than - 1)') 61 | return 62 | if num<0.5: 63 | num11 = pre_one(x1C, modelC2) 64 | num12 = pre_one(x2C, modelC2) 65 | num13 = pre_one(x3C, modelC2) 66 | num14 = pre_one(x4C, modelC2) 67 | num21 = pre_one(x1Z, modelZ2) 68 | num22 = pre_one(x2Z, modelZ2) 69 | num23 = pre_one(x3Z, modelZ2) 70 | num24 = pre_one(x4Z, modelZ2) 71 | num2 = np.mean([num11, num21, num12, num22, num13, num23, num14, num24]) 72 | if num2>=0.5: 73 | print('The predicted result is greater than - 1, and the corresponding label is 2.') 74 | else: 75 | print('The predicted results are between - 2.5 and - 1, and the corresponding label is 1.') 76 | print('The probability of the predicted results being greater than - 2.5 and greater than - 1 is respectively ', num, ',' , num2, ' label is', y[0][0], '(0 means that T value is less than - 2.5, 1 means that T value is greater than - 2.5 is less than - 1, and 2 means that T value is greater than - 1)') 77 | return 78 | --------------------------------------------------------------------------------