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] RegionExtractor does not have a two-tailed behavior. #4409

Open
3 of 9 tasks
bthirion opened this issue May 5, 2024 · 0 comments
Open
3 of 9 tasks

[BUG] RegionExtractor does not have a two-tailed behavior. #4409

bthirion opened this issue May 5, 2024 · 0 comments
Labels
Bug for bug reports

Comments

@bthirion
Copy link
Member

bthirion commented May 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Operating system

  • Linux
  • Mac
  • Windows

Operating system version

For example one of the following:

  • Linux Ubuntu 22.04
  • Mac OS Version 12 "monterey"
  • Windows 11

Python version

  • 3.12
  • 3.11
  • 3.10
  • 3.9
  • 3.8

nilearn version

0.10.2

Expected behavior

Region Extractor should include the possibility to extract only supra-threshold regions (on-sided behavior) --- an this should be the default IMHO. Currently it has a only the two-tailed behavior, meaning that tit won't distinguish between positive and negative regions.

Current behavior & error messages

This is what I got:

Figure_1

I would like to have
Figure_2

Steps and code to reproduce bug

from nilearn.regions import RegionExtractor
from nilearn import datasets
from nilearn.image import resample_to_img
from nilearn.plotting import plot_prob_atlas, plot_stat_map, show
from nilearn.image import concat_imgs

image = datasets.load_sample_motor_activation_image()
mask_img = datasets.load_mni152_gm_mask()
mask_img_ = resample_to_img(mask_img, image)
image = concat_imgs([image])
threshold = 0.0
 
extractor = RegionExtractor(
	maps_img=image,
	mask_img=mask_img_,
	min_region_size=1000,
	threshold=threshold,
	thresholding_strategy='img_value',
	extractor='connected_components', )

# Just call fit() to execute region extration procedure
coords = (15, -27, 46)
extractor.fit()
regions_img = extractor.regions_img_
plot_prob_atlas(regions_img, cut_coords=coords)
plot_stat_map(image, threshold=threshold, cut_coords=coords)

show()
@bthirion bthirion added the Bug for bug reports label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug for bug reports
Projects
None yet
Development

No branches or pull requests

1 participant