Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
School_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
encinass1u
School_project
Commits
40f1d43b
Commit
40f1d43b
authored
3 years ago
by
encinass1u
Browse files
Options
Downloads
Patches
Plain Diff
Cell behavior Codes
parent
885a50ec
No related branches found
No related tags found
1 merge request
!2
Update README.md
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cell_behavior_initial_steps/Gts_selection.py
+55
-0
55 additions, 0 deletions
Cell_behavior_initial_steps/Gts_selection.py
with
55 additions
and
0 deletions
Cell_behavior_initial_steps/Gts_selection.py
0 → 100644
+
55
−
0
View file @
40f1d43b
#Gst generator,it is possible to choose a type of texture for the cell couture.
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
#Selection of desire treated surface, Gts
First_Pickle
=
True
square_grid
=
False
highs_grid
=
False
diagonal
=
True
if
First_Pickle
==
True
:
#L is the matrix dimension
L
=
12
Lx
=
np
.
linspace
(
0
,
L
,
12
)
Ly
=
np
.
linspace
(
0
,
L
,
12
)
#G is the ground, an empty matrix to add the desire surface
G
=
np
.
zeros
((
L
,
L
))
#Gts us the ground for treated surface
Gts
=
copy
.
deepcopy
(
G
)
if
square_grid
==
True
:
# #Square grid
for
i
in
range
(
1
,
len
(
Lx
)
-
1
):
for
j
in
range
(
1
,
len
(
Ly
)
-
1
):
if
((
i
%
2
)
!=
0
)
or
((
j
%
2
)
==
0
):
Gts
[
i
,
j
]
=
0.5
elif
highs_grid
==
True
:
for
i
in
range
(
1
,
len
(
Lx
)
-
1
):
for
j
in
range
(
1
,
len
(
Ly
)
-
1
):
if
i
==
0
or
j
==
0
or
i
==
len
(
Lx
)
-
1
or
j
==
len
(
Ly
)
-
1
:
Gst
[
i
,
j
]
=
0.5
elif
i
==
1
or
j
==
1
or
i
==
len
(
Lx
)
-
2
or
j
==
len
(
Ly
)
-
2
:
Gts
[
i
,
j
]
=
0.7
elif
diagonal
==
True
:
for
i
in
range
(
1
,
len
(
Lx
)
-
1
):
for
j
in
range
(
1
,
len
(
Ly
)
-
1
):
if
(
i
==
j
):
Gts
[
i
,
j
]
=
0.5
else
:
with
open
(
'
G_surface_empty.pkl
'
,
'
rb
'
)
as
csv_file
:
Gts
=
pickle
.
load
(
csv_file
)
with
open
(
'
G_surface_empty.pkl
'
,
'
wb
'
)
as
csv_file
:
pickle
.
dump
(
Gts
,
csv_file
)
im
=
plt
.
imshow
(
Gts
,
cmap
=
"
copper_r
"
)
plt
.
show
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment