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

Allow a 0 value for output spacing when resampling #299

Merged
merged 1 commit into from Sep 7, 2017

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Sep 4, 2017

When resampling, allow the output spacing for any dimension to be set to 0 (the parameter 'resampledPixelSpacing' still needs to be a sequence of 3 elements, but the value of any element can be 0). Doing so will enable 'preserving' the original spacing, as 0 values are replaced with the spacing for that dimension as it is in the original (non-resampled) mask. This way, it is possible to only resample in-plane (by setting the out-of-plane output spacing to 0).

Additionally, move the check between original and resampled spacing to after the size check (no resampling over dimensions for which bounding box size = 1) and build in a tolerance (1e-5 + 1e-8 * abs(resampledspacing)).

Finally, fix data type for resampled spacing in the validation schema for parameter files (change from integer to float).

When resampling, allow the output spacing for any dimension to be set to 0 (the parameter 'resampledPixelSpacing' still needs to be a sequence of 3 elements, but the value of any element can be 0). Doing so will enable 'preserving' the original spacing, as 0 values are replaced with the original spacing for that dimension (original spacing of the mask). This way, it is possible to only resample in-plane (by setting the out-of-plane output spacing to 0).

Additionally, move the check between original and resampled spacing to after the size check (no resampling over dimensions for which bounding box size = 1) and build in a tolerance (1e-5 + 1e-8 * abs(resampledspacing)).

Finally, fix data type for resampled spacing in the validation schema for parameter files (change from integer to float).
@JoostJM JoostJM merged commit 4f9abf1 into AIM-Harvard:master Sep 7, 2017
@JoostJM JoostJM deleted the update-resampling branch September 7, 2017 15:34
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 this pull request may close these issues.

None yet

1 participant