-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update radon_transform.py #2165
base: main
Are you sure you want to change the base?
Conversation
Is it possible to reflect that in the test suite? |
@@ -153,6 +153,11 @@ def iradon(radon_image, theta=None, output_size=None, | |||
Assume the reconstructed image is zero outside the inscribed circle. | |||
Also changes the default output_size to match the behaviour of | |||
``radon`` called with ``circle=True``. | |||
freqcutoff: float, optional (default 1, ie., no cutoff) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't specify default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also clean up above (remove braces after optional)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, above, output_size : int**, optional**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sciunto well this is not completely true :-). See for example transform.probabilistic_hough_line
where default values are given just after the type. It's the same for transform.radon
and transform.iradon
. I don't have strong feelings about this, but I think it can improve the readability of a docstring to put the default values on the same line as the parameter name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is freqcutoff
smaller or larger than 1? Please clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, these are mistakes and I had in mind that the standard is to do not specify values if there is signature inspection.
I base my judgement on this: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
and we follow numpy's standards.
Thanks for reporting and fixing this! I made few comments on the style and we would appreciate more tests on iradon to avoid that in the future :) |
|
||
# Change in the filter to adapte it to projection derivatives | ||
if derivative: | ||
fourier_filter = np.sign(f)*fourier_filter/(1j*np.pi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces around * and / operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sorry to be nitpicky about this @jcesardasilva but we try to enforce the PEP8 guidelines as possible (see https://www.python.org/dev/peps/pep-0008/) in order to have style consistency throughout the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We all have our favourite nitpicky stuffs :P
@scikit-image/core Is there anyone who is expert with radon who can approve these changes? @jcesardasilva Kind ping. Do you have time to make the changes I suggested? Your PR also needs a rebase. |
@sciunto what did you mean by "PR needs to be rebase"? This modified version of FBP has been used in the literature for years. |
@jcesardasilva It's because master evolved in parallel to your PR and there are merging conflicts that cannot be solved automatically. You need to do it manually. I can do it for you and make a PR against your branch if necessary. See |
Hi @jcesardasilva we're getting there :-). What remains to be done before we can merge your PR:
|
Ok, the time is quite short these days and I cannot do much, but I can give you already an idea of the test I made when I figured out the problem with the filter. The rest I do later, but I cannot do now. All the help is welcome.
` |
I have notice some small mistakes in the filters of the iradon in scikit-image/skimage/transform/radon_transform.py, in lines 208 up to 216. In some part where the division by 2 should exist, it does not, and vice-versa. See below the code lines with the corrections.
in scikit-image/skimage/transform/radon_transform.py, in lines 208 up to 216
This becomes more evident when using frequency cutoffs.
code
I also change the code to enable the reconstruction from differential projections like the ones taken with grating interferometer or to be insensitive to the big phase-wraps of ptychographic X-ray computed tomography dataset