From 29f675a4d42312b80f416a5d4993b0e6747a6b54 Mon Sep 17 00:00:00 2001 From: encinass1u <jessica-maria.encinas-silvas4@etu.univ-lorraine.fr> Date: Mon, 16 May 2022 07:06:04 +0000 Subject: [PATCH] Delete Uni_cell_add.py --- Cell_behavior_initial_steps/Uni_cell_add.py | 92 --------------------- 1 file changed, 92 deletions(-) delete mode 100644 Cell_behavior_initial_steps/Uni_cell_add.py diff --git a/Cell_behavior_initial_steps/Uni_cell_add.py b/Cell_behavior_initial_steps/Uni_cell_add.py deleted file mode 100644 index 0b4639f..0000000 --- a/Cell_behavior_initial_steps/Uni_cell_add.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Thu Apr 21 13:34:54 2022 - -@author: encinass1u -""" - -import numpy as np -import pickle -import random -import matplotlib.pyplot as ptl -import copy -from matplotlib import pyplot as plt -import random -from scipy import ndimage -from bio2mslib.inout.inout import WriteData as WD -import os - -#Empty matrix size declaration -lengthx = 12 -lengthy = 12 -G= np.zeros((lengthx,lengthy)) -ST = copy.deepcopy(G) - - -#Loop to add the \ surface -for i in range (0,12): - for j in range (0,12): - if (i == j): - ST[i,j]=0.5 - -#Pickle of the obtained matrix -with open('Cell_grid.pkl', 'wb') as csv_file: - pickle.dump(ST,csv_file) - -with open('Cell_grid.pkl', 'rb') as csv_file: - data_saved = pickle.load(csv_file) - - #print(data_saved) - -# print(type(ST)) -# #Visual preentation in image of the matrix -#im = plt.imshow(data_saved, cmap="copper_r") -#plt.colorbar(data_saved) #Error hereeeee -#plt.show() -#Create a copy of the initial surface to seed the cells -Z = copy.deepcopy(ST) - -im2 = plt.imshow(Z, cmap="copper_r") -plt.show() - -#incertion of a single cell to track its movement based on the simpspn model -uni_cell = Z[(5,4)] -Z[(5,4)] = 1 -iter = 1 -itermax = 5 -im2 = plt.imshow(Z, cmap="copper_r") -plt.show() -while iter<= itermax: - for i in range(0,12): - for j in range(0,12): - # if Zcopy[im,jm]>= 1: - # Zcopyinitial = copy.deepcopy(Zcopy[im,jm]) - - h = random.randint(-1,1) #horizontal value for the movement of the cell - v = random.randint(-1,1) #vertival value for the movement of the cell - if Z[i,j]>=uni_cell and (h != 0 or v!= 0): - Z[h + i, v + j]+=1 - Z[i,j]+= uni_cell - im2 = plt.imshow(Z, cmap="hot") - plt.show() - with open('Cell_migration_'+str(iter)+'.pkl', 'wb') as csv_file: - pickle.dump(Z,csv_file) - iter +=1 - # elif Z[i,j]>0.71 and (h != 0 or v!= 0): - # Z[h + i, v + j]= Z[i,j]+1 - # Z[i,j]+=1 - # #Print the image to locate the cell each iteration. - # #Saving the file of pickle - # im2 = plt.imshow(Z, cmap="copper_r") - # plt.show() - # with open('Cell_migration_'+str(iter)+'.pkl', 'wb') as csv_file: - # pickle.dump(Z,csv_file) - # iter +=1 - # Z[h + i, v + j]= 1 - # Z[i,j]= 0 - - - - - - -- GitLab