My suggestion wasn't actually saying not to use distances, it was about whether a specifically pixel-based spatial relationship is required (sounds like it isn't, so you wouldn't need a 2D regular grid). You can in fact get surface-based geodesic distances with wb_command -surface-geodesic-distance, though it is a bit clumsy (would require lots of little files), and currently doesn't have support for vertex areas. We don't currently have a good format for exporting these distances, as a lot of the matlab processing done ignores spatial information.
Side note, as workbench is open source, if you have someone who can write c++, then you could make a specialized command in your own copy of wb_command, and have more efficient access to our distance computations. For example, this loop computes the union of the immediate neighbors and the neighbors out to a specified limit of geodesic distance: https://github.com/Washington-University/workbench/blob/2008f0d215ec48d2726c28eb4907a2e2e5414837/src/Algorithms/AlgorithmMetricErode.cxx#L128 Tim On Thu, Mar 30, 2017 at 5:39 AM, Nicola Toschi <[email protected]> wrote: > Hi Tim, > > thanks again, very helpful indeed. The classification techniques I am > looking at do need spatial information but in light of your input I will > veer towards ideas which do not use the numerical distance per se, but > rather the idea of neighborhood. > > Thanks again, > > Nicola > > > On 03/30/2017 12:57 AM, Timothy Coalson wrote: > > On Wed, Mar 29, 2017 at 3:47 PM, Nicola Toschi <[email protected]> > wrote: > >> Dear Donna and Tim, >> >> thank you very much for your replies and insights. Yes, flatmaps is >> exactly what I was looking for! >> >> For now, I was just taking the xyz positions on the sphere, converting to >> polar coordinates, interpolating and resampling the myelin on a regular >> grid along the two angular coordinates, hence resulting in a 2D image. >> >> From you explanation I understand that this would preserve topological >> neighborhood relationships between scalar values but not so much real >> (geodesic) distances, right? >> > > Mostly correct, though wheverever the "poles" happen to land will be > stretched out immensely, and any 2D smoothing applied naively will not only > result in much less smoothing near these poles, but it will also be highly > directional (anisotropic). Additionally, if the spatial processing doesn't > "wrap around" and process the 2D image as if it were a tube, then it will > have a "seam" vertically on the sphere that data doesn't interact across. > Any other spatial processing that takes a naive 2D regularly spaced grid > approach will have similar biases. > > Distances on the sphere surface are merely similar to real cortical > distances, but even using the sphere will be more consistent across the > surface than what you describe. This is why I recommend doing any > smoothing or gradient steps in wb_command (or any other things it can do). > > You mentioned a classifier, which often doesn't need spatial information, > or at least not fully regular structure - gifti or cifti files would work > just fine for a spatially-agnostic process, and even if it needs spatial > information, if it can be freeform associations rather than 2D regular > grid, then it is possible to do it without this resampling. > > Tim > > > >> Thanks a lot! >> >> Nicola >> >> >> On 3/29/2017 9:29 PM, Dierker, Donna wrote: >> >>> Nicola, >>> >>> It is possible to generate a grid on a spherical surface like Alex Cohen >>> did in this paper: >>> >>> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2705206/ >>> >>> … and then fold those coordinates back up into midthickness >>> configuration. >>> >>> The 164k_fs_LR vertex-wise correspondence is as good as can be expected, >>> given anatomical variability across subjects. >>> Just having trouble understanding how you are using x,y,z coords with >>> the myelin scalars. >>> >>> Donna >>> >>> >>> On Mar 29, 2017, at 12:22 PM, Timothy Coalson < <[email protected]> >>>> [email protected]> wrote: >>>> >>>> If by 2D images you mean pixel-based (like .png), then the spatial >>>> relationships can't be preserved very well. In order to make flatmaps with >>>> moderate distortion, we have to add cuts to the cortical surface, which >>>> leaves connected parts of cortex separated by many blank pixels. Our flat >>>> surfaces are intended for visualization, and we do not use them for >>>> processing. >>>> >>>> I would suggest doing as much of the spatial processing as you can with >>>> wb_command - we have smoothing, gradient, dilation, and a few other things >>>> - if you want it identical across subjects, rather than based on the >>>> cortical distances in each subject, you can use a group average surface >>>> along with the corresponding vertex area metric files - this is because >>>> group average surfaces have much less folding than individual subjects, and >>>> as such, geodesic distances along the cortical surfaces are much shorter >>>> than they should be. >>>> >>>> As your earlier emails implied use of matlab, you should note that you >>>> can load the gifti surface files into matlab, which contain vertex neighbor >>>> information, by using the gifti toolbox ( >>>> <https://www.artefact.tk/software/matlab/gifti/> >>>> https://www.artefact.tk/software/matlab/gifti/). The easiest way to >>>> get vertex correspondence to the data in matlab is currently to use >>>> wb_command -cifti-separate to convert the surface data to gifti metric >>>> (.func.gii) files, and then load them instead. >>>> >>>> Tim >>>> >>>> >>>> On Wed, Mar 29, 2017 at 9:24 AM, Nicola Toschi <[email protected]> >>>> wrote: >>>> Hi, >>>> >>>> I'd like to arrive at a set of 2D images (e.g. 'unraveled' myelin maps >>>> obtained by cutting and stretching out the sphere), with anatomical >>>> correspondence across subjects, which can be used as inputs to external >>>> proprietary algorithms (e.g. classification), so I'm pretty sure I'll need >>>> to step out of the Workbench. >>>> >>>> Thanks! >>>> >>>> Nicola >>>> >>>> >>>> >>>> On 03/29/2017 04:18 PM, Glasser, Matthew wrote: >>>> >>>>> What operations beyond smoothing do you need? There is wb_command >>>>> -cifti-smoothing. >>>>> >>>>> Peace, >>>>> >>>>> Matt. >>>>> >>>>> From: Nicola Toschi < <[email protected]>[email protected]> >>>>> Date: Wednesday, March 29, 2017 at 9:09 AM >>>>> To: Matt Glasser <[email protected]>, " >>>>> <[email protected]>[email protected]" < >>>>> [email protected]> >>>>> Subject: Re: [HCP-Users] Position of vertices in myelin maps and 164k >>>>> sphere >>>>> >>>>> Hi Matt, >>>>> >>>>> thank you for your quick answer! That makes sense. >>>>> >>>>> I would like to do some spatial operations on the sphere that exploit >>>>> spatial neighborhood information (e.g. even simple smoothing or filtering >>>>> on the 2D surface), and have these operations be consistent across >>>>> subjects. >>>>> >>>>> What would be the best way to go about this do you think? Incorporate >>>>> the exact vertex locations for each subject anyway, or ignore them and >>>>> (somehow) just use the fact that vertex n has the same neuroanatomical >>>>> meaning in every subject? >>>>> >>>>> Thanks again, >>>>> >>>>> Nicola >>>>> >>>>> On 03/29/2017 04:02 PM, Glasser, Matthew wrote: >>>>> >>>>>> We don¹t recommend using the ft_ tools with MRI data. Instead use >>>>>> ciftiopen/ciftisave/ >>>>>> ciftisavereset: >>>>>> >>>>>> >>>>>> https://wiki.humanconnectome.org/display/PublicData/HCP+Users+FAQ >>>>>> item 2B >>>>>> >>>>>> As for your other question, the vertex indices have neuroanatomical >>>>>> correspondence across subjects, but that often does not equate to >>>>>> having >>>>>> the same 3D coordinates (as volumetric registration is not able to >>>>>> align >>>>>> cortical areas across subjects). >>>>>> >>>>>> Peace, >>>>>> >>>>>> Matt. >>>>>> >>>>>> On 3/29/17, 8:41 AM, >>>>>> "hcp-users-bounces@ >>>>>> humanconnectome.org on behalf of >>>>>> Nicola Toschi" >>>>>> <hcp-users-bounces@ >>>>>> humanconnectome.org on behalf of >>>>>> [email protected]> >>>>>> wrote: >>>>>> >>>>>> >>>>>> Dear List, >>>>>>> >>>>>>> I am trying to do some postprocessing on myelin and thickness maps >>>>>>> (164k >>>>>>> versions) contained in the MNINonLinear Directory of the Structural >>>>>>> dataset (e.g. ${subject}.corrThickness_ >>>>>>> MSMAll.164k_fs_LR.dscalar.nii and >>>>>>> ${subject}.MyelinMap_BC_ >>>>>>> MSMAll.164k_fs_LR.dscalar.nii) >>>>>>> . >>>>>>> >>>>>>> I thought these data would all be in the same atlas space across >>>>>>> subjects, hence I was expecting to find the same vertex coordinates >>>>>>> for >>>>>>> all subjects. Instead, when reading the data into matlab ( >>>>>>> 'ft_cifti_read' and gifti') every subject seems to have their own >>>>>>> distinct vertex locations. Also, the spherical gifti surfaces appear >>>>>>> to >>>>>>> be sampled at different coordinates across subjects. >>>>>>> >>>>>>> Can I assume that, nonetheless, anatomical correspondence is >>>>>>> preserved >>>>>>> across subjects? Could I, for example, take the vertex locations from >>>>>>> ${subject}.R.sphere.164k_fs_ >>>>>>> LR.surf.gii, associate the scalar values in >>>>>>> ${subject}.MyelinMap_BC_ >>>>>>> MSMAll.164k_fs_LR.dscalar.nii to each vertex, >>>>>>> interpolate on the sphere and assume that I can superimpose the >>>>>>> results >>>>>>> of this procedure across subjects? >>>>>>> >>>>>>> Thanks very much in advance! >>>>>>> >>>>>>> Nicola >>>>>>> >>>>>>> >>>>>>> ______________________________ >>>>>>> _________________ >>>>>>> HCP-Users mailing list >>>>>>> >>>>>>> [email protected]http://lists.humanconnectome.or >>>>>>> g/mailman/listinfo/hcp-users >>>>>>> >>>>>> ______________________________ >>>>>> __ >>>>>> The materials in this message are private and may contain Protected >>>>>> Healthcare Information or other information of a sensitive nature. If you >>>>>> are not the intended recipient, be advised that any unauthorized use, >>>>>> disclosure, copying or the taking of any action in reliance on the >>>>>> contents >>>>>> of this information is strictly prohibited. If you have received this >>>>>> email >>>>>> in error, please immediately notify the sender via telephone or return >>>>>> mail. >>>>>> >>>>>> >>>>> >>>>> The materials in this message are private and may contain Protected >>>>> Healthcare Information or other information of a sensitive nature. If you >>>>> are not the intended recipient, be advised that any unauthorized use, >>>>> disclosure, copying or the taking of any action in reliance on the >>>>> contents >>>>> of this information is strictly prohibited. If you have received >>>>> this email in error, please immediately notify the sender via telephone or >>>>> return mail. >>>>> >>>>> _______________________________________________ >>>> HCP-Users mailing list >>>> [email protected] >>>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users >>>> >>>> >>>> _______________________________________________ >>>> HCP-Users mailing list >>>> [email protected] >>>> http://lists.humanconnectome.org/mailman/listinfo/hcp-users >>>> >>>> >>> ________________________________ >>> The materials in this message are private and may contain Protected >>> Healthcare Information or other information of a sensitive nature. If you >>> are not the intended recipient, be advised that any unauthorized use, >>> disclosure, copying or the taking of any action in reliance on the contents >>> of this information is strictly prohibited. If you have received this email >>> in error, please immediately notify the sender via telephone or return mail. >>> >> >> >> >> --- >> This email has been checked for viruses by Avast antivirus software. >> https://www.avast.com/antivirus >> >> > > _______________________________________________ HCP-Users mailing list [email protected] http://lists.humanconnectome.org/mailman/listinfo/hcp-users
