[Camino-users] New commands, conmat and cbsmat

Ian Malone i.malone at ucl.ac.uk
Mon Aug 20 10:23:55 PDT 2012


Thanks, those sound like pretty sensible choices. The only other thing 
I'd done was add an option to walk inwards from the ends of the tracts 
instead, but I'm not certain there's a real need for that.

Philip A Cook wrote:
> Hi,
>
> These are my first pass answers to these questions (relevant to r1089), which I'm open to making more flexible.
>
> Presently both conmat and cbsmat count the first connected target or pair of targets only (as is the default in procstreamlines). The first target is defined by the shortest distance from the seed point.
>
> For conmat, self-connectivity is not allowed, that is the diagonal of the connectivity matrix is zero. Basically it does the same thing as procstreamlines -endpointfile. Seed points within an ROI are defined as connecting the seed ROI to the closest non-seed ROI.
>
> For cbsmat, self-connectivity doesn't really make sense, since we are getting connectivity from a particular seed point. As is the case with procstreamlines -targetfile, the first (closest) target connection is counted. Targets cannot include the seed region otherwise tracts will go nowhere.
>
>
>
> On Aug 17, 2012, at 6:02 AM, Ian Malone wrote:
>
>   
>> Hi,
>>
>> Thanks for this. I'd modified procstreamlines to add something similar for my own use and have some questions as a result. Per-tract does the connectivity map measure the first regions encountered going outwards from the seed point or does it count all regions connected by a tract? If the later do you do anything about self connections (loops out and back into a region)? If the former then I guess seed points within a ROI register as a connection to the first ROI encountered in both directions? Or are there options for some different behaviours?
>>
>> Best wishes,
>> Ian
>>
>> Philip A Cook wrote:
>>     
>>> Hi all,
>>>
>>> Addressing the longstanding need to replace the broken conmap, I've made a start on this with two new commands, conmat and cbsmat.
>>>
>>> conmat gives you pairwise connectivity matrices. If you have a collection of streamlines and a target image with N labels, conmat gives you a NxN symmetrix matrix C where C(i,j) is the number of streamlines connecting target i to j. You can also get the mean FA / ADC etc along the lines connecting i to j, or the mean length of lines connecting two regions.
>>>
>>> It doesn't produce the figure that the old conmap did, but I have made something similar using R's igraph package
>>>
>>> library(igraph)
>>> conmat = read.csv("conmat_sc.csv")
>>> g = graph.adjacency(conmat)
>>> V(g)$label <- V(g)$name
>>> E(g)$width = E(g)$weight / 500
>>> lay <- lapply(list(g), layout.fruchterman.reingold, niter=3000)
>>> plot(g, layout = lay[[1]], vertex.shape = "rectangle", vertex.size = 40, vertex.size2 = 8, vertex.label.cex = 0.5, vertex.color=rep.int(c(2,3), 16) )
>>>
>>> It should also address some of the problems with conmap. It should work with any 32-bit integer labels, including those that are not labeled 1...N, without producing massive matrices with entries for non-existent labels. 
>>>
>>> cbsmat is related but specifically designed for the use case where we have a set of seed points and want to produce connectivity information for each seed. It's similar to what you might get with procstreamlines and targetprops2txt, except that you don't need to go through the intermediate step of creating target images for each seed point.
>>>
>>> One major difference in cbsmat is that all streamlines from a seed point are processed together, without regard to multiple PDs in the seed voxel. This is done to avoid having to count streamlines from the each seed point. The advantage of this is that you can pre-process the streamlines as many times as you like with procstreamlines before making the matrix.
>>>
>>> The procstreamlines way of dealing with multiple PDs was to make one connectivity image for each PD, and then leave it to the user to order and / or combine them for later processing. I'm not sure how helpful this was because I don't know if there is a useful way of combining this information beyond just reporting all possible connections as cbsmat does. This functionality could be added back if we update the streamline file format to include a PD index. This would take some work but it could be done. 
>>>
>>>
>>> Phil
>>>
>>>
>>> _______________________________________________
>>> Camino-users mailing list
>>> Camino-users at www.nitrc.org
>>> http://www.nitrc.org/mailman/listinfo/camino-users
>>>
>>>  
>>>       
>>     
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/camino-users/attachments/20120820/45f582b4/attachment.html


More information about the Camino-users mailing list