[Camino-users] New commands, conmat and cbsmat

Philip A Cook cookpa at mail.med.upenn.edu
Thu Aug 16 13:25:06 PDT 2012


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




More information about the Camino-users mailing list