Skip to content
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

[Question] dipy/denoise/gibbs.py #2754

Closed
tashrifbillah opened this issue Mar 22, 2023 · 2 comments
Closed

[Question] dipy/denoise/gibbs.py #2754

tashrifbillah opened this issue Mar 22, 2023 · 2 comments

Comments

@tashrifbillah
Copy link
Contributor

dipy/dipy/denoise/gibbs.py

Lines 322 to 324 in 77afd60

# Copy data if not inplace
if not inplace:
vol = vol.copy()

The copied volume is overwritten below anyway:

dipy/dipy/denoise/gibbs.py

Lines 327 to 335 in 77afd60

if nd == 2:
vol[:, :] = _gibbs_removal_2d(vol, n_points=n_points, G0=G0, G1=G1)
else:
pool = Pool(num_processes)
partial_func = partial(
_gibbs_removal_2d, n_points=n_points, G0=G0, G1=G1
)
vol[:, :, :] = pool.map(partial_func, vol)

So what is the point of using inplace parameter?

@skoudoro
Copy link
Member

Good catch, I think this parameter is useless. Either we need to remove the parameter or make inplace=False work. Low priority.

Feel free to fix this issue @tashrifbillah !

@skoudoro
Copy link
Member

After playing with the code, I think I made a mistake. The inplace argument works as expected and avoid you to modify the input volume.

So closing the issue and the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants