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

bugfix resample only if type is not contour or contourf #2656

Conversation

NicolasGensollen
Copy link
Member

Fixes #2537

See explanations in #2537.
Not sure this is the best fix although it's pretty straightforward.

@NicolasGensollen NicolasGensollen self-assigned this Jan 11, 2021
@codecov
Copy link

codecov bot commented Jan 11, 2021

Codecov Report

Merging #2656 (813802b) into master (e17395d) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2656      +/-   ##
==========================================
+ Coverage   87.57%   87.60%   +0.03%     
==========================================
  Files         100      100              
  Lines       13148    13159      +11     
  Branches     2552     2555       +3     
==========================================
+ Hits        11514    11528      +14     
+ Misses       1026     1024       -2     
+ Partials      608      607       -1     
Impacted Files Coverage Δ
nilearn/_utils/niimg.py 97.95% <100.00%> (+0.15%) ⬆️
nilearn/image/resampling.py 93.80% <100.00%> (+0.05%) ⬆️
nilearn/plotting/displays.py 88.78% <100.00%> (+0.02%) ⬆️
nilearn/reporting/_get_clusters_table.py 100.00% <0.00%> (+3.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e17395d...a49656c. Read the comment docs.

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Thx ! You probably want to add a test.

@@ -750,7 +750,10 @@ def add_contours(self, img, threshold=1e-6, filled=False, **kwargs):
def _map_show(self, img, type='imshow',
resampling_interpolation='continuous',
threshold=None, **kwargs):
img = reorder_img(img, resample=resampling_interpolation)
if _utils.niimg._is_binary_niimg(img):
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you should explain the logic implemented here.

@NicolasGensollen
Copy link
Member Author

@bthirion do you think there is still something to improve here ?

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM, thx !

@NicolasGensollen
Copy link
Member Author

Merging, thanks !

@NicolasGensollen NicolasGensollen merged commit 3fa34ba into nilearn:master Mar 8, 2021
@NicolasGensollen NicolasGensollen deleted the bugfix-add-contours-with-rotation branch March 8, 2021 08:50
bthirion added a commit to bthirion/nilearn that referenced this pull request May 19, 2021
* 'master' of github.com:nilearn/nilearn:
  Release 0.7.1 (nilearn#2727)
  Add two_sided flag to get_clusters_table (nilearn#2719)
  bugfix resample only if type is not contour or contourf (nilearn#2656)
  Support atlases in plot_carpet (nilearn#2702)
  Fix whatsnew entry with public function reference (nilearn#2716)
  EHN signal.clean standardise option PSC to allow negative mean signal  (nilearn#2714)
  Replace NaNs with zeros in NiftiLabelsMasker (nilearn#2712)
  [MRG] Allow asymmetric matrices in plot_connectome (nilearn#2703)
  [MRG] Mosaic mode of displaying brain images (nilearn#2684)
  Resampling functionality for NeuroVault (nilearn#2696)
  Solving "NiftiMapsMasker and NiftiLabelsMasker cannot transform 3D images" (nilearn#2708)
  Raise warning for FirstLevelModel fit when confounds and design_matrices are both specified (nilearn#2710)
  Fixed numpy warning when img has NaNs. (nilearn#2709)
  [MRG] High variance confounds in maskers (nilearn#2697)
  fix sampling (nilearn#2706)
  [MRG] Handle nans in surf plotting (nilearn#2691)
  [FIX] get_clusters_table: ensure input is 3D and accept filenames (nilearn#2701)
  Warn in nifti masker report when no image provided to fit (nilearn#2694)
  fix for FirstLevelModel compute_contrast for multiple runs with varying matrice size or columns (nilearn#2688)
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.

Rendering problems with add_contours when binary images have rotations set in the affine matrix
2 participants