Conversation
23e0e47 to
c6952fa
Compare
odl/phantom/transmission.py
Outdated
| i = (equation1 <= 1.0) | ||
|
|
||
| # Handle clipping surfaces | ||
| if nclip > 0: |
There was a problem hiding this comment.
No need for if here, the for loop will be empty and not run otherwise.
odl/phantom/transmission.py
Outdated
|
|
||
| # Handle clipping surfaces | ||
| if nclip > 0: | ||
| for j in range(1, nclip + 1): |
There was a problem hiding this comment.
j is not used so might as well for _ in range(nclip):
odl/phantom/transmission.py
Outdated
| transposeravel(ycoord) - phantomE[k, 1]]) | ||
| D = np.array([[1 / phantomE[k, 2], 0], | ||
| [0, 1 / phantomE[k, 3]]]) | ||
| phi = phantomE[k, 4] * np.pi / 180 |
odl/phantom/transmission.py
Outdated
| if nclip > 0: | ||
| for j in range(1, nclip + 1): | ||
| d = phantomC[0, nclipinfo] | ||
| psi = phantomC[1, nclipinfo] * np.pi / 180.0 |
| If true, insers a small resolution insert to the left. | ||
| ear : `bool` | ||
| If true, insers a ear-like structure to the right. | ||
| """ |
kohr-h
left a comment
There was a problem hiding this comment.
Cool phantom, just fix some minor stuff.
odl/phantom/transmission.py
Outdated
| resolution : `bool` | ||
| If true, insers a small resolution insert to the left. | ||
| ear : `bool` | ||
| If true, insers a ear-like structure to the right. |
odl/phantom/transmission.py
Outdated
| ---------- | ||
| resolution : `bool` | ||
| If true, insers a small resolution insert to the left. | ||
| ear : `bool` |
odl/phantom/transmission.py
Outdated
|
|
||
| Parameters | ||
| ---------- | ||
| resolution : `bool` |
odl/phantom/transmission.py
Outdated
| Parameters | ||
| ---------- | ||
| resolution : `bool` | ||
| If true, insers a small resolution insert to the left. |
There was a problem hiding this comment.
True
insert
resolution insert - ?? resolution test pattern?
| phantomC = C[:, :12] | ||
| else: | ||
| phantomE = np.vstack([leftear, E, E_cavity]) | ||
| phantomC = C |
There was a problem hiding this comment.
Did you come up with all that stuff yourself? If yes, great, if no, add a reference.
There was a problem hiding this comment.
There is a reference in the main function:
.. _algorithm: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3426508/
There was a problem hiding this comment.
I basically ported this to python
There was a problem hiding this comment.
Ah didn't see it. Okay, perhaps add it here too.
There was a problem hiding this comment.
a bit spammy to have it twice, especially given that this is a private function.
odl/phantom/transmission.py
Outdated
| resolution : `bool`, optional | ||
| If true, insers a small resolution insert to the left. | ||
| ear : `bool`, optional | ||
| If true, insers a ear-like structure to the right. |
There was a problem hiding this comment.
copy-paste from above - insert corrected version
odl/phantom/transmission.py
Outdated
| .. _algorithm: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3426508/ | ||
| """ | ||
| def transposeravel(arr): | ||
| """Implement matlabs ``transpose(arr(:))``.""" |
odl/phantom/transmission.py
Outdated
| [-np.sin(phi), np.cos(phi)]]) | ||
| f = phantomE[k, 5] | ||
| nclip = int(phantomE[k, 6]) | ||
| equation1 = np.sum(((D.dot(Q)).dot(Vx0))**2, axis=0) |
odl/phantom/transmission.py
Outdated
|
|
||
| See Also | ||
| -------- | ||
| shepp_logan : A more simple phantom with similar uses, also works in 3d. |
There was a problem hiding this comment.
simpler
for similar purposes
works -> working
odl/phantom/transmission.py
Outdated
| if not isinstance(space, DiscreteLp): | ||
| raise TypeError('`space` must be a `DiscreteLp`') | ||
| if not space.ndim == 2: | ||
| raise TypeError('`space` must be two dimensional') |
| If true, insers a small resolution insert to the left. | ||
| ear : `bool`, optional | ||
| If true, insers a ear-like structure to the right. | ||
|
|
221986c to
192d46d
Compare
|
Changes fixed. Merge after CI. |
This adds the FORBILD 2d phantom to the phantoms package:
At some point we should perhaps consider adding the 3d case, for that I would go for simply adding a phantom generator from the format specified by the phantomgruppe at Erlangen.