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

Misplaced parenthesis in -resample-mm #27

Open
cajgfinger opened this issue Feb 28, 2023 · 1 comment · May be fixed by #28
Open

Misplaced parenthesis in -resample-mm #27

cajgfinger opened this issue Feb 28, 2023 · 1 comment · May be fixed by #28

Comments

@cajgfinger
Copy link

cajgfinger commented Feb 28, 2023

In ConvertImageND.cxx, the computation of sz is wrong due to a misplaced parenthesis.
It changes the dimension by one in case of small spacing.

The change is small:
sz[i] = static_cast<size_t>((0.5 + sz[i] * m_ImageStack.back()->GetSpacing()[i]) / vox[i]);
should be
sz[i] = static_cast<size_t>((0.5 + sz[i] * m_ImageStack.back()->GetSpacing()[i] / vox[i]));
I can create a PR if needed

@cookpa
Copy link
Contributor

cookpa commented May 2, 2023

I had the same problem, it becomes a serious issue for small animal images. I made a PR #16

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

Successfully merging a pull request may close this issue.

2 participants