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

Fix warping #232

Merged
merged 2 commits into from Apr 8, 2020
Merged

Fix warping #232

merged 2 commits into from Apr 8, 2020

Conversation

Anneef
Copy link
Contributor

@Anneef Anneef commented Apr 6, 2020

Hi,
this fix corrects the warping of ROI and probability maps in segmentation.py. It had been done with using the forward direction of the warp operation used to warp native on template. Now it is done with the inverse, resulting in ROI and probmap, which were previously registered to template, being warped into native space.
Also, added debugging lines, which are currently commented-out, in preparation for an optional debugging feature mode that allows step by step tracking of problems with image registration.
_aNNe

Fixed warping of ROI and probability map from template space into native space. In

def prepare_map()            
replaced
    self.mapping = reg.read_mapping(mapping, self.img, reg_template, prealign=reg_prealign)
with
    self.mapping = reg.read_mapping(mapping, self.img, reg_template, prealign=np.linalg.inv(reg_prealign))

replaced the pre_align with its inverse _aNNe
that fixed the warped rois and the warped prob maps which had been warped wrongly
@pep8speaks
Copy link

Hello @Anneef! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 262:80: E501 line too long (81 > 79 characters)
Line 264:80: E501 line too long (92 > 79 characters)
Line 313:1: W293 blank line contains whitespace
Line 320:1: E265 block comment should start with '# '
Line 320:80: E501 line too long (92 > 79 characters)
Line 325:80: E501 line too long (92 > 79 characters)
Line 395:1: W293 blank line contains whitespace
Line 397:47: W291 trailing whitespace
Line 399:64: W291 trailing whitespace
Line 401:80: E501 line too long (128 > 79 characters)
Line 402:69: W291 trailing whitespace
Line 403:80: E501 line too long (119 > 79 characters)
Line 403:120: W291 trailing whitespace
Line 434:1: E265 block comment should start with '# '
Line 434:80: E501 line too long (104 > 79 characters)
Line 439:80: E501 line too long (92 > 79 characters)

@arokem
Copy link
Collaborator

arokem commented Apr 8, 2020

Thanks! I will go ahead and merge this and then go on to address the issues brought up in #233, as a way to better handle #235 and #234.

@arokem arokem merged commit 37309e6 into yeatmanlab:master Apr 8, 2020
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

3 participants