Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_dic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
ALVAREZ BARRIENTOS Felipe
dolfin_dic
Commits
e990ef4f
Commit
e990ef4f
authored
6 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
New box structure in generate images
parent
cde23e33
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generate_images.py
+11
-0
11 additions, 0 deletions
generate_images.py
with
11 additions
and
0 deletions
generate_images.py
+
11
−
0
View file @
e990ef4f
...
...
@@ -103,6 +103,10 @@ class Image():
# structure
if
(
structure
[
"
type
"
]
==
"
no
"
):
self
.
I0_structure
=
self
.
I0_structure_no
if
(
structure
[
"
type
"
]
==
"
box
"
):
self
.
I0_structure
=
self
.
I0_structure_box
self
.
Xmin
=
structure
[
"
Xmin
"
]
self
.
Xmax
=
structure
[
"
Xmax
"
]
elif
(
structure
[
"
type
"
]
==
"
heart
"
):
if
(
images
[
"
n_dim
"
]
==
2
):
self
.
I0_structure
=
self
.
I0_structure_heart_2
...
...
@@ -201,6 +205,13 @@ class Image():
i
[
0
]
=
1.
if
(
g
is
not
None
):
g
[:]
=
1.
# MG 20180806: gradient is given by texture; here it is just indicator function
def
I0_structure_box
(
self
,
X
,
i
,
g
=
None
):
if
numpy
.
greater_equal
(
X
,
self
.
Xmin
)
and
numpy
.
less_equal
(
X
,
self
.
Xmax
):
i
[
0
]
=
1.
else
:
i
[
0
]
=
0.
if
(
g
is
not
None
):
g
[:]
=
0.
# MG 20180806: gradient is given by texture; here it is just indicator function
def
I0_structure_heart_2
(
self
,
X
,
i
,
g
=
None
):
self
.
R
=
((
X
[
0
]
-
self
.
L
[
0
]
/
2
)
**
2
+
(
X
[
1
]
-
self
.
L
[
1
]
/
2
)
**
2
)
**
(
1.
/
2
)
if
(
self
.
R
>=
self
.
Ri
)
and
(
self
.
R
<=
self
.
Re
):
...
...
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