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

BUG: use resampled mask for analysis #260

Merged
merged 3 commits into from
May 29, 2017

Conversation

fedorov
Copy link
Collaborator

@fedorov fedorov commented May 25, 2017

This resolves #259

In the situation when the mask was corrected to compensate for the differences
between the image and mask geometry, the updated mask was not propagated to be
used for feature calculation.

@fedorov fedorov requested a review from JoostJM May 25, 2017 20:10
@JoostJM
Copy link
Collaborator

JoostJM commented May 25, 2017 via email

@fedorov
Copy link
Collaborator Author

fedorov commented May 25, 2017

Tests broken! 😱

I wonder why is that, since the difference should be very tiny after resampling here: https://github.com/Radiomics/pyradiomics/blob/master/radiomics/imageoperations.py#L289

I actually don't have the notebooks set up to update those.

I need to leave very soon, and will be traveling from tomorrow until June 7, don't know how much time I will have (I have not finished preparations for the travels yet!) If you like, please update this branch. You should have the branch push access.

@fedorov
Copy link
Collaborator Author

fedorov commented May 25, 2017

I wonder why is that, since the difference should be very tiny after resampling here: https://github.com/Radiomics/pyradiomics/blob/master/radiomics/imageoperations.py#L289

I was mistaken the failing tests were caused by resampling, it was just that the test util was not updated. All nose tests are passing now (at least on CircleCI). If you could update the notebooks and merge, this would be great!

Copy link
Collaborator

@JoostJM JoostJM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, no comments on the active code in the core, just style stuff (causes flake8 to fail).

What is still missing is the updates of the examples and example notebooks where needed. This is the reason the CircleCI is currently failing (notebooks throw an error).

@@ -323,7 +323,11 @@ def execute(self, imageFilepath, maskFilepath, label=None):
return featureVector

# 2. Check whether loaded mask contains a valid ROI for feature extraction and get bounding box
boundingBox = imageoperations.checkMask(image, mask, **self.settings)
(boundingBox,correctedMask) = imageoperations.checkMask(image, mask, **self.settings)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be boundingBox, correctedMask or (boundingBox, correctedMask) (mind the space), otherwise flake8 will fail (as it currently does). parenthesis are redundant.

@@ -133,7 +133,9 @@ class or test case is changed, function returns True.
interpolator,
self._kwargs.get('label', 1),
self._kwargs.get('padDistance', 5))
bb = imageoperations.checkMask(self._image, self._mask)
(bb,correctedMask) = imageoperations.checkMask(self._image, self._mask)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@JoostJM
Copy link
Collaborator

JoostJM commented May 29, 2017

@fedorov, the changes in this PR have to be applied to helloFeatureClass, L49 and the first cell under Calculate features using original image in the helloFeatureClass notebook.
In the bin folder, it also has to be updated in addClassToBaseline.py, L77.
Finally, this change has to be listed in CHANGES.rst, after this PR can be merged.
I'd like to include this in the 1.2.0 release.

@JoostJM
Copy link
Collaborator

JoostJM commented May 29, 2017

@fedorov, I only just read your comment that you don't have jupyter set up, so I pushed the changes I proposed. If the tests pass, this branch can be merged.

@JoostJM JoostJM force-pushed the use-corrected-mask branch 2 times, most recently from 2c48dd8 to 6679133 Compare May 29, 2017 16:35
@fedorov
Copy link
Collaborator Author

fedorov commented May 29, 2017

Thank you Joost, and sorry for not making this a complete PR! As much as I would like to spend time writing code, today I first want to finish my slides for this week's meeting.

@JoostJM
Copy link
Collaborator

JoostJM commented May 29, 2017

@fedorov, no problem, PyRadiomics is a joint effort!

@fedorov fedorov force-pushed the use-corrected-mask branch from e887b3e to 6679133 Compare May 29, 2017 18:16
fedorov and others added 3 commits May 29, 2017 14:16
This resolves AIM-Harvard#259

In the situation when the mask was corrected to compensate for the differences
between the image and mask geometry, the updated mask was not propagated to be
used for feature calculation.
Apply style changes to prevent flake8 errors.
Apply changes in usage to the respective examples / scripts that make use of the `checkMask` function.
Additionally, document the changes this PR makes to PyRadiomics in the changelog.
@fedorov fedorov force-pushed the use-corrected-mask branch from 6679133 to 405f77b Compare May 29, 2017 18:16
@fedorov fedorov merged commit f8f65df into AIM-Harvard:master May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of mismatched size mask is still not working
2 participants