From elef at indiana.edu Fri Feb 1 10:11:07 2019 From: elef at indiana.edu (Eleftherios Garyfallidis) Date: Fri, 1 Feb 2019 10:11:07 -0500 Subject: [Neuroimaging] Chris Markiewicz taking over as lead maintainer for nibabel In-Reply-To: References: Message-ID: Congrats Chris, It would be nice to know what are the next plans for nibabel. Which formats are going to be supported or not etc. Best, Eleftherios On Thu, Jan 31, 2019 at 9:43 PM Christopher Markiewicz < markiewicz at stanford.edu> wrote: > Thanks, Matthew, for your many years of guidance and support of nibabel > and its contributors. I credit my engagement with nibabel in particular > with teaching me how to write and maintain open source software, and I can > only say thank you. It really is the bedrock of the community, and I hope > to keep it in worthy shape. > > Chris > > > > ------------------------------ > *From:* Neuroimaging stanford.edu at python.org> on behalf of Matthew Brett < > matthew.brett at gmail.com> > *Sent:* Thursday, January 31, 2019 12:55 PM > *To:* neuroimaging > *Subject:* [Neuroimaging] Chris Markiewicz taking over as lead maintainer > for nibabel > > Hi, > > Just so y'all know, Chris has kindly agreed to take over the role of > lead maintainer for nibabel. > > Well, I should say, he had kindly agreed to take on the title, because > the observant among you will know he has effectively been doing that > job for some time. > > We nibabelers don't have any real governance docs, but, as my last act > as lead maintainer, I'm going propose the following: > > * the lead maintainer has veto power over commits to nibabel > * they should use it only very rarely, when all possible compromises > have been explored. > > If anyone disagrees with this little formalization, please do say. > > Thanks very much, as ever, to Chris, and good luck with the task, that > you are already doing... > > Cheers, > > Matthew > _______________________________________________ > 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 Fri Feb 1 10:52:24 2019 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Fri, 1 Feb 2019 15:52:24 +0000 Subject: [Neuroimaging] Nibabel future plans and roadmaps (Was Re: Chris Markiewicz taking over as lead maintainer for nibabel) In-Reply-To: References: , Message-ID: Hi Eleftherios, As far as I'm concerned, any formats that people want to submit are fair game. The only new image format currently in the pipeline is Philips XML/REC (#683). And I expect that in a couple months we'll see some more activity on the spatial transform data model/file formats (#656), as the BIDS transforms meeting is happening in March. Personally, I would like to make some progress on some API improvements for serializing images and getting zooms in consistent units across image types. On this topic, I think it would be good to establish some roadmaps and timelines. Much of the last couple years has been bug fixes, and some deprecations are due to be effected. A predictable release schedule should make planning easier. With the Python 2 sunset in 11 months, I think we should have an explicit plan as a community of how nibabel should be oriented to it. I don't know if people want to hash these things out here or on GitHub, but I'm happy to do a developer hangout if some real-time responses are desired. If you're interested in participating in this planning, please let me know. Chris ________________________________ From: Neuroimaging on behalf of Eleftherios Garyfallidis Sent: Friday, February 1, 2019 10:11 AM To: Neuroimaging analysis in Python Subject: Re: [Neuroimaging] Chris Markiewicz taking over as lead maintainer for nibabel Congrats Chris, It would be nice to know what are the next plans for nibabel. Which formats are going to be supported or not etc. Best, Eleftherios On Thu, Jan 31, 2019 at 9:43 PM Christopher Markiewicz > wrote: Thanks, Matthew, for your many years of guidance and support of nibabel and its contributors. I credit my engagement with nibabel in particular with teaching me how to write and maintain open source software, and I can only say thank you. It really is the bedrock of the community, and I hope to keep it in worthy shape. Chris ________________________________ From: Neuroimaging > on behalf of Matthew Brett > Sent: Thursday, January 31, 2019 12:55 PM To: neuroimaging Subject: [Neuroimaging] Chris Markiewicz taking over as lead maintainer for nibabel Hi, Just so y'all know, Chris has kindly agreed to take over the role of lead maintainer for nibabel. Well, I should say, he had kindly agreed to take on the title, because the observant among you will know he has effectively been doing that job for some time. We nibabelers don't have any real governance docs, but, as my last act as lead maintainer, I'm going propose the following: * the lead maintainer has veto power over commits to nibabel * they should use it only very rarely, when all possible compromises have been explored. If anyone disagrees with this little formalization, please do say. Thanks very much, as ever, to Chris, and good luck with the task, that you are already doing... Cheers, Matthew _______________________________________________ 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 rana.banik at vanderbilt.edu Sat Feb 2 15:31:06 2019 From: rana.banik at vanderbilt.edu (Banik, Rana) Date: Sat, 2 Feb 2019 20:31:06 +0000 Subject: [Neuroimaging] Nibabel does not import Message-ID: <6343D29B5783744A91730733BB1FA9D14584F4@ITS-HCWNEM106.ds.vanderbilt.edu> Dear Concern, I have installed nibabel and it doesn't import. [cid:image002.jpg at 01D4BB03.E8DF47B0] But I have this from console: [cid:image006.jpg at 01D4BB03.E8DF47B0] [cid:image008.jpg at 01D4BB03.E8DF47B0] I have tried to uninstall and install it back. But the same problem persists. Please let me know how to solve the issue. Thanks Rana Banik Graduate Student Dept. of Biomedical Engineering Vanderbilt University Contact: +16152756216 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 25573 bytes Desc: image002.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 29725 bytes Desc: image006.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image008.jpg Type: image/jpeg Size: 40015 bytes Desc: image008.jpg URL: From matthew.brett at gmail.com Sun Feb 3 12:09:45 2019 From: matthew.brett at gmail.com (Matthew Brett) Date: Sun, 3 Feb 2019 17:09:45 +0000 Subject: [Neuroimaging] Nibabel does not import In-Reply-To: <6343D29B5783744A91730733BB1FA9D14584F4@ITS-HCWNEM106.ds.vanderbilt.edu> References: <6343D29B5783744A91730733BB1FA9D14584F4@ITS-HCWNEM106.ds.vanderbilt.edu> Message-ID: Hi, The most likely explanation is that the pip command is not installing into the same Python distribution that you are importing from. Check import sys sys.prefix from Python, and cross-check with the first line of the `pip` executable. Cheers, Matthew From njvack at wisc.edu Mon Feb 4 10:18:59 2019 From: njvack at wisc.edu (Nate Vack) Date: Mon, 04 Feb 2019 09:18:59 -0600 Subject: [Neuroimaging] Nibabel does not import In-Reply-To: <284_1549213845_0PMD0087A11WPJ20_CAH6Pt5r7wo9H4HxFr+ipK_WFh16-MMbWV9AVTA+uy6AMXF05bA@mail.gmail.com> References: <6343D29B5783744A91730733BB1FA9D14584F4@ITS-HCWNEM106.ds.vanderbilt.edu> <284_1549213845_0PMD0087A11WPJ20_CAH6Pt5r7wo9H4HxFr+ipK_WFh16-MMbWV9AVTA+uy6AMXF05bA@mail.gmail.com> Message-ID: On Windows, you can also probably do where pip and then where jupyter to see if they're pointing to the same directory. But yeah, Matthew is right; your pip is installing stuff somewhere other than where juypter is looking for it. -n On Sun, Feb 3, 2019 at 11:10 AM Matthew Brett wrote: > Hi, > > The most likely explanation is that the pip command is not installing > into the same Python distribution that you are importing from. Check > > import sys > sys.prefix > > from Python, and cross-check with the first line of the `pip` executable. > > Cheers, > > Matthew > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandra.badea at duke.edu Wed Feb 6 17:01:56 2019 From: alexandra.badea at duke.edu (Alexandra Badea, Ph.D.) Date: Wed, 6 Feb 2019 22:01:56 +0000 Subject: [Neuroimaging] =?utf-8?q?Postdoctoral_Position_in_Alzheimer?= =?utf-8?q?=E2=80=99s_Disease_Neuroimaging?= Message-ID: Postdoctoral Position in Alzheimer?s Disease Neuroimaging Synopsis Are you interested in a postdoctoral position focused on quantitative imaging and machine learning in medical imaging, with a goal to advance our knowledge about the brain, and early changes in Alzheimer?s disease? Come join us, and make a difference helping to advance the field. You will have the opportunity to work with the Duke UNC Brain Imaging and Analysis Center, to develop novel MR imaging protocols and integrative analysis methods. With your expertise and effort, you will help bridge across scientific domains: neurology, physics, engineering, computing and machine learning. You will have the opportunity to contribute to accelerating imaging protocols to produce high resolution brain images and reproducible connectomes, and novel analysis tools, including predictive modelling. You will be encouraged to prepare scientific presentations, publications and obtain independent funding to help advance your career. Skills - PhD in mathematics, computer science, electrical engineering, or similar. - Experience in quantitative MR imaging, image processing, machine learning - Programming using Python, R, C++, bash scripting, etc., cluster/high performance computing Apply We would love to hear from you. Send your statement of interest, CV, and the contact information for three references at: abadea at duke.edu With best wishes! Alexandra -- Alexandra Badea, PhD Associate Professor Department of Radiology Duke University Medical Center 919-684-7654 http://people.duke.edu/~abadea/ http://www.civm.duhs.duke.edu/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From eran_dayan at med.unc.edu Mon Feb 11 09:09:02 2019 From: eran_dayan at med.unc.edu (Dayan, Eran) Date: Mon, 11 Feb 2019 14:09:02 +0000 Subject: [Neuroimaging] Postdoctoral Research Associate in Computational Neuroimaging Message-ID: A Postdoctoral Research Associate position is immediately open to work with the Network Neuroscience lab (dayanlab.web.unc.edu) at the Biomedical Research Imaging Center, University of North Carolina at Chapel Hill. The position is open to accomplished and highly motivated candidates, with an interest in neuroimaging and clinical neuroscience. The lab focuses on fundamental questions relating to brain network organization in health and disease, while aiming to develop methods and tools that could eventually be used in the clinic. The Postdoctoral Research Associate will develop and test a dimensional analysis framework for neurological dysfunction, using rich existing multimodal neuroimaging datasets. Ample training and career development opportunities will be provided, as well as opportunities to collaborate with other groups within and outside UNC. Ph.D. or an MD/Ph.D. in Neuroscience, Computer Science, Biomedical Engineering, Physics, Psychology or other related fields is required. Excellent quantitative background, relevant programming experience (MATLAB, Python or R), experience analyzing functional and/or structural MRI data and a track record of first-author publications in peer-reviewed journals are required. Experience in machine learning (particularly deep learning) would be advantageous. To apply, please visit https://unc.peopleadmin.com/postings/107413 and click the Apply for this Job link/button. For informal inquiries about the position, please email Dr. Eran Dayan at: eran_dayan at med.unc.edu The University of North Carolina at Chapel Hill is an equal opportunity and affirmative action employer. All qualified applicants will receive consideration for employment without regard to age, color, disability, gender, gender expression, gender identity, genetic information, race, national origin -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Mon Feb 11 15:08:22 2019 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Mon, 11 Feb 2019 15:08:22 -0500 Subject: [Neuroimaging] [DIPY] weird DKI maps Message-ID: Hi DIPY users, Would you comment what could go wrong for DKI fitting of this mean kurtosis (MK) map using a three-shell DWI (b=3000,2000,1000)? The values of MK map are all zero except those in the sulci and ventricles. Here is the command I used, fwhm = 1.25 gauss_std = fwhm / np.sqrt(8 * np.log(2)) # converting fwhm to Gaussian std data_smooth = np.zeros(data.shape) for v in range(data.shape[-1]): data_smooth[..., v] = gaussian_filter(data[..., v], sigma=gauss_std) dkimodel = dki.DiffusionKurtosisModel(gtab) dkifit = dkimodel.fit(data_smooth, mask=mask) MK = dkifit.mk(0, 3) AK = dkifit.ak(0, 3) RK = dkifit.rk(0, 3) I have been using the same scripts for other 200ish data and the DKI maps were just fine. Thank you. Ping -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2019-02-11 at 12.55.03 PM.png Type: image/png Size: 86772 bytes Desc: not available URL: From arokem at gmail.com Mon Feb 11 18:29:36 2019 From: arokem at gmail.com (Ariel Rokem) Date: Mon, 11 Feb 2019 15:29:36 -0800 Subject: [Neuroimaging] [DIPY] weird DKI maps In-Reply-To: References: Message-ID: Hi Ping, Thanks for your email. I have not seen anything like this, so I can only speculate. Is there anything else that is unusual about this dataset? Does fitting DTI give you results that look reasonable? DKI is somewhat more sensitive to certain kinds of noise, so I would worry about a single or a few noisy volumes (e.g., a b0 volume that is corrupted by motion). Have you tried looking at every volume of this data? Cheers, Ariel On Mon, Feb 11, 2019 at 1:13 PM Ping-Hong Yeh wrote: > Hi DIPY users, > > Would you comment what could go wrong for DKI fitting of this mean > kurtosis (MK) map using a three-shell DWI (b=3000,2000,1000)? > The values of MK map are all zero except those in the sulci and > ventricles. > > Here is the command I used, > fwhm = 1.25 > gauss_std = fwhm / np.sqrt(8 * np.log(2)) # converting fwhm to Gaussian > std > data_smooth = np.zeros(data.shape) > for v in range(data.shape[-1]): > data_smooth[..., v] = gaussian_filter(data[..., v], sigma=gauss_std) > > > dkimodel = dki.DiffusionKurtosisModel(gtab) > dkifit = dkimodel.fit(data_smooth, mask=mask) > MK = dkifit.mk(0, 3) > AK = dkifit.ak(0, 3) > RK = dkifit.rk(0, 3) > > I have been using the same scripts for other 200ish data and the DKI maps > were just fine. > > Thank you. > > Ping > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Mon Feb 11 18:49:52 2019 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Mon, 11 Feb 2019 18:49:52 -0500 Subject: [Neuroimaging] [DIPY] weird DKI maps In-Reply-To: References: Message-ID: Hi Ariel, Thanks for the reply. yeah, I went through the DWI volumes and it turned out the preprocessing steps failed with some void volumes. Sorry for the false alarm. Ping On Mon, Feb 11, 2019 at 6:29 PM Ariel Rokem wrote: > Hi Ping, > > Thanks for your email. I have not seen anything like this, so I can only > speculate. Is there anything else that is unusual about this dataset? Does > fitting DTI give you results that look reasonable? DKI is somewhat more > sensitive to certain kinds of noise, so I would worry about a single or a > few noisy volumes (e.g., a b0 volume that is corrupted by motion). Have you > tried looking at every volume of this data? > > Cheers, > > Ariel > > > > > > On Mon, Feb 11, 2019 at 1:13 PM Ping-Hong Yeh > wrote: > >> Hi DIPY users, >> >> Would you comment what could go wrong for DKI fitting of this mean >> kurtosis (MK) map using a three-shell DWI (b=3000,2000,1000)? >> The values of MK map are all zero except those in the sulci and >> ventricles. >> >> Here is the command I used, >> fwhm = 1.25 >> gauss_std = fwhm / np.sqrt(8 * np.log(2)) # converting fwhm to Gaussian >> std >> data_smooth = np.zeros(data.shape) >> for v in range(data.shape[-1]): >> data_smooth[..., v] = gaussian_filter(data[..., v], sigma=gauss_std) >> >> >> dkimodel = dki.DiffusionKurtosisModel(gtab) >> dkifit = dkimodel.fit(data_smooth, mask=mask) >> MK = dkifit.mk(0, 3) >> AK = dkifit.ak(0, 3) >> RK = dkifit.rk(0, 3) >> >> I have been using the same scripts for other 200ish data and the DKI maps >> were just fine. >> >> Thank you. >> >> Ping >> _______________________________________________ >> 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 j.schreiber at fz-juelich.de Thu Feb 14 11:20:58 2019 From: j.schreiber at fz-juelich.de (Jan Schreiber) Date: Thu, 14 Feb 2019 17:20:58 +0100 Subject: [Neuroimaging] Chris Markiewicz taking over as lead maintainer for nibabel In-Reply-To: References: Message-ID: <15b73160-4949-8f53-5c07-fabb6aa59c20@fz-juelich.de> What would I do without nibabel? It really makes my scientific life a lot easier :-) Thank you very much for all your efforts with nibabel, Matthew and Chris! Cheers, Jan On 1/31/19 6:55 PM, Matthew Brett wrote: > Hi, > > Just so y'all know, Chris has kindly agreed to take over the role of > lead maintainer for nibabel. > > Well, I should say, he had kindly agreed to take on the title, because > the observant among you will know he has effectively been doing that > job for some time. > > We nibabelers don't have any real governance docs, but, as my last act > as lead maintainer, I'm going propose the following: > > * the lead maintainer has veto power over commits to nibabel > * they should use it only very rarely, when all possible compromises > have been explored. > > If anyone disagrees with this little formalization, please do say. > > Thanks very much, as ever, to Chris, and good luck with the task, that > you are already doing... > > Cheers, > > Matthew > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5098 bytes Desc: S/MIME Cryptographic Signature URL: From robbenson18 at gmail.com Fri Feb 15 07:11:26 2019 From: robbenson18 at gmail.com (Roberto Guidotti) Date: Fri, 15 Feb 2019 13:11:26 +0100 Subject: [Neuroimaging] [nilearn] Running nilearn on kubernetes cluster. Message-ID: Hi all, I tried to run nilearn on a kubernetes cluster with dask distributed. Here's the snippet. from dask_kubernetes import KubeCluster from dask.distributed import Client cluster = KubeCluster.from_yaml('pods.yaml') cluster.scale(3) client = Client(cluster.scheduler_address) Then I ran the plot_haxby_searchlight.py example, using following line for fitting. from sklearn.externals import joblib with joblib.parallel_backend('dask'): searchlight.fit(fmri_img, y) [Parallel(n_jobs=-1)]: Using backend DaskDistributedBackend with 6 concurrent workers. tornado.application - ERROR - Exception in callback functools.partial(.null_wrapper at 0x7f886a7cd730>, ) ... CancelledError: _fit_and_score-batch-cb239abe1e714386b5a5607c78d927e8 I can run sklearn examples with dask without any problem, but with nilearn I had this. On the kubernetes cluster, I use a docker image that is based on this repo: https://github.com/robbisg/docker-dask-k8s Basically I need to run some nilearn analyses using HPC, is this the less painful way to do this or you suggest something else. Thank you, Roberto -- Ing. Roberto Guidotti, PhD. PostDoc Fellow Institute for Advanced Biomedical Technologies - ITAB Department of Neuroscience and Imaging University of Chieti "G. D'Annunzio" Via dei Vestini, 33 66013 Chieti, Italy tel: +39 0871 3556919 e-mail: r.guidotti at unich.it; rguidotti at acm.org linkedin: http://it.linkedin.com/in/robertogui/ twitter: @robbisg github: https://github.com/robbisg -------------- next part -------------- An HTML attachment was scrubbed... URL: From robbenson18 at gmail.com Sat Feb 16 05:45:39 2019 From: robbenson18 at gmail.com (Roberto Guidotti) Date: Sat, 16 Feb 2019 11:45:39 +0100 Subject: [Neuroimaging] [nilearn] Running nilearn on kubernetes cluster. In-Reply-To: References: Message-ID: Hi, I'm writing since I performed some other attempts to figure out the issue, using scikit-learn and it turned out that may be an issue with cross_* functions since I had also a similar problem with a scikit-learn script without any nilearn's line of code as reported here https://github.com/dask/distributed/issues/2532. Bests, R On Fri, 15 Feb 2019 at 13:11, Roberto Guidotti wrote: > Hi all, > > I tried to run nilearn on a kubernetes cluster with dask distributed. > Here's the snippet. > > from dask_kubernetes import KubeCluster > from dask.distributed import Client > cluster = KubeCluster.from_yaml('pods.yaml') > cluster.scale(3) > client = Client(cluster.scheduler_address) > > Then I ran the plot_haxby_searchlight.py example, using following line for > fitting. > > from sklearn.externals import joblib > with joblib.parallel_backend('dask'): > searchlight.fit(fmri_img, y) > > [Parallel(n_jobs=-1)]: Using backend DaskDistributedBackend with 6 > concurrent workers. > tornado.application - ERROR - Exception in callback > functools.partial(.null_wrapper at 0x7f886a7cd730>, > exception=CancelledError(['_group_iter_search_light-batch-18a44db2f247402da4955d757c513610'],)>) > ... > > CancelledError: _fit_and_score-batch-cb239abe1e714386b5a5607c78d927e8 > > I can run sklearn examples with dask without any problem, but with nilearn > I had this. > > On the kubernetes cluster, I use a docker image that is based on this repo: > https://github.com/robbisg/docker-dask-k8s > > Basically I need to run some nilearn analyses using HPC, is this the less > painful way to do this or you suggest something else. > > Thank you, > Roberto > > > > -- > Ing. Roberto Guidotti, PhD. > PostDoc Fellow > Institute for Advanced Biomedical Technologies - ITAB > Department of Neuroscience and Imaging > University of Chieti "G. D'Annunzio" > Via dei Vestini, 33 > 66013 Chieti, Italy > tel: +39 0871 3556919 > e-mail: r.guidotti at unich.it; rguidotti at acm.org > linkedin: http://it.linkedin.com/in/robertogui/ > twitter: @robbisg > github: https://github.com/robbisg > -- Ing. Roberto Guidotti, PhD. PostDoc Fellow Institute for Advanced Biomedical Technologies - ITAB Department of Neuroscience and Imaging University of Chieti "G. D'Annunzio" Via dei Vestini, 33 66013 Chieti, Italy tel: +39 0871 3556919 e-mail: r.guidotti at unich.it; rguidotti at acm.org linkedin: http://it.linkedin.com/in/robertogui/ twitter: @robbisg github: https://github.com/robbisg -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertrand.thirion at inria.fr Sun Feb 17 10:14:57 2019 From: bertrand.thirion at inria.fr (bthirion) Date: Sun, 17 Feb 2019 16:14:57 +0100 Subject: [Neuroimaging] [nilearn] Running nilearn on kubernetes cluster. In-Reply-To: References: Message-ID: <163e6438-9349-7bf2-2f2e-2716e44c7526@inria.fr> Indeed this seems only indirectly related to Nilearn. Let's wait for @ogrisel's reponse. Best, B On 16/02/2019 11:45, Roberto Guidotti wrote: > Hi, > > I'm writing since I performed some other attempts to figure out the > issue, using scikit-learn and it turned out that may be an issue with > cross_* functions since I had also a similar problem with a > scikit-learn script without any nilearn's line of code as reported > here https://github.com/dask/distributed/issues/2532. > > Bests, > R > > On Fri, 15 Feb 2019 at 13:11, Roberto Guidotti > wrote: > > Hi all, > > I tried to run nilearn on a kubernetes cluster with dask distributed. > Here's the snippet. > > from dask_kubernetes import KubeCluster > from dask.distributed import Client > cluster = KubeCluster.from_yaml('pods.yaml') > cluster.scale(3) > client = Client(cluster.scheduler_address) > > Then I ran the plot_haxby_searchlight.py example, using following > line for fitting. > > from sklearn.externals import joblib > with joblib.parallel_backend('dask'): > ? ? searchlight.fit(fmri_img, y) > > [Parallel(n_jobs=-1)]: Using backend DaskDistributedBackend with 6 > concurrent workers. > tornado.application - ERROR - Exception in callback > functools.partial(.null_wrapper at > 0x7f886a7cd730>, exception=CancelledError(['_group_iter_search_light-batch-18a44db2f247402da4955d757c513610'],)>) > ... > > CancelledError: _fit_and_score-batch-cb239abe1e714386b5a5607c78d927e8 > > I can run sklearn examples with dask without any problem, but with > nilearn I had this. > > On the kubernetes cluster, I use a docker image that is based on > this repo: > https://github.com/robbisg/docker-dask-k8s > > Basically I need to run some nilearn analyses using HPC, is this > the less painful way to do this or you suggest something else. > > Thank you, > Roberto > > > > -- > Ing. Roberto Guidotti, PhD. > PostDoc Fellow > Institute for Advanced Biomedical Technologies - ITAB > Department of Neuroscience and Imaging > University of Chieti "G. D'Annunzio" > Via dei Vestini, 33 > 66013 Chieti, Italy > tel: +39 0871 3556919 > e-mail: r.guidotti at unich.it ; > rguidotti at acm.org > linkedin: http://it.linkedin.com/in/robertogui/ > twitter: @robbisg > github: https://github.com/robbisg > > > > -- > Ing. Roberto Guidotti, PhD. > PostDoc Fellow > Institute for Advanced Biomedical Technologies - ITAB > Department of Neuroscience and Imaging > University of Chieti "G. D'Annunzio" > Via dei Vestini, 33 > 66013 Chieti, Italy > tel: +39 0871 3556919 > e-mail: r.guidotti at unich.it ; > rguidotti at acm.org > linkedin: http://it.linkedin.com/in/robertogui/ > twitter: @robbisg > github: https://github.com/robbisg > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From tommaullin at gmail.com Mon Feb 18 11:46:35 2019 From: tommaullin at gmail.com (Tom Maullin) Date: Mon, 18 Feb 2019 16:46:35 +0000 Subject: [Neuroimaging] Editing slices of a 4D volume efficiently with Nibabel Message-ID: Hi, I am currently writing some code which, among other things, should load in a edit or add new 3D volumes to a pre-existing 4D file. The 4D file is likely very large and I would like to avoid loading it into memory if possible. I found the following in the nibabel documentation: http://nipy.org/nibabel/images_and_memory.html#saving-time-and-memory Which shows how to read in specific 3D slices without loading the entire 4D volume but have had no luck finding any functions which can write to one 3D slice without loading the entire 4D volume. Does anyone know of a way this can be done? Cheers, Tom Maullin -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schreiber at fz-juelich.de Tue Feb 19 08:24:17 2019 From: j.schreiber at fz-juelich.de (Jan Schreiber) Date: Tue, 19 Feb 2019 14:24:17 +0100 Subject: [Neuroimaging] [nilearn] map parcellation from Colin space to fsaverage surface Message-ID: <934d96a2-3b63-5ba8-e211-032864a3008c@fz-juelich.de> Dear Experts, There is a volumetric atlas defined in the space of the Colin template that I would like to visualize. I have created the parcellation labels by sampling the atlas values at the coordinates of the fsaverage surface obtained with fsaverage = datasets.fetch_surf_fsaverage() This almost looks good. Although being in a similar space I guess the gyrification of Colin is different than that of the fsaverage template. A volumetric image registration is not very helpful because the freesurfer templates (that I found) are very blurry. Any suggestion? Would it help to run freesurfer on the Colin template and run a surface based registration? Thanks, Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5098 bytes Desc: S/MIME Cryptographic Signature URL: From pellman.john at gmail.com Tue Feb 19 13:11:37 2019 From: pellman.john at gmail.com (pellman.john at gmail.com) Date: Tue, 19 Feb 2019 13:11:37 -0500 Subject: [Neuroimaging] Open Knowledge International is Providing Grants to Use Their Frictionless Data Standard in Tooling Message-ID: The Frictionless Data standard seems to be confined to encapsulating tabular/CSV data, but if anyone knows of any neuro / psych projects that would benefit from additional funding and use either of these formats, more details can be found in the post below: https://blog.okfn.org/2019/02/18/announcing-the-frictionless-data-tool-fund-2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From peled.noam at gmail.com Tue Feb 19 22:08:45 2019 From: peled.noam at gmail.com (Noam Peled) Date: Tue, 19 Feb 2019 22:08:45 -0500 Subject: [Neuroimaging] [nilearn] map parcellation from Colin space to fsaverage surface In-Reply-To: <934d96a2-3b63-5ba8-e211-032864a3008c@fz-juelich.de> References: <934d96a2-3b63-5ba8-e211-032864a3008c@fz-juelich.de> Message-ID: Hello Jan, In our tool, mmvt.org, we've already used freesurfer on the colin template. You are welcome to take a look. We are working on the documentation, so I'll be happy to assist. Here is an example of fMRI activity projected on colin's semi-inflated surface: [image: image.png] Best, Noam On Tue, Feb 19, 2019 at 8:32 AM Jan Schreiber wrote: > Dear Experts, > > There is a volumetric atlas defined in the space of the Colin template > that I would like to visualize. > > I have created the parcellation labels by sampling the atlas values at > the coordinates of the fsaverage surface obtained with > fsaverage = datasets.fetch_surf_fsaverage() > > This almost looks good. > Although being in a similar space I guess the gyrification of Colin is > different than that of the fsaverage template. A volumetric image > registration is not very helpful because the freesurfer templates (that > I found) are very blurry. > > Any suggestion? > > Would it help to run freesurfer on the Colin template and run a surface > based registration? > > Thanks, > Jan > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 623935 bytes Desc: not available URL: From ts+ml at rcmd.org Fri Feb 22 07:27:39 2019 From: ts+ml at rcmd.org (=?UTF-8?Q?Tim_Sch=C3=A4fer?=) Date: Fri, 22 Feb 2019 13:27:39 +0100 (CET) Subject: [Neuroimaging] Reading FreeSurfer m3z files? Message-ID: <2037141734.38910.1550838459775@ox.hosteurope.de> Dear list, does anybody know of a Python library which can read FreeSurfer m3z files, like /mri/transforms/talairach.m3z? These are binary files encoding a dense vector field for a 3D registration. The format seems to be a custom FreeSurfer format, but I'm not 100% sure on that. (The respective function in FreeSurfer is called GCAMwrite [1], and there is a Matlab implementation that is called mris_write_m3z [2], it seems.) Best, -- Tim [1] https://github.com/freesurfer/freesurfer/blob/dev/utils/gcamorph.c [2] https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_write_m3z.m From thomas.kirk at eng.ox.ac.uk Thu Feb 21 09:09:48 2019 From: thomas.kirk at eng.ox.ac.uk (Thomas Kirk) Date: Thu, 21 Feb 2019 14:09:48 +0000 Subject: [Neuroimaging] Writing GIFTI surfaces demo Message-ID: Hi all, I spent the most part of yesterday working out how to save surfaces in GIFTI format via Nibabel. Though the online documentation is comprehensive with respect to the classes etc I didn't find much in the way of examples or explanations of the bare essentials required to do this. I got there in the end by trial and error and by loading up existing surfaces via Nibabel and inspecting those. I think I have now worked out the minimal steps required to save a pair of points and triangle arrays as a .surf.gii that plays nicely with other tools such as wb_command (it works for me anyway). I have put this onto a demo file for my future reference and would like to offer it for the website documentation - is there space for this somewhere? If so you are welcome to it; this would have saved me a lot of time. Of course you are free to modify as you see fit. Kind regards Tom Kirk Institute of Biomedical Engineering, Oxford University -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gii demo.py Type: application/octet-stream Size: 2914 bytes Desc: gii demo.py URL: From peled.noam at gmail.com Sun Feb 24 15:08:47 2019 From: peled.noam at gmail.com (Noam Peled) Date: Sun, 24 Feb 2019 15:08:47 -0500 Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: <2037141734.38910.1550838459775@ox.hosteurope.de> References: <2037141734.38910.1550838459775@ox.hosteurope.de> Message-ID: I don't know any python library that can read those files. I attached a Matlab file that reads m3z files. You can also find it here: https://www.mail-archive.com/freesurfer at nmr.mgh.harvard.edu/msg51239.html If you convert it to Python, let me know :) Best, Noam On Fri, Feb 22, 2019 at 8:07 AM Tim Sch?fer wrote: > Dear list, > > does anybody know of a Python library which can read FreeSurfer m3z files, > like /mri/transforms/talairach.m3z? > > These are binary files encoding a dense vector field for a 3D > registration. The format seems to be a custom FreeSurfer format, but I'm > not 100% sure on that. (The respective function in FreeSurfer is called > GCAMwrite [1], and there is a Matlab implementation that is called > mris_write_m3z [2], it seems.) > > Best, > > -- > Tim > > [1] https://github.com/freesurfer/freesurfer/blob/dev/utils/gcamorph.c > [2] > https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_write_m3z.m > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mris_read_m3z.m Type: application/octet-stream Size: 3395 bytes Desc: not available URL: From matthew.brett at gmail.com Mon Feb 25 05:26:42 2019 From: matthew.brett at gmail.com (Matthew Brett) Date: Mon, 25 Feb 2019 10:26:42 +0000 Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: References: <2037141734.38910.1550838459775@ox.hosteurope.de> Message-ID: Hi, That bit of code is verrry short - I guess it's a very simple format. It should be pretty easy to implement. Cheers, Matthew On Sun, Feb 24, 2019 at 8:09 PM Noam Peled wrote: > > I don't know any python library that can read those files. I attached a Matlab file that reads m3z files. You can also find it here: > https://www.mail-archive.com/freesurfer at nmr.mgh.harvard.edu/msg51239.html > > If you convert it to Python, let me know :) > > Best, > Noam > > On Fri, Feb 22, 2019 at 8:07 AM Tim Sch?fer wrote: >> >> Dear list, >> >> does anybody know of a Python library which can read FreeSurfer m3z files, like /mri/transforms/talairach.m3z? >> >> These are binary files encoding a dense vector field for a 3D registration. The format seems to be a custom FreeSurfer format, but I'm not 100% sure on that. (The respective function in FreeSurfer is called GCAMwrite [1], and there is a Matlab implementation that is called mris_write_m3z [2], it seems.) >> >> Best, >> >> -- >> Tim >> >> [1] https://github.com/freesurfer/freesurfer/blob/dev/utils/gcamorph.c >> [2] https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_write_m3z.m >> _______________________________________________ >> 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 From ts+ml at rcmd.org Mon Feb 25 05:41:07 2019 From: ts+ml at rcmd.org (=?UTF-8?Q?Tim_Sch=C3=A4fer?=) Date: Mon, 25 Feb 2019 11:41:07 +0100 (CET) Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: References: <2037141734.38910.1550838459775@ox.hosteurope.de> Message-ID: <549123212.48571.1551091267173@ox.hosteurope.de> True, I'll give it a try and report back. > On February 25, 2019 at 11:26 AM Matthew Brett wrote: > > > Hi, > > That bit of code is verrry short - I guess it's a very simple format. > It should be pretty easy to implement. > > Cheers, > > Matthew > > On Sun, Feb 24, 2019 at 8:09 PM Noam Peled wrote: > > > > I don't know any python library that can read those files. I attached a Matlab file that reads m3z files. You can also find it here: > > https://www.mail-archive.com/freesurfer at nmr.mgh.harvard.edu/msg51239.html > > > > If you convert it to Python, let me know :) > > > > Best, > > Noam > > > > On Fri, Feb 22, 2019 at 8:07 AM Tim Sch?fer wrote: > >> > >> Dear list, > >> > >> does anybody know of a Python library which can read FreeSurfer m3z files, like /mri/transforms/talairach.m3z? > >> > >> These are binary files encoding a dense vector field for a 3D registration. The format seems to be a custom FreeSurfer format, but I'm not 100% sure on that. (The respective function in FreeSurfer is called GCAMwrite [1], and there is a Matlab implementation that is called mris_write_m3z [2], it seems.) > >> > >> Best, > >> > >> -- > >> Tim > >> > >> [1] https://github.com/freesurfer/freesurfer/blob/dev/utils/gcamorph.c > >> [2] https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_write_m3z.m > >> _______________________________________________ > >> 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 -- Tim 0176 84273709 From j.davidgriffiths at gmail.com Mon Feb 25 11:08:09 2019 From: j.davidgriffiths at gmail.com (John Griffiths) Date: Mon, 25 Feb 2019 11:08:09 -0500 Subject: [Neuroimaging] Post-Doctoral Fellowship in Whole Brain Modelling Message-ID: Post-Doctoral Fellowship in Whole Brain Modelling The Whole Brain Modelling Group (PI Dr. John Griffiths; www.grifflab.com) at the Krembil Centre for Neuroinformatics, Toronto, is looking to hire a Post-Doctoral Fellow with a strong background in neuroimaging and/or computational neuroscience. The successful candidate shall spearhead the group's efforts in computational modelling of large-scale brain dynamics, with a particular focus on brain stimulation (TMS, TDCS), EEG, neural plasticity, and macro-connectomics. The fellow will have the opportunity to shape the details of the project based on their specific interests, as well as to contribute to other ongoing projects on a range of topics, including: neuroinformatics of whole-brain modelling, mapping and modelling anatomical connectivity and microstructure with DWI in relation to ageing and stroke, and multi-scale modelling of the thalamocortical system in relation to sleep, pharmacological neuromodulation, and neuropsychiatric disease. The successful candidate will have a PhD in neuroscience, engineering, physics, psychology, or related area, a track record for independent research, and a strong publication record. Strong programming skills and familiarity with neuroimaging data analysis (s/d/fMRI and/or M/EEG) are required; experience with computational modelling using numerical simulations (particularly modelling of neural population activity with mean-field/neural mass/neural field techniques) would be advantageous. Full details of the position and application instructions can be found at www.grifflab.com/positions/ For informal inquiries, please email Dr. John Griffiths at john.griffiths at camh.ca with the title ?Post-Doctoral Fellowship in Whole Brain Modelling? in the subject line. -- Dr. John D. Griffiths Independent Scientist @ Krembil Centre for Neuroinformatics, CAMH, Toronto Assistant Professor @ Department of Psychiatry, University of Toronto www.grifflab.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ts+ml at rcmd.org Tue Feb 26 08:15:57 2019 From: ts+ml at rcmd.org (=?UTF-8?Q?Tim_Sch=C3=A4fer?=) Date: Tue, 26 Feb 2019 14:15:57 +0100 (CET) Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: <549123212.48571.1551091267173@ox.hosteurope.de> References: <2037141734.38910.1550838459775@ox.hosteurope.de> <549123212.48571.1551091267173@ox.hosteurope.de> Message-ID: <897669366.60243.1551186957803@ox.hosteurope.de> Dear list, I have attached a Python/numpy function that works like the Matlab function 'mris_read_m3z' from the official FreeSurfer repo (https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_read_m3z.m) at the end of this email. My latest version is always 'read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/src/brainload/freesurferdata.py There is a unit test called 'test_read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/tests/brainload/test_freesurferdata.py. The values which are checked in the unit test have been retrieved by running the Matlab implementation linked above on my example m3z file (the file is also in the brainload repo, see the test). The current implementation does not convert the result to double (like the Matlab implementation does), and the order of the return values is different. Most likely it's not the most beautiful implementation as I'm rather new to numpy, but it works. Feel free to use it/improve it/whatever (license is MIT). Best, Tim > On February 25, 2019 at 11:41 AM Tim Sch?fer wrote: > > > True, I'll give it a try and report back. > > > On February 25, 2019 at 11:26 AM Matthew Brett wrote: > > > > > > Hi, > > > > That bit of code is verrry short - I guess it's a very simple format. > > It should be pretty easy to implement. > > > > Cheers, > > > > Matthew > > > > On Sun, Feb 24, 2019 at 8:09 PM Noam Peled wrote: > > > > > > I don't know any python library that can read those files. I attached a Matlab file that reads m3z files. You can also find it here: > > > https://www.mail-archive.com/freesurfer at nmr.mgh.harvard.edu/msg51239.html > > > > > > If you convert it to Python, let me know :) > > > > > > Best, > > > Noam > > > > > > On Fri, Feb 22, 2019 at 8:07 AM Tim Sch?fer wrote: > > >> > > >> Dear list, > > >> > > >> does anybody know of a Python library which can read FreeSurfer m3z files, like /mri/transforms/talairach.m3z? > > >> > > >> These are binary files encoding a dense vector field for a 3D registration. The format seems to be a custom FreeSurfer format, but I'm not 100% sure on that. (The respective function in FreeSurfer is called GCAMwrite [1], and there is a Matlab implementation that is called mris_write_m3z [2], it seems.) > > >> > > >> Best, > > >> > > >> -- > > >> Tim > > >> > > >> [1] https://github.com/freesurfer/freesurfer/blob/dev/utils/gcamorph.c > > >> [2] https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_write_m3z.m > > >> _______________________________________________ > > >> 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 > > -- > Tim > 0176 84273709 > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging -- Tim # python function follows def read_m3z_file(m3z_file): """ Read a file in FreeSurfer m3z format. Read a file in FreeSurfer m3z format, usually mri/transforms/talairach.m3z of a subject. An m3z file is a gzipped binary file containing a dense vector field that describes a 3D registration between two volumes/images. This implementation follows the Matlab implementation from the FreeSurfer source repository at github, see https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_read_m3z.m. Parameters ---------- m3z_file: str Path to a file in m3z format Returns ------- vol_orig: numpy 4D array Array of np.single, containing 3 numbers per voxel. The shape is (width, height, depth, 3), where width, height, and depth are the dimensions of the source volume. vol_dest: numpy 4D array Array of np.single, containing 3 numbers per voxel. The shape is (width, height, depth, 3), where width, height, and depth are the dimensions of the destination volume. vol_ind0: numpy 4D array Array of np.int32, containing 3 numbers per voxel. The shape is (width, height, depth, 3). meta_data: dictionary Contains meta data on the registration. The following keys are included: - version: float, File format version - width: int, Volume width - height: int, Volume height - depth: int, Volume depth - spacing: int, voxel spacing of the volume - exp_k: float, exp_k of the volume Examples -------- Read a talairach.m3z file that has been generated by FreeSurfer's ```recon-all``` command. >>> import brainload.freesurferdata as fsd >>> import os >>> m3z_file = os.path.join(os.getenv('HOME'), 'my_study_data', 'subject1', 'mri', 'transforms', 'talairach.m3z') >>> vol_orig, vol_dest, vol_ind0, meta_data = fsd.read_m3z_file(m3z_file) """ m3z = gzip.open(m3z_file, 'rb') fdata = m3z.read() # read the whole file contents # Read the file header data_start_pos = 24 (version, width, height, depth, spacing, exp_k) = struct.unpack(">fiiiif", fdata[:data_start_pos]) meta_data = {} meta_data['version'] = version meta_data['width'] = width meta_data['height'] = height meta_data['depth'] = depth meta_data['spacing'] = spacing meta_data['exp_k'] = exp_k meta_data['data_start_pos'] = data_start_pos numbers_per_voxel = 9 bytes_uint8 = 4 numbers_to_read = width * height * depth * numbers_per_voxel bytes_to_read = numbers_to_read * bytes_uint8 data_end_pos = data_start_pos + bytes_to_read vol_data = struct.unpack(">%dB" % (numbers_to_read * 4), fdata[data_start_pos:data_end_pos]) # vol_data is a tuple meta_data['data_end_pos'] = data_end_pos meta_data['bytes_to_read'] = bytes_to_read meta_data['numbers_to_read'] = numbers_to_read meta_data['remaining_data_tag'] = struct.unpack(">i", fdata[data_end_pos:data_end_pos+4])[0] # the first 4 bytes after the data are an integer tag, that holds information on what kind of data follows. We do not read that data but check the tag here. meta_data['file_end_pos'] = len(fdata) # create indices into the vol_data where data resides indices = np.kron(np.ones((12,1), dtype=np.int), range(width * height * depth)) vox_offset = 9 * 4 * indices to_repeat = np.array([3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8]) reshaped_offsets = np.reshape(vox_offset, -1, order='F').copy() repeated = np.kron(np.ones((width * height * depth, ), dtype=int), to_repeat) inds = repeated + reshaped_offsets; inds = inds.astype(int) # Extract the three interleaved volumes and permute the result to match the original looped read. Start with viol_orig. buf = np.array(vol_data, dtype=np.uint8) buf_at_inds = buf[inds] single_casted = buf_at_inds.view(dtype=np.single) vol_orig_step1 = np.reshape(single_casted, (3, depth, width, height), order='F').copy() vol_orig = np.transpose(vol_orig_step1, (3, 2, 1, 0)) # OK, vol_orig is reconstructed. Now for vol_dest inds = inds + 12 buf_at_inds = buf[inds] single_casted = buf_at_inds.view(dtype=np.single) vol_dest_step1 = np.reshape(single_casted, (3, depth, width, height), order='F').copy() vol_dest = np.transpose(vol_dest_step1, (3, 2, 1, 0)) # now for vol_ind0 inds = inds + 12 buf_at_inds = buf[inds] casted = buf_at_inds.view(dtype=np.int32) vol_ind0_step1 = np.reshape(casted, (3, depth, width, height), order='F').copy() vol_ind0 = np.transpose(vol_ind0_step1, (3, 2, 1, 0)) return vol_orig, vol_dest, vol_ind0, meta_data -- Dr. Tim Sch?fer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany From matthew.brett at gmail.com Tue Feb 26 09:11:49 2019 From: matthew.brett at gmail.com (Matthew Brett) Date: Tue, 26 Feb 2019 14:11:49 +0000 Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: <897669366.60243.1551186957803@ox.hosteurope.de> References: <2037141734.38910.1550838459775@ox.hosteurope.de> <549123212.48571.1551091267173@ox.hosteurope.de> <897669366.60243.1551186957803@ox.hosteurope.de> Message-ID: Hi, On Tue, Feb 26, 2019 at 1:16 PM Tim Sch?fer wrote: > > Dear list, > > I have attached a Python/numpy function that works like the Matlab function 'mris_read_m3z' from the official FreeSurfer repo (https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_read_m3z.m) at the end of this email. > > My latest version is always 'read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/src/brainload/freesurferdata.py > > There is a unit test called 'test_read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/tests/brainload/test_freesurferdata.py. The values which are checked in the unit test have been retrieved by running the Matlab implementation linked above on my example m3z file (the file is also in the brainload repo, see the test). > > The current implementation does not convert the result to double (like the Matlab implementation does), and the order of the return values is different. Most likely it's not the most beautiful implementation as I'm rather new to numpy, but it works. Feel free to use it/improve it/whatever (license is MIT). > Did you base your code on the Freesurfer version? I guess then you have to license under their license? https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense Cheers, Matthew From ts+ml at rcmd.org Tue Feb 26 09:53:45 2019 From: ts+ml at rcmd.org (=?UTF-8?Q?Tim_Sch=C3=A4fer?=) Date: Tue, 26 Feb 2019 15:53:45 +0100 (CET) Subject: [Neuroimaging] Reading FreeSurfer m3z files? In-Reply-To: References: <2037141734.38910.1550838459775@ox.hosteurope.de> <549123212.48571.1551091267173@ox.hosteurope.de> <897669366.60243.1551186957803@ox.hosteurope.de> Message-ID: <197424073.61445.1551192825826@ox.hosteurope.de> I'm no lawyer but I guess you're right, I have added a notice in the repo that the function is under FreeSurfer license. Tim > On February 26, 2019 at 3:11 PM Matthew Brett wrote: > > > Hi, > > On Tue, Feb 26, 2019 at 1:16 PM Tim Sch?fer wrote: > > > > Dear list, > > > > I have attached a Python/numpy function that works like the Matlab function 'mris_read_m3z' from the official FreeSurfer repo (https://github.com/freesurfer/freesurfer/blob/dev/matlab/mris_read_m3z.m) at the end of this email. > > > > My latest version is always 'read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/src/brainload/freesurferdata.py > > > > There is a unit test called 'test_read_m3z_file' in https://github.com/dfsp-spirit/brainload/blob/master/tests/brainload/test_freesurferdata.py. The values which are checked in the unit test have been retrieved by running the Matlab implementation linked above on my example m3z file (the file is also in the brainload repo, see the test). > > > > The current implementation does not convert the result to double (like the Matlab implementation does), and the order of the return values is different. Most likely it's not the most beautiful implementation as I'm rather new to numpy, but it works. Feel free to use it/improve it/whatever (license is MIT). > > > > Did you base your code on the Freesurfer version? I guess then you > have to license under their license? > > https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense > > Cheers, > > Matthew > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging -- Tim