hi sebastian, I would now like to create my own curvature overlay (similar to the > thickness file) by assigning non-zero values to neighboring verteces to a > selected vertex and zero to others. My question is: is there any way I can > save a numpy array to a "morphometric" file using nibabel or a different > package? >
unfortunately write support is more sparse, but for something like this it would not be difficult to add. a pull request on nibabel would be quite welcome. you might even be able to peek at the matlab code to speed up the translation to python. cheers, satra On 15 July 2013 15:58, Satrajit Ghosh <sa...@mit.edu> wrote: > >> hi sebastian, >> >> you simply need to read the geometry file and the morphometry vector and >> the two pieces will give you what you need. >> >> the geometry file gives you the relation between vertex indices via the >> faces array. >> >> ``` >> def return_neighbors(faces, vertex_index): >> faces_containing_vertex = np.nonzero((faces == >> vertex_index).sum(axis=1))[0] >> neighbors = np.setdiff(faces[faces_containg_vertex, :].flatten(), >> vertex_index) >> return neighbors >> ``` >> >> cheers, >> >> satra >> >> On Mon, Jul 15, 2013 at 9:52 AM, Sebastian Urchs < >> sebastian.ur...@gmail.com> wrote: >> >>> Hi Satra, >>> >>> thank you very much. I believe I have to rephrase my question as I >>> didn't completely think it through. I need to find neighboring vertices to >>> a specified vertex and then read out their thickness values. I don't think >>> I can do this directly from the morphometry vector that pysurfer gives me. >>> >>> Thanks again, I'll send another mail to the mailinglist. >>> >>> Best, >>> Sebastian >>> >>> >>> On 15 July 2013 15:22, Satrajit Ghosh <sa...@mit.edu> wrote: >>> >>>> hi sebastian, >>>> >>>> please take a look at pysurfer (https://github.com/nipy/pysurfer) and >>>> nibabel (https://github.com/nipy/nibabel). >>>> >>>> the relevant code is here: >>>> >>>> https://github.com/nipy/nibabel/blob/master/nibabel/freesurfer/io.py >>>> >>>> cheers, >>>> >>>> satra >>>> >>>> On Mon, Jul 15, 2013 at 9:11 AM, Sebastian Urchs < >>>> sebastian.ur...@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am trying to figure out how to load thickness data into python such >>>>> that I would be able to identify the thickness at a given mesh node and >>>>> also identify surrounding nodes. I searched the mailinglist and found this >>>>> http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg07307.html >>>>> but >>>>> this unfortunately did not solve my question as I was unable to find a >>>>> downloadable version of pymgh. >>>>> >>>>> Is there some python package that you could point me to and that >>>>> allows me to load thickness data and do analysis in python? >>>>> >>>>> Thanks in advance! >>>>> Sebastian >>>>> >>>>> _______________________________________________ >>>>> Freesurfer mailing list >>>>> Freesurfer@nmr.mgh.harvard.edu >>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer >>>>> >>>>> >>>>> The information in this e-mail is intended only for the person to whom >>>>> it is >>>>> addressed. If you believe this e-mail was sent to you in error and the >>>>> e-mail >>>>> contains patient information, please contact the Partners Compliance >>>>> HelpLine at >>>>> http://www.partners.org/complianceline . If the e-mail was sent to >>>>> you in error >>>>> but does not contain patient information, please contact the sender >>>>> and properly >>>>> dispose of the e-mail. >>>>> >>>>> >>>> >>> >> >
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.