From zhylka.ai at gmail.com Mon Oct 1 10:26:02 2018 From: zhylka.ai at gmail.com (Andrey Zhylka) Date: Mon, 1 Oct 2018 16:26:02 +0200 Subject: [Neuroimaging] DIPY peak_dir not normalised Message-ID: Dear all, I am quite a new user of DIPY, so when I checked the output of *dipy.direction.peaks_from_model* function I was a little puzzled by direction vectors not being normal and their length not corresponding to peak_values. Could anyone, please, explain, what is meant by peak_values and whether I may make use of peak direction vector length? With best regards, Andrey -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.hoffmann at tu-dresden.de Wed Oct 10 16:43:27 2018 From: nico.hoffmann at tu-dresden.de (Nico Hoffmann) Date: Wed, 10 Oct 2018 16:43:27 -0400 Subject: [Neuroimaging] deterministic tracking with TensorModel in dipy Message-ID: <93FE29B7-9384-4A37-9236-E7175C4A12CC@tu-dresden.de> Dear all, I?m currently implementing certain tractography workflows using dipy and I got spherical harmonics, constrained spherical deconvolution, etc. workflows up and running. However, I?m struggling with the simplest one - a single tensor model (DTI) workflow. I just can't figure out how to track fibres just using this model without any spherical harmonics, ... There are lots of tutorials explaining fibre tracking with quite complex models, yet these approaches (mostly utilizing peaks_from_model(..) ) don?t seem to be useful in case of a single tensor model. My current workflow is: [?] import dipy.reconst.dti as dti ccseeds = seeds_from_mask(ccmask, affine=aff) binary_classifier = BinaryTissueClassifier(binarymask == 1) start_time = time.time() dti_wls = dti.TensorModel(gtab_subset) fit_wls = dti_wls.fit(dwi_subset) runtime = time.time() - start_time print('Runtime ' + str(runtime) + 's?) ??? streamlines_generator = LocalTracking(???, binary_classifier, ccseeds, aff, step_size=.1) streamlines = Streamlines(streamlines_generator) I?d really appreciate any help! Thank you, Nico -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 874 bytes Desc: Message signed with OpenPGP URL: From elef at indiana.edu Wed Oct 10 17:52:20 2018 From: elef at indiana.edu (Eleftherios Garyfallidis) Date: Wed, 10 Oct 2018 17:52:20 -0400 Subject: [Neuroimaging] deterministic tracking with TensorModel in dipy In-Reply-To: <93FE29B7-9384-4A37-9236-E7175C4A12CC@tu-dresden.de> References: <93FE29B7-9384-4A37-9236-E7175C4A12CC@tu-dresden.de> Message-ID: The fit_wls object provides the eigen_directions and eigen_values. These are very similar to the concept of peak_directions and peak_values. So all you need to do is wrap them in a PeaksAndMetrics object and give it as input to the local tracker. Let me know if this is clear. On Wed, Oct 10, 2018 at 5:06 PM Nico Hoffmann wrote: > Dear all, > > I?m currently implementing certain tractography workflows using dipy and I > got spherical harmonics, constrained spherical deconvolution, etc. > workflows up and running. However, I?m struggling with the simplest one - a > single tensor model (DTI) workflow. I just can't figure out how to track > fibres just using this model without any spherical harmonics, ... There are > lots of tutorials explaining fibre tracking with quite complex models, yet > these approaches (mostly utilizing peaks_from_model(..) ) don?t seem to be > useful in case of a single tensor model. > > > My current workflow is: > > [?] > import dipy.reconst.dti as dti > > ccseeds = seeds_from_mask(ccmask, affine=aff) > binary_classifier = BinaryTissueClassifier(binarymask == 1) > > start_time = time.time() > dti_wls = dti.TensorModel(gtab_subset) > fit_wls = dti_wls.fit(dwi_subset) > runtime = time.time() - start_time > print('Runtime ' + str(runtime) + 's?) > > ??? > > streamlines_generator = LocalTracking(???, binary_classifier, ccseeds, > aff, step_size=.1) > streamlines = Streamlines(streamlines_generator) > > > I?d really appreciate any help! > > > Thank you, > Nico > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skoudoro at iu.edu Thu Oct 11 14:00:16 2018 From: skoudoro at iu.edu (Koudoro, Serge) Date: Thu, 11 Oct 2018 18:00:16 +0000 Subject: [Neuroimaging] DIPY peak_dir not normalised In-Reply-To: References: Message-ID: <1539280816582.57628@iu.edu> Hello Andrey, Thank you for your question. The peak_directions have unit norm and their length is saved in peak_values. This helps supporting different tracking strategies. Sometimes; people use the length and often not. That is why these are separate. Of course you can multiple the two matrices together to get the complete vectors. Let us know if you need more information. Cheers, Serge ? ________________________________ From: Neuroimaging on behalf of Andrey Zhylka Sent: Monday, October 1, 2018 9:26 AM To: neuroimaging at python.org Subject: [Neuroimaging] DIPY peak_dir not normalised Dear all, I am quite a new user of DIPY, so when I checked the output of dipy.direction.peaks_from_model function I was a little puzzled by direction vectors not being normal and their length not corresponding to peak_values. Could anyone, please, explain, what is meant by peak_values and whether I may make use of peak direction vector length? With best regards, Andrey -------------- next part -------------- An HTML attachment was scrubbed... URL: From saggar at stanford.edu Wed Oct 10 14:57:08 2018 From: saggar at stanford.edu (Manish Saggar) Date: Wed, 10 Oct 2018 18:57:08 +0000 Subject: [Neuroimaging] Postdoctoral positions available Message-ID: [https://tr.cloudmagic.com/h/v6/emailtag/tag/2.0/1539197810/b66430ca7e69eb44a2365b99bb8d8527/2/37dc7c4101057d665b3af19baa29b2ed/91e47bcc09b97ecb510bd665381a6240/9efab2399c7c560b34de477b9aa0a465/newton.gif] [Apologies for cross-posting] The Brain Dynamics Lab (http://bdl.stanford.edu) at Stanford is looking to hire 1-2 postdocs with expertise in neuroimaging data analysis to develop/apply computational methods that can quantify transitions in brain activity (or connectivity) in health and disease (specifically, major depression and ADHD). We use a number of neuroimaging modalities including simultaneous EEG-fMRI and EEG-fNIRS, structural/functional connectivity, and independent fMRI/fNIRS/EEG. We also use computational modeling (e.g., The Virtual Brain) for realistic bio-physical network model simulations and neuromodulation (e.g., TMS) to gain mechanistic understandings for the observed aberrant brain dynamics in patients with psychiatric illness. Other computational tools used in the lab include Topological Data Analysis (TDA) - including Mapper and Persistent Homology - and Deep Learning (DL). Stanford University is located in sunny northern California, deep in the heart of Silicon Valley and a short train ride to San Francisco. The postdoc will be able to contribute to a number of ongoing research projects in our lab and collaborating labs by analyzing neuroimaging data from those studies. In addition, the postdoc will have the opportunity to develop their own research program with the domain of scientific or methodological problems currently being investigated within the lab (http://bdl.stanford.edu). The successful candidate should: ? Have a PhD in a relevant field of study and demonstrated experience with the processing and statistical analysis of neuroimaging data. ? Have strong and demonstrated computer programming skills, including Python. Experience with Nipype is preferred. ? Have strong skills in statistics and machine learning (esp. TDA, DL, etc.) ? Have solid experience with computational data analysis, including strong UNIX/Linux skills and experience using high performance computing clusters. Our lab is strongly committed to diversity in science, and we particularly welcome applications from members of traditionally underrepresented groups. Interested candidates should email the following to saggar at stanford.edu: ? A cover letter describing your background and research interests ? CV ? Names and email addresses of two references The initial position is for one year, with the option to renew for 2-3 years, given satisfactory performance and available funding. The positions are available immediately and applicants will be considered on a rolling basis. m- Manish Saggar, Ph.D. Assistant Professor, Psychiatry Stanford University http://bdl.stanford.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.rey.lopez at outlook.com Mon Oct 15 06:17:07 2018 From: jose.rey.lopez at outlook.com (=?utf-8?B?Sm9zw6kgUmV5?=) Date: Mon, 15 Oct 2018 10:17:07 +0000 Subject: [Neuroimaging] BCI master Message-ID: Hi, I?m a physics graduate looking for a master in Brain-computer interface, I?m interested EEG & fmri data processing, statistical analysis, DL and I have experience in most of those fields amd strong programming skills. Looking for a career in the field. I don?t care about the country. Contact info: jose.rey.lopez at outlook.com Thank you From arokem at gmail.com Mon Oct 15 18:12:06 2018 From: arokem at gmail.com (Ariel Rokem) Date: Mon, 15 Oct 2018 15:12:06 -0700 Subject: [Neuroimaging] deterministic tracking with TensorModel in dipy In-Reply-To: References: <93FE29B7-9384-4A37-9236-E7175C4A12CC@tu-dresden.de> Message-ID: Hi Nico, Just to follow up on Eleftherios' comments, here is a simple example that I think does something like what you want to do: [...] from dipy.direction import DeterministicMaximumDirectionGetter, ProbabilisticDirectionGetter # Choose one of the following: dg = DeterministicMaximumDirectionGetter # If you want deterministic tracking dg = ProbabilisticDirectionGetter # If you prefer probabilistic tracking dg = dg.from_pmf(fit_wls.odf) # This uses the eigenvalues and eigenvectors to generate a probability mass function streamlines_generator = LocalTracking(dg, binary_classifier, ccseeds, aff, step_size=.1) [...] On Wed, Oct 10, 2018 at 2:54 PM Eleftherios Garyfallidis wrote: > The fit_wls object provides the eigen_directions and eigen_values. These > are very similar to the concept of peak_directions and peak_values. > So all you need to do is wrap them in a PeaksAndMetrics object and give it > as input to the local tracker. > > Let me know if this is clear. > > On Wed, Oct 10, 2018 at 5:06 PM Nico Hoffmann > wrote: > >> Dear all, >> >> I?m currently implementing certain tractography workflows using dipy and >> I got spherical harmonics, constrained spherical deconvolution, etc. >> workflows up and running. However, I?m struggling with the simplest one - a >> single tensor model (DTI) workflow. I just can't figure out how to track >> fibres just using this model without any spherical harmonics, ... There are >> lots of tutorials explaining fibre tracking with quite complex models, yet >> these approaches (mostly utilizing peaks_from_model(..) ) don?t seem to be >> useful in case of a single tensor model. >> >> >> My current workflow is: >> >> [?] >> import dipy.reconst.dti as dti >> >> ccseeds = seeds_from_mask(ccmask, affine=aff) >> binary_classifier = BinaryTissueClassifier(binarymask == 1) >> >> start_time = time.time() >> dti_wls = dti.TensorModel(gtab_subset) >> fit_wls = dti_wls.fit(dwi_subset) >> runtime = time.time() - start_time >> print('Runtime ' + str(runtime) + 's?) >> >> ??? >> >> streamlines_generator = LocalTracking(???, binary_classifier, ccseeds, >> aff, step_size=.1) >> streamlines = Streamlines(streamlines_generator) >> >> >> I?d really appreciate any help! >> >> >> Thank you, >> Nico >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markiewicz at stanford.edu Tue Oct 16 19:40:02 2018 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Tue, 16 Oct 2018 23:40:02 +0000 Subject: [Neuroimaging] ANN: Nibabel release 2.3.1 Message-ID: Hi all, Nibabel 2.3.1 has been released. This is mostly a bug fix release, but it does feature the new nib-diff utility that Yarik and Chris Cheng have been working on. As always, thanks to all contributors, reviewers and users. Please cite using the Zenodo DOI: https://doi.org/10.5281/zenodo.1464282 The full changelog follows: Bug fix release for the 2.3 series. Most work on NiBabel so far has been by Matthew Brett (MB), Michael Hanke (MH) Ben Cipollini (BC), Marc-Alexandre C?t? (MC), Chris Markiewicz (CM), Stephan Gerhard (SG), Eric Larson (EL), Yaroslav Halchenko (YOH) and Chris Cheng (CC). References like "pr/298" refer to github pull request numbers. New features ------------ * ``nib-diff`` command line tool for comparing image files (pr/617, pr/672, pr/678) (CC, reviewed by YOH, Pradeep Raamana and CM) Enhancements ------------ * Speed up reading of numeric arrays in CIFTI2 (pr/655) (Michiel Cottaar, reviewed by CM) * Add ``ndim`` property to ``ArrayProxy`` and ``DataobjImage`` (pr/674) (CM, reviewed by MB) Bug fixes --------- * Deterministic deduction of slice ordering in degenerate cases (pr/647) (YOH, reviewed by CM) * Allow 0ms TR in MGH files (pr/653) (EL, reviewed by CM) * Allow for PPC64 little-endian long doubles (pr/658) (MB, reviewed by CM) * Correct construction of FreeSurfer annotation labels (pr/666) (CM, reviewed by EL, Paul D. McCarthy) * Fix logic for persisting filehandles with indexed-gzip (pr/679) (Paul D. McCarthy, reviewed by CM) Maintenance ----------- * Fix semantic error in coordinate systems documentation (pr/646) (Ariel Rokem, reviewed by CM, MB) * Test on Python 3.7, minor associated fixes (pr/651) (CM, reviewed by Gregory R. Lee, MB) -- Chris Markiewicz Center for Reproducible Neuroscience Stanford University -------------- next part -------------- An HTML attachment was scrubbed... URL: From seralouk at hotmail.com Wed Oct 17 04:34:24 2018 From: seralouk at hotmail.com (serafim loukas) Date: Wed, 17 Oct 2018 08:34:24 +0000 Subject: [Neuroimaging] Nibabel get_fdata() Message-ID: Dear Experts, I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. When I use the get_fdata() command, it takes a lot of time to load the image. On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. Am I missing something? Is there any way to make get_fdata() faster? Best, Serafim -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Wed Oct 17 06:49:52 2018 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 17 Oct 2018 11:49:52 +0100 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: References: Message-ID: Hi, Can you post an image somewhere for us to try? Are your images on your local hard disk? Cheers, Matthew On Wed, Oct 17, 2018 at 10:07 AM serafim loukas wrote: > > Dear Experts, > > > > I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). > My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. > > When I use the get_fdata() command, it takes a lot of time to load the image. > On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. > > Am I missing something? Is there any way to make get_fdata() faster? > > > > Best, > Serafim > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging From matthew.brett at gmail.com Wed Oct 17 07:01:07 2018 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 17 Oct 2018 12:01:07 +0100 Subject: [Neuroimaging] ANN: Nibabel release 2.3.1 In-Reply-To: References: Message-ID: Hi Chris, On Wed, Oct 17, 2018 at 12:40 AM Christopher Markiewicz wrote: > > Hi all, > > > Nibabel 2.3.1 has been released. This is mostly a bug fix release, but it does feature the new nib-diff utility that Yarik and Chris Cheng have been working on. > > As always, thanks to all contributors, reviewers and users. > > Please cite using the Zenodo DOI: https://doi.org/10.5281/zenodo.1464282 Great work - and many thanks, Cheers, Matthew From seralouk at hotmail.com Wed Oct 17 08:19:40 2018 From: seralouk at hotmail.com (serafim loukas) Date: Wed, 17 Oct 2018 12:19:40 +0000 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: References: Message-ID: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Hello, The images are on my local HD. The file is around 60GB. Here is my code to demonstrate this: import nibabel as nib data = nib.load('wBOLD.nii') slices_fast = data.get_data()[:,:,:,0] slices_slow = data.get_fdata()[:,:,:,0] And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. In this case, what is the difference between the 2 commands ? Best, Serafim On 17 Oct 2018, at 12:49, Matthew Brett > wrote: Hi, Can you post an image somewhere for us to try? Are your images on your local hard disk? Cheers, Matthew On Wed, Oct 17, 2018 at 10:07 AM serafim loukas > wrote: Dear Experts, I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. When I use the get_fdata() command, it takes a lot of time to load the image. On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. Am I missing something? Is there any way to make get_fdata() faster? Best, Serafim _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Wed Oct 17 10:03:13 2018 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 17 Oct 2018 15:03:13 +0100 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> References: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: Hi, On Wed, Oct 17, 2018 at 1:20 PM serafim loukas wrote: > > Hello, > > > The images are on my local HD. > The file is around 60GB. > > Here is my code to demonstrate this: > > import nibabel as nib > > data = nib.load('wBOLD.nii') > slices_fast = data.get_data()[:,:,:,0] > slices_slow = data.get_fdata()[:,:,:,0] > > And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 > > > I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. > In this case, what is the difference between the 2 commands ? I'm guessing from the above, that you're getting better performance from `get_data`. This is because, in your case, you have a 32-bit float image, that doesn't have any scalefactors, so the optimized path for you, is to use a memory mapped version of the array. This is what happens for `get_data`, but for various reasons, `get_fdata` always returns 64-bit floats, so inflating memory, and making it impossible to use memory mapping (because the image data type is not the same). Cheers, Matthew From seralouk at hotmail.com Wed Oct 17 10:10:13 2018 From: seralouk at hotmail.com (serafim loukas) Date: Wed, 17 Oct 2018 14:10:13 +0000 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: References: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: Hello, That explains a lot. Thank you. I just did a small test and I found out that the result of my analysis is the same regardless the command I use. However, I will prefer get_data() since it?s super fast in my case. Best, Serafim > On 17 Oct 2018, at 16:03, Matthew Brett wrote: > > Hi, > On Wed, Oct 17, 2018 at 1:20 PM serafim loukas wrote: >> >> Hello, >> >> >> The images are on my local HD. >> The file is around 60GB. >> >> Here is my code to demonstrate this: >> >> import nibabel as nib >> >> data = nib.load('wBOLD.nii') >> slices_fast = data.get_data()[:,:,:,0] >> slices_slow = data.get_fdata()[:,:,:,0] >> >> And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 >> >> >> I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. >> In this case, what is the difference between the 2 commands ? > > I'm guessing from the above, that you're getting better performance > from `get_data`. This is because, in your case, you have a 32-bit > float image, that doesn't have any scalefactors, so the optimized path > for you, is to use a memory mapped version of the array. This is what > happens for `get_data`, but for various reasons, `get_fdata` always > returns 64-bit floats, so inflating memory, and making it impossible > to use memory mapping (because the image data type is not the same). > > Cheers, > > Matthew > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging From njvack at wisc.edu Wed Oct 17 10:12:57 2018 From: njvack at wisc.edu (Nate Vack) Date: Wed, 17 Oct 2018 09:12:57 -0500 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: <23019_1539778808_0PGQ00C7TSXJCH00_9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> References: <23019_1539778808_0PGQ00C7TSXJCH00_9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: The docs: http://nipy.org/nibabel/reference/nibabel.dataobj_images.html#nibabel.dataobj_images.DataobjImage.get_data say that get_data() is deprecated, and the forward-compatible way to get at your data without casting would be: import nibabel as nib import numpy as np data = nib.load('wBOLD.nii') data_arr = np.asanyarray(data.dataobj) For some reason, that seems to be returning an array made completely of nan, though, which is weird? Any operations on a 60G array will, of course, be pretty slow. Aside: It might be useful for there to be a get_data_without_cast() method or such; the np.asanyarray() trick is not particularly intuitive. I remember this question came up here before, though, so maybe there's a reason that's a bad idea... -n On Wed, Oct 17, 2018 at 7:20 AM serafim loukas wrote: > Hello, > > > The images are on my local HD. > The file is around 60GB. > > Here is my code to demonstrate this: > > *import nibabel as nib* > > *data = nib.load('wBOLD.nii')* > *slices_fast = data.get_data()[:,:,:,0]* > *slices_slow = data.get_fdata()[:,:,:,0]* > > And here you can find the file compressed: > https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 > > > I was thinking to use *get_data() instead of get_fdata() *and then > conduct some analysis. > In this case, what is the difference between the 2 commands ? > > > Best, > Serafim > > > On 17 Oct 2018, at 12:49, Matthew Brett wrote: > > Hi, > > Can you post an image somewhere for us to try? > > Are your images on your local hard disk? > > Cheers, > > Matthew > On Wed, Oct 17, 2018 at 10:07 AM serafim loukas > wrote: > > > Dear Experts, > > > > I have some neuroimaging data and I would like to use Nibabel instead of > SPM (matlab). > My goal is to load brain images, then vectorise them and finally do some > analysis on these vectors. > > When I use the get_fdata() command, it takes a lot of time to load the > image. > On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) > in terms of loading the data. > > Am I missing something? Is there any way to make get_fdata() faster? > > > > Best, > Serafim > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seralouk at hotmail.com Wed Oct 17 11:17:09 2018 From: seralouk at hotmail.com (serafim loukas) Date: Wed, 17 Oct 2018 15:17:09 +0000 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: References: <23019_1539778808_0PGQ00C7TSXJCH00_9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: <127E9050-ED0D-4E02-A455-F4F41E2D2260@hotmail.com> The resulted vector contains indeed nans. This is normal due to the way that the data were constructed. I remove them afterwards. data_arr = np.asanyarray(data.dataobj) Seems to work fine and its fast as well. Thanks, S On 17 Oct 2018, at 16:12, Nate Vack via Neuroimaging > wrote: The docs: http://nipy.org/nibabel/reference/nibabel.dataobj_images.html#nibabel.dataobj_images.DataobjImage.get_data say that get_data() is deprecated, and the forward-compatible way to get at your data without casting would be: import nibabel as nib import numpy as np data = nib.load('wBOLD.nii') data_arr = np.asanyarray(data.dataobj) For some reason, that seems to be returning an array made completely of nan, though, which is weird? Any operations on a 60G array will, of course, be pretty slow. Aside: It might be useful for there to be a get_data_without_cast() method or such; the np.asanyarray() trick is not particularly intuitive. I remember this question came up here before, though, so maybe there's a reason that's a bad idea... -n On Wed, Oct 17, 2018 at 7:20 AM serafim loukas > wrote: Hello, The images are on my local HD. The file is around 60GB. Here is my code to demonstrate this: import nibabel as nib data = nib.load('wBOLD.nii') slices_fast = data.get_data()[:,:,:,0] slices_slow = data.get_fdata()[:,:,:,0] And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. In this case, what is the difference between the 2 commands ? Best, Serafim On 17 Oct 2018, at 12:49, Matthew Brett > wrote: Hi, Can you post an image somewhere for us to try? Are your images on your local hard disk? Cheers, Matthew On Wed, Oct 17, 2018 at 10:07 AM serafim loukas > wrote: Dear Experts, I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. When I use the get_fdata() command, it takes a lot of time to load the image. On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. Am I missing something? Is there any way to make get_fdata() faster? Best, Serafim _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From markiewicz at stanford.edu Wed Oct 17 10:26:34 2018 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Wed, 17 Oct 2018 14:26:34 +0000 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> References: , <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: Hi Serafim, Matthew's analysis is correct, but just to let you know, get_data will be deprecated in the near future, so it's worth figuring out how to do what you want with the more consistent APIs. get_fdata will by default return 64-bit floats, but you can provide any dtype you like. If you have 32-bit float data, you can use get_fdata(np.float32). I believe that will simply return the memory-mapped array without loading the whole thing into memory. Another approach is to slice the image, to ensure that you retain any scale factors, before calling get_fdata(): import numpy as np import nibabel as nib data = nib.load('wBOLD.nii') fast_fdata = data.slicer[..., 0].get_fdata() This takes advantage of the optimizations that have been built into the data objects, while preserving the image API, but you can also directly interact with the data object, which allows you to slice efficiently while performing any necessary scaling: flexible = data.dataobj[..., 0] flexible_and_typed = data.dataobj[..., 0].astype(np.float32) For more details, please see: http://nipy.org/nibabel/nibabel_images.html#array-proxies-and-proxy-images And let us know if there's anything unclear in the docs. Chris ________________________________ From: Neuroimaging on behalf of serafim loukas Sent: Wednesday, October 17, 2018 8:19:40 AM To: Neuroimaging analysis in Python Subject: Re: [Neuroimaging] Nibabel get_fdata() Hello, The images are on my local HD. The file is around 60GB. Here is my code to demonstrate this: import nibabel as nib data = nib.load('wBOLD.nii') slices_fast = data.get_data()[:,:,:,0] slices_slow = data.get_fdata()[:,:,:,0] And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. In this case, what is the difference between the 2 commands ? Best, Serafim On 17 Oct 2018, at 12:49, Matthew Brett > wrote: Hi, Can you post an image somewhere for us to try? Are your images on your local hard disk? Cheers, Matthew On Wed, Oct 17, 2018 at 10:07 AM serafim loukas > wrote: Dear Experts, I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. When I use the get_fdata() command, it takes a lot of time to load the image. On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. Am I missing something? Is there any way to make get_fdata() faster? Best, Serafim _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From gael.varoquaux at normalesup.org Wed Oct 17 13:36:02 2018 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Wed, 17 Oct 2018 19:36:02 +0200 Subject: [Neuroimaging] Nilearn 0.5 beta release Message-ID: <20181017173602.tka3pf6rt36q2hpt@phare.normalesup.org> Hi Pythonista, We have just release Nilearn 0.5 beta: http://nilearn.github.io/whats_new.html The highlight is off course the interactive plotting: http://nilearn.github.io/plotting/index.html#interactive-plots though I do hope that it will change soon for lighter plots that have better controlled aesthetics thanks to a pull request by Pierre Bellec: https://github.com/nilearn/nilearn/pull/1766 Thanks a lot to everyone involved, and in particular to Kshitij for hard work assembling the release. This is still a beta, which means that it is not installed on users' computers if they don't use the '--pre' switch to pip. I don't want this to last long, and I really hope that we should be able to release the final soon, with the restyled interactive plots. In the mean time, feedback welcomed! (as issues on the tracker), Ga?l From seralouk at hotmail.com Wed Oct 17 15:17:45 2018 From: seralouk at hotmail.com (serafim loukas) Date: Wed, 17 Oct 2018 19:17:45 +0000 Subject: [Neuroimaging] Nibabel get_fdata() In-Reply-To: References: <9317FF3F-89D1-4CAC-9E7E-F230BE27CE44@hotmail.com> Message-ID: Thank you for this detailed answer. What about data = np.asanyarray(data.dataobj) ? I think this is what I need right now. On 17 Oct 2018, at 16:26, Christopher Markiewicz > wrote: Hi Serafim, Matthew's analysis is correct, but just to let you know, get_data will be deprecated in the near future, so it's worth figuring out how to do what you want with the more consistent APIs. get_fdata will by default return 64-bit floats, but you can provide any dtype you like. If you have 32-bit float data, you can use get_fdata(np.float32). I believe that will simply return the memory-mapped array without loading the whole thing into memory. Another approach is to slice the image, to ensure that you retain any scale factors, before calling get_fdata(): import numpy as np import nibabel as nib data = nib.load('wBOLD.nii') fast_fdata = data.slicer[..., 0].get_fdata() This takes advantage of the optimizations that have been built into the data objects, while preserving the image API, but you can also directly interact with the data object, which allows you to slice efficiently while performing any necessary scaling: flexible = data.dataobj[..., 0] flexible_and_typed = data.dataobj[..., 0].astype(np.float32) For more details, please see: http://nipy.org/nibabel/nibabel_images.html#array-proxies-and-proxy-images And let us know if there's anything unclear in the docs. Chris ________________________________ From: Neuroimaging > on behalf of serafim loukas > Sent: Wednesday, October 17, 2018 8:19:40 AM To: Neuroimaging analysis in Python Subject: Re: [Neuroimaging] Nibabel get_fdata() Hello, The images are on my local HD. The file is around 60GB. Here is my code to demonstrate this: import nibabel as nib data = nib.load('wBOLD.nii') slices_fast = data.get_data()[:,:,:,0] slices_slow = data.get_fdata()[:,:,:,0] And here you can find the file compressed: https://drive.google.com/open?id=1BkClOxytqUKtv5Zt7fMr2P-kvzJ5OKS0 I was thinking to use get_data() instead of get_fdata() and then conduct some analysis. In this case, what is the difference between the 2 commands ? Best, Serafim On 17 Oct 2018, at 12:49, Matthew Brett > wrote: Hi, Can you post an image somewhere for us to try? Are your images on your local hard disk? Cheers, Matthew On Wed, Oct 17, 2018 at 10:07 AM serafim loukas > wrote: Dear Experts, I have some neuroimaging data and I would like to use Nibabel instead of SPM (matlab). My goal is to load brain images, then vectorise them and finally do some analysis on these vectors. When I use the get_fdata() command, it takes a lot of time to load the image. On the other hand, SPM is faster (spm_read_vols(spm_vol(my_image_path))) in terms of loading the data. Am I missing something? Is there any way to make get_fdata() faster? Best, Serafim _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbpoline at gmail.com Thu Oct 18 00:32:57 2018 From: jbpoline at gmail.com (JB Poline) Date: Wed, 17 Oct 2018 21:32:57 -0700 Subject: [Neuroimaging] Nilearn 0.5 beta release In-Reply-To: <20181017173602.tka3pf6rt36q2hpt@phare.normalesup.org> References: <20181017173602.tka3pf6rt36q2hpt@phare.normalesup.org> Message-ID: congrats ! On Wed, Oct 17, 2018 at 10:36 AM Gael Varoquaux < gael.varoquaux at normalesup.org> wrote: > Hi Pythonista, > > We have just release Nilearn 0.5 beta: > http://nilearn.github.io/whats_new.html > The highlight is off course the interactive plotting: > http://nilearn.github.io/plotting/index.html#interactive-plots > though I do hope that it will change soon for lighter plots that have > better controlled aesthetics thanks to a pull request by Pierre Bellec: > https://github.com/nilearn/nilearn/pull/1766 > > Thanks a lot to everyone involved, and in particular to Kshitij for hard > work assembling the release. > > This is still a beta, which means that it is not installed on users' > computers if they don't use the '--pre' switch to pip. I don't want this > to last long, and I really hope that we should be able to release the > final soon, with the restyled interactive plots. > > In the mean time, feedback welcomed! (as issues on the tracker), > > Ga?l > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexsavio at gmail.com Thu Oct 18 03:37:42 2018 From: alexsavio at gmail.com (alexsavio at gmail.com) Date: Thu, 18 Oct 2018 09:37:42 +0200 Subject: [Neuroimaging] Nilearn 0.5 beta release In-Reply-To: <20181017173602.tka3pf6rt36q2hpt@phare.normalesup.org> References: <20181017173602.tka3pf6rt36q2hpt@phare.normalesup.org> Message-ID: Congrats! I am looking forward to it. On Wed, 17 Oct 2018, 19:36 Gael Varoquaux, wrote: > Hi Pythonista, > > We have just release Nilearn 0.5 beta: > http://nilearn.github.io/whats_new.html > The highlight is off course the interactive plotting: > http://nilearn.github.io/plotting/index.html#interactive-plots > though I do hope that it will change soon for lighter plots that have > better controlled aesthetics thanks to a pull request by Pierre Bellec: > https://github.com/nilearn/nilearn/pull/1766 > > Thanks a lot to everyone involved, and in particular to Kshitij for hard > work assembling the release. > > This is still a beta, which means that it is not installed on users' > computers if they don't use the '--pre' switch to pip. I don't want this > to last long, and I really hope that we should be able to release the > final soon, with the restyled interactive plots. > > In the mean time, feedback welcomed! (as issues on the tracker), > > Ga?l > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -- Sent from my phone, sorry for brevity or typos. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gael.varoquaux at normalesup.org Fri Oct 19 03:59:57 2018 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Fri, 19 Oct 2018 09:59:57 +0200 Subject: [Neuroimaging] Clinical research PI Position at Neurospin, France Message-ID: <20181019075957.tqfqfujx2jerbe64@phare.normalesup.org> Dear colleagues, A clinical research PI position has been opened in Neurospin France: http://joliot.cea.fr/drf/joliot/Pages/Entites_de_recherche/neurospin/UNIACT.aspx The call can be found here: http://joliot.cea.fr/drf/joliot/Documents/Clinical%20research-oct18 at NeuroSpin.pdf Best, Ga?l From arokem at gmail.com Thu Oct 25 12:03:39 2018 From: arokem at gmail.com (Ariel Rokem) Date: Thu, 25 Oct 2018 09:03:39 -0700 Subject: [Neuroimaging] Postdoc in computational neuroscience and data science at the University of Washington (Seattle) Message-ID: A post-doc position is available at the University of Washington (Seattle) to work with Adrienne Fairhall (Computational Neuroscience Center ) and Ariel Rokem (eScience Institute ). The successful applicant will develop open-source software and build and maintain systems for sharing, integration and cutting-edge analysis of datasets from a large-scale collaboration focused on the neural circuits involved in learning in human and non-human primate. This distributed collaboration, funded through a grant from the BRAIN Initiative, includes researchers from UW, as well as from UC Berkeley, NYU, The University of Chicago, and UC Irvine. The position is initially offered for 1 year, with the possibility of extension beyond this period, based on mutual agreement. Desired qualifications: PhD in neuroscience, computer science, electrical engineering, statistics or related fields. Extensive experience programming in Python/Matlab and in neural data analysis. Experience contributing to open-source software for data analysis is a plus, as is experience working in cloud-computing environments (e.g., AWS) and experience with tools for scalable data analysis (e.g., Spark). We will be at the Society for Neuroscience conference. To arrange meetings for informational interviews during the conference, please contact Ariel Rokem: arokem at uw.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: