Hi Chris,
Thanks for taking a look at my example code.
Yes, I am using Mac OS 10.14.6.
I tried your suggested changes, and the same Error was produced.
I explored this further with the brainGraph:::normalize_mats function in the source code. I was able to produce 'A.norm' matrices without any issue.
> div <- brainGraph:::read.array(matfiles$region_size, ncols = 1)
> Nv <- nrow(brainGraph:::read.array(matfiles$A))
> P = 1 # because I used deterministic tractography
> A <- brainGraph:::read.array(matfiles$A)
> R <- array(apply(div, 3, function(x) cbind(sapply(seq_len(Nv), function(y) x + x[y]))), dim = dim(A))
> A.norm <- 2 * A/(P * R) # correct result
I then looked through the create_mats function more closely...when I performed the following:
> mats <- create_mats(A.files = matfiles$A, modality = "dti", divisor = "size", div.files = matfiles$region_size, inds = inds, algo = "probabilistic", P=1)
I did not receive an error.
The resulting A.norm matrices matched those I produced when performing normalize_mats outside of the create_mats function.
It is possible there is an issue in create_mats when supplying this specific combination of parameters? (i.e. modality == "dti" & algo == "deterministic" & divisor == "size")?
And further, if I proceed with algo = "probabilistic" and P = 1, will I run into any issues later on? Is the thresholding computed the same? Or is this essentially the same as algo = "deterministic"?
Thanks again for your help!