Skip to content

Resample one key to the spacing of another key #3245

Answered by rijobro
mattwarkentin asked this question in Q&A
Discussion options

You must be logged in to vote

Spacing returns a tuple of outputs: return output_data, affine, new_affine. You could do data[key] = spacer(data[key])[0], or more simply, you could probably do:

    def __call__(self, data):
        new_spacing = data[f'{self.template_key}_meta_dict']['spacing']
        return Spacingd(self.keys, new_spacing.tolist())(data)

i.e., pass the spacing on to Spacingd rather than Spacing.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mattwarkentin
Comment options

Answer selected by mattwarkentin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants