Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_warp
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Genet
dolfin_warp
Commits
8cbe4001
Commit
8cbe4001
authored
6 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
first attempt at using imaging model to generate images
parent
9bd509ef
No related branches found
No related tags found
1 merge request
!9
Generate image using imaging model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compute_unwarped_images.py
+3
-3
3 additions, 3 deletions
compute_unwarped_images.py
compute_warped_images.py
+13
-8
13 additions, 8 deletions
compute_warped_images.py
with
16 additions
and
11 deletions
compute_unwarped_images.py
+
3
−
3
View file @
8cbe4001
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
################################################################################
################################################################################
### ###
### ###
### Created by Martin Genet, 2012-2016 ###
### Created by Martin Genet, 2012-2016
###
### ###
### ###
### University of California at San Francisco (UCSF), USA ###
### University of California at San Francisco (UCSF), USA
###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland ###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland
###
### École Polytechnique, Palaiseau, France ###
### École Polytechnique, Palaiseau, France ###
### ###
### ###
################################################################################
################################################################################
...
...
This diff is collapsed.
Click to expand it.
compute_warped_images.py
+
13
−
8
View file @
8cbe4001
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
################################################################################
################################################################################
### ###
### ###
### Created by Martin Genet, 2012-2016 ###
### Created by Martin Genet, 2012-2016
###
### ###
### ###
### University of California at San Francisco (UCSF), USA ###
### University of California at San Francisco (UCSF), USA
###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland ###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland
###
### École Polytechnique, Palaiseau, France ###
### École Polytechnique, Palaiseau, France ###
### ###
### ###
################################################################################
################################################################################
...
@@ -27,6 +27,7 @@ def compute_warped_images(
...
@@ -27,6 +27,7 @@ def compute_warped_images(
working_folder
,
working_folder
,
working_basename
,
working_basename
,
ref_frame
=
0
,
ref_frame
=
0
,
ref_image_model
=
None
,
working_ext
=
"
vtu
"
,
working_ext
=
"
vtu
"
,
verbose
=
0
):
verbose
=
0
):
...
@@ -35,10 +36,11 @@ def compute_warped_images(
...
@@ -35,10 +36,11 @@ def compute_warped_images(
ref_image
=
myvtk
.
readImage
(
ref_image
=
myvtk
.
readImage
(
filename
=
ref_image_filename
)
filename
=
ref_image_filename
)
interpolator
=
myvtk
.
getImageInterpolator
(
if
(
ref_image_model
is
None
):
image
=
ref_image
)
ref_image_interpolator
=
myvtk
.
getImageInterpolator
(
#I = numpy.empty(1)
image
=
ref_image
)
#interpolator.Interpolate([0.35, 0.25, 0.], I)
#I = numpy.empty(1)
#ref_image_interpolator.Interpolate([0.35, 0.25, 0.], I)
image
=
vtk
.
vtkImageData
()
image
=
vtk
.
vtkImageData
()
image
.
SetOrigin
(
ref_image
.
GetOrigin
())
image
.
SetOrigin
(
ref_image
.
GetOrigin
())
...
@@ -102,7 +104,10 @@ def compute_warped_images(
...
@@ -102,7 +104,10 @@ def compute_warped_images(
image
.
GetPoint
(
k_point
,
x
)
image
.
GetPoint
(
k_point
,
x
)
scalars_U
.
GetTuple
(
k_point
,
U
)
scalars_U
.
GetTuple
(
k_point
,
U
)
X
=
x
-
U
X
=
x
-
U
interpolator
.
Interpolate
(
X
,
I
)
if
(
ref_image_model
is
None
):
ref_image_interpolator
.
Interpolate
(
X
,
I
)
else
:
I
[
0
]
=
ref_image_model
(
X
)
scalars
.
SetTuple
(
k_point
,
I
)
scalars
.
SetTuple
(
k_point
,
I
)
myvtk
.
writeImage
(
myvtk
.
writeImage
(
...
...
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