From markiewicz at stanford.edu Mon Jun 6 10:30:50 2022 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Mon, 6 Jun 2022 14:30:50 +0000 Subject: [Neuroimaging] ANN: NiBabel 4.0.0 release candidate Message-ID: Hi all, Just a quick announcement that I've pushed a release candidate for NiBabel 4.0 to PyPI, with a final release aiming for next week. This window is intended to allow downstream projects a chance to find breakage and report bugs before they start affecting many users, so please make sure to run tests with `pip install --pre nibabel` if you are not already. Please see the release notes here: https://github.com/nipy/nibabel/releases/tag/4.0.0rc0 These will also be updated in the docs shortly. Best, Chris Markiewicz -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdeck8317 at gmail.com Tue Jun 7 10:28:28 2022 From: bdeck8317 at gmail.com (Benjamin Deck) Date: Tue, 7 Jun 2022 10:28:28 -0400 Subject: [Neuroimaging] write_annotation issue in Nibabel Message-ID: Hi there, I am having an issue with writing an annotation file: ``` import numpy as np from nibabel import freesurfer from glob import glob lh_labels= glob('*lh*.label') # initialize variables lh_vertices = [] # initialize names list starting with 'unknown' names=['background'] for ii in lh_labels: lh_vertices.append(freesurfer.read_labels(ii)) names.append(os.path.basename(ii.split('.',1)[0])) lh_labels_array=np.concatente(lh_vertices) # load in long version of li 2016 parcellation including all 116 ROIs ctab_long=np.loadtxt(path_to_rgb, dtype='int') # create ctab with the appropriate length names_len=len(names) ctab=np.delete(ctab_long, slice(names_len,116),0) print('writing LH annotation file') freesurfer.write_annot(outpath + 'lh.li2019_parc.annot', labels=lh_labels_array, ctab=ctab, names=names) ``` However, I get the same error as @danjgale. ``` IndexError Traceback (most recent call last) in ----> 1 freesurfer.write_annot('lh.li2019_parc.annot', labels=lh_labels_array, ctab=ctab, names=names) c:\programdata\miniconda3\lib\site-packages\nibabel\freesurfer\io.py in write_annot(filepath, labels, ctab, names, fill_ctab) 542 543 # convert labels into coded CLUT values --> 544 clut_labels = ctab[:, -1][labels] 545 clut_labels[np.where(labels == -1)] = 0 546 IndexError: index 8505 is out of bounds for axis 0 with size 51 ``` If I print the variables and their shapes I get the following: ``` In [35]: len(names) Out[35]: 51 In [27]: names Out[27]: ['background', 'Net_10_ROIs_1_lh_native_dil2', 'Net_11_ROIs_1_lh_native_dil2', 'Net_12_ROIs_1_lh_native_dil2', 'Net_12_ROIs_2_lh_native_dil2', 'Net_13_ROIs_1_lh_native_dil2', ..... In [36]: ctab.shape Out[36]: (51, 4) In [32]: ctab Out[32]: array([[255, 255, 255, 0], [ 25, 5, 25, 255], [ 25, 100, 40, 255], [ 70, 130, 180, 255], .... ``` Would really appreciate any advice or help. -- *Benjamin L. Deck* *Doctoral Student* *Applied Cognitive and Brain Sciences* *Department of Psychological and Brain Sciences* *Drexel University* Virus-free. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: From samuel.debray at ens-paris-saclay.fr Tue Jun 28 12:04:18 2022 From: samuel.debray at ens-paris-saclay.fr (=?UTF-8?Q?=E2=80=AAsamuel=2Edebray=40ens-paris-saclay=2Efr=E2=80=AC?=) Date: Tue, 28 Jun 2022 18:04:18 +0200 Subject: [Neuroimaging] Z-map NiLearn compute_contrast Message-ID: <-yqp0ekownzbe-8xx8z7-2c2kgb-brc28e-63vz94-ibg3wlwvmfdp-r9y7ua-ykj4xf-n31fccnij3lv-gqq11s-r0hke6-tiv4sg-za1sea-541kwj-gpovhz3umcdj68thwz-aioght-fpak0pbfnhv-xvwshr.1656432258077@email.android.com> An HTML attachment was scrubbed... URL: