Spatial Entropy of Brain Network Landscapes: A Novel Method to Assess Spatial Disorder in Brain Networks.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 460 lines · 18 KB · no license
- function entropyCalc(niiFN, outFN, entropyMethod,scaleByDistanceFlag, scaleByModSizeFlag,scaleByPatchSize, distance, maskFN)
- %
- % Inputs
- %--------------------------------------------------------------------------
- % niiFN | nifti image
- % outFN | output image fn
- % entropyMethod | 1 = Shannon (Batty Voxel Adaptation)
- % | 2 = O'Neil
- % | 3 = Claramunt
- % | 4 = Proximity
- % scaleByDistanceFlag | 1 = yes
- % scaleByModSizeFlag | 1 = yes
- % scaleByPatchSizeFlag | 1 = yes
- % distance | distance from center of patch
- % maskFN | inclusive mask specifying what voxels in the
- % | brain to consider in the calculations
- %
- % Requirements
- %--------------------------------------------------------------------------
- % Tools for NIfTI and ANALYZE image - Jimmy Shen
- % Available here: https://www.mathworks.com/matlabcentral/fileexchange/8797-tools-for-nifti-and-analyze-image
- %
- % Release
- %--------------------------------------------------------------------------
- % 10/22/25 - Robert Lyday
- %
- %
- % % Warning: This code is provided "as is"
- % Use at your own risk
- img1 = load_untouch_nii(niiFN);
- atlas = load_untouch_nii(maskFN);
- pointer = find(atlas.img(:));
- % convert pointer to x,y,z
- [xindex, yindex, zindex] = ind2sub(size(atlas.img),pointer);
- maxDist = distance;
- maxMod = max(img1.img(:));
- for m = 1:maxMod
- modSize(m) = sum(img1.img==m,'all');
- end
- modSize = 1 - (modSize ./ sum(modSize));
- modSize_inv = 1 - modSize;
- if sum(size(img1.img)-size(atlas.img))
- fprintf('size nii %d\t%d\t%d\n',size(img1.img));
- fprintf('size atlas %d\t%d\t%d\n',size(atlas.img));
- error('module image and voxel mask do not match!')
- end
- imgOut = img1;
- imgOut.img = imgOut.img * 0;
- switch entropyMethod
- case 1
- %------------------------------------------------------------------
- % ----- Shannon -----
- %------------------------------------------------------------------
- neighborCounts = zeros(size(xindex));
- for index = 1:length(xindex)
- x = xindex(index);
- y = yindex(index);
- z = zindex(index);
- modProb = zeros(max(maxMod),1);
- count = 0;
- for xx = -maxDist:1:maxDist
- for yy = -maxDist:1:maxDist
- for zz = -maxDist:1:maxDist
- try
- currMod = img1.img(x+xx,y+yy,z+zz);
- maskCheck = atlas.img(x+xx,y+yy,z+zz);
- currDist = sqrt((xx^2)+(yy^2)+(zz^2));
- if currDist == 0
- currDist = 1;
- end
- if maskCheck && currDist<=maxDist
- count = count + 1;
- if currMod
- val = 1;
- if scaleByDistanceFlag
- val = val ./ currDist;
- end
- modProb(currMod) = modProb(currMod) + val;
- end
- end
- end
- end
- end
- end
- neighborCounts(index) = count;
- % scale modProb
- origModProb = modProb;
- modProb = modProb ./ sum(modProb);
- % calc entropy
- entVal = 0;
- for m = 1:maxMod
- if scaleByPatchSize == 1
- lambda = modProb(m) / count;
- else
- lambda = modProb(m);
- end
- if scaleByModSizeFlag==1
- temp = modSize(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- elseif scaleByModSizeFlag==2
- temp = modSize_inv(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- if scaleByPatchSize == 2
- temp = modProb(m) * log(1/lambda) / count; %bring patch size scaling outside of log function -CM 7.3.25
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- temp = modProb(m) * log(1/lambda);
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- end
- end
- end
- if entVal == 0
- entVal;
- end
- imgOut.img(x,y,z) = entVal;
- end
- case 2
- %------------------------------------------------------------------
- % ----- O'Neill -----
- %------------------------------------------------------------------
- for index = 1:length(xindex)
- x = xindex(index);
- y = yindex(index);
- z = zindex(index);
- modProb = zeros(max(maxMod),max(maxMod));
- count = 0;
- patchLocs = [];
- patchLocsDists = [];
- for xx = -maxDist:1:maxDist
- for yy = -maxDist:1:maxDist
- for zz = -maxDist:1:maxDist
- try
- maskCheck = atlas.img(x+xx,y+yy,z+zz);
- currDist = sqrt((xx^2)+(yy^2)+(zz^2));
- if maskCheck && currDist<=maxDist
- patchLocs(end+1,:) = [x+xx,y+yy,z+zz];
- patchLocsDists(end+1) = currDist;
- end
- end
- end
- end
- end
- for patchIndexi = 1:size(patchLocs,1)
- for patchIndexj = 1:size(patchLocs,1)
- currDist = sqrt(((patchLocs(patchIndexj,1)-patchLocs(patchIndexi,1))^2)+((patchLocs(patchIndexj,2)-patchLocs(patchIndexi,2))^2)+((patchLocs(patchIndexj,3)-patchLocs(patchIndexi,3))^2));
- if currDist == 1
- modi = img1.img(patchLocs(patchIndexi,1),patchLocs(patchIndexi,2),patchLocs(patchIndexi,3));
- modj = img1.img(patchLocs(patchIndexj,1),patchLocs(patchIndexj,2),patchLocs(patchIndexj,3));
- if modi && modj
- count = count + 1;
- distVal = 1;
- if scaleByDistanceFlag
- distVal = (patchLocsDists(patchIndexi)+patchLocsDists(patchIndexj))/2;
- end
- modProb(modi,modj) = modProb(modi,modj) + 1 / distVal;
- modProb(modj,modi) = modProb(modi,modj);
- end
- end
- end
- end
- % scale modProb
- modProbOrig = modProb;
- modProb = modProb ./ sum(modProb(:));
- % calc entropy
- entVal = 0;
- % vals = [];
- for m = 1:maxMod
- for mm = 1:maxMod
- if scaleByPatchSize == 1
- lambda = modProb(m,mm) / count;
- else
- lambda = modProb(m,mm);
- end
- if scaleByModSizeFlag == 1
- temp = modSize(m) .* modProb(m,mm) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- elseif scaleByModSizeFlag == 2
- temp = modSize_inv(m) .* modProb(m,mm) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- if scaleByPatchSize == 2 %patch size scaler outside of log -CM 7.3
- temp = modProb(m,mm) * log(1/lambda) / count;
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- temp = modProb(m,mm) * log(1/lambda);
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- % vals(end+1) = temp;
- end
- end
- end
- end
- imgOut.img(x,y,z) = entVal;
- end
- case 3
- %------------------------------------------------------------------
- % ----- Clarmunt -----
- %------------------------------------------------------------------
- for index = 1:length(xindex)
- x = xindex(index);
- y = yindex(index);
- z = zindex(index);
- modProb = zeros(max(maxMod),1);
- count = 0;
- patchLocs = [];
- for xx = -maxDist:1:maxDist
- for yy = -maxDist:1:maxDist
- for zz = -maxDist:1:maxDist
- try
- maskCheck = atlas.img(x+xx,y+yy,z+zz);
- currDist = sqrt((xx^2)+(yy^2)+(zz^2));
- if maskCheck && currDist<=maxDist
- patchLocs(end+1,:) = [x+xx,y+yy,z+zz];
- end
- end
- end
- end
- end
- count = size(patchLocs,1);
- modVals = [];
- modDists = [];
- for patchIndexi = 1:size(patchLocs,1)
- modVals(patchIndexi) = img1.img(patchLocs(patchIndexi,1),patchLocs(patchIndexi,2),patchLocs(patchIndexi,3));
- for patchIndexj = 1:size(patchLocs,1)
- currDist = sqrt(((patchLocs(patchIndexj,1)-patchLocs(patchIndexi,1))^2)+((patchLocs(patchIndexj,2)-patchLocs(patchIndexi,2))^2)+((patchLocs(patchIndexj,3)-patchLocs(patchIndexi,3))^2));
- modDists(patchIndexi, patchIndexj) = currDist;
- end
- end
- % set diagonal = nan
- modDists(1:length(modDists)+1:end)=nan;
- % calc modProb
- for m = 1:maxMod
- modProb(m) = sum(modVals == m) / sum(modVals > 0);
- end
- % calc entropy
- entVal = 0;
- for m = 1:maxMod
- if scaleByPatchSize == 1
- lambda = modProb(m) / count;
- else
- lambda = modProb(m);
- end
- locs1 = modVals == m;
- locs2 = (modVals~=m) & (modVals > 0);
- temp = modDists(locs1,locs1);
- tempDist1 = mean(temp(:),'omitnan');
- if tempDist1 == 0
- tempDist1 = 1;
- end
- temp = modDists(locs1,locs2);
- tempDist2 = mean(temp(:),'omitnan');
- if tempDist2 == 0
- tempDist2 = 1;
- end
- tempDist = tempDist1/tempDist2;
- %%% Added second scale by module size (020) CM 7.2.25
- if scaleByModSizeFlag == 1
- temp = tempDist .* modSize(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- elseif scaleByModSizeFlag == 2
- temp = tempDist .* modSize_inv(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- if scaleByPatchSize == 2
- temp = tempDist * modProb(m) * log(1/lambda) / count;
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- temp = tempDist * modProb(m) * log(1/lambda);
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- end
- end
- end
- imgOut.img(x,y,z) = entVal;
- end
- case 4
- %------------------------------------------------------------------
- % ----- Proximity -----
- %------------------------------------------------------------------
- for index = 1:length(xindex)
- % if index==82
- % index
- % end
- x = xindex(index);
- y = yindex(index);
- z = zindex(index);
- modProb = zeros(max(maxMod),1);
- modEdgeCount = zeros(max(maxMod),max(maxMod));
- count = 0;
- patchLocs = [];
- patchLocsDists = [];
- modVals = [];
- for xx = -maxDist:1:maxDist
- for yy = -maxDist:1:maxDist
- for zz = -maxDist:1:maxDist
- try
- maskCheck = atlas.img(x+xx,y+yy,z+zz);
- currDist = sqrt((xx^2)+(yy^2)+(zz^2));
- if maskCheck && currDist<=maxDist
- patchLocs(end+1,:) = [x+xx,y+yy,z+zz];
- patchLocsDists(end+1) = currDist;
- end
- end
- end
- end
- end
- for patchIndexi = 1:size(patchLocs,1)
- modVals(patchIndexi) = img1.img(patchLocs(patchIndexi,1),patchLocs(patchIndexi,2),patchLocs(patchIndexi,3));
- for patchIndexj = 1:size(patchLocs,1)
- currDist = sqrt(((patchLocs(patchIndexj,1)-patchLocs(patchIndexi,1))^2)+((patchLocs(patchIndexj,2)-patchLocs(patchIndexi,2))^2)+((patchLocs(patchIndexj,3)-patchLocs(patchIndexi,3))^2));
- if currDist == 1
- modi = img1.img(patchLocs(patchIndexi,1),patchLocs(patchIndexi,2),patchLocs(patchIndexi,3));
- modj = img1.img(patchLocs(patchIndexj,1),patchLocs(patchIndexj,2),patchLocs(patchIndexj,3));
- if modi && modj
- count = count + 1;
- modEdgeCount(modi,modj) = modEdgeCount(modi,modj) + 1;
- modEdgeCount(modj,modi) = modEdgeCount(modi,modj);
- end
- end
- end
- end
- % zero self modProb
- modEdgeCount(1:maxMod+1:end) = 0;
- for m = 1:maxMod
- modProb(m) = sum(modVals==m) ./ sum(modVals>0);
- end
- % calc dist matrix
- centroids = [];
- for m = 1:maxMod
- centroids(m,:)=mean(patchLocs(modVals==m,:),1);
- end
- for m = 1:maxMod
- for mm = 1:maxMod
- distMat(m,mm) = sqrt((centroids(m,1)-centroids(mm,1))^2 + (centroids(m,2)-centroids(mm,2))^2 + (centroids(m,3)-centroids(mm,3))^2);
- end
- end
- distMat(1:maxMod+1:end) = nan;
- % calc entropy
- entVal = 0;
- for m = 1:maxMod
- if scaleByPatchSize == 1
- lambda = modProb(m) / count;
- else
- lambda = modProb(m);
- end
- li = sum(modEdgeCount(m,:));
- di = mean(distMat(m,:),'omitnan');
- if di < 1
- di = 1;
- end
- if scaleByModSizeFlag == 1
- temp = li/di * modSize(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- elseif scaleByModSizeFlag == 2
- temp = li/di * modSize_inv(m) .* modProb(m) * log(1/(lambda));
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- if scaleByPatchSize == 2
- temp = li/di * modProb(m) * log(1/lambda) / count;
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- else
- temp = li/di * modProb(m) * log(1/lambda);
- if isnan(temp) || isinf(temp)
- temp = 0;
- end
- entVal = entVal + temp;
- end
- end
- end
- imgOut.img(x,y,z) = entVal;
- end
- otherwise
- error('Entropy method should be a number from 1 to 4');
- end
- pth = fileparts(outFN);
- if ~exist(pth,'dir')
- mkdir(pth);
- end
- save_untouch_nii(imgOut,outFN);
entropyCalc.m at commit 0256f55, no license · at the source
Overview
- Wake Forest Graduate School of Arts and Sciences Neuroscience Graduate Program Winston‐Salem North Carolina USA
- School of Biomedical Engineering and Sciences Virginia Tech‐Wake Forest University Winston‐Salem North Carolina USA
- Department of Radiology Wake Forest University School of Medicine Winston‐Salem North Carolina USA
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above.
rlyday/brain-network-spatial-entropy
0256f55b7eb92a46f68b046ce8181bd154712510, 22 October 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
1 file
- entropyCalc.m, MATLAB, 460 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: rlyday/
brain-network-spatial-en tropy
Read it in the paper: doi.org/10.1002/hbm.70525.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it says that the data are available on request
Read it in the paper: doi.org/10.1002/hbm.70525.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 5 keywords, 11 MeSH terms, 1 funder, 44 references.
Cite
This paper
McIntyre, C. C., O’Donnell, S. M., Khodaei, M., Lyday, R. G., Burdette, J. H., & Laurienti, P. J. (2026). Spatial Entropy of Brain Network Landscapes: A Novel Method to Assess Spatial Disorder in Brain Networks. Human brain mapping, 47(5), e70525. https://
BibTeX
@article{mcintyre2026spa
author = {McIntyre, Clayton C. and O’Donnell, Shannon M. and Khodaei, Mohammadreza and Lyday, Robert G. and Burdette, Jonathan H. and Laurienti, Paul J.},
title = {{Spatial Entropy of Brain Network Landscapes: A Novel Method to Assess Spatial Disorder in Brain Networks}},
journal = {Human brain mapping},
year = {2026},
month = apr,
volume = {47},
number = {5},
pages = {e70525},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {41947544},
pmcid = {PMC13058231}
}
RIS
TY - JOUR
AU - McIntyre, Clayton C.
AU - O’Donnell, Shannon M.
AU - Khodaei, Mohammadreza
AU - Lyday, Robert G.
AU - Burdette, Jonathan H.
AU - Laurienti, Paul J.
TI - Spatial Entropy of Brain Network Landscapes: A Novel Method to Assess Spatial Disorder in Brain Networks
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 5
SP - e70525
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Spatial Entropy of Brain Network Landscapes: A Novel Method to Assess Spatial Disorder in Brain Networks",
"container-title": "Human brain mapping",
"author": [
{
"family": "McIntyre",
"given": "Clayton C."
},
{
"family": "O’Donnell",
"given": "Shannon M."
},
{
"family": "Khodaei",
"given": "Mohammadreza"
},
{
"family": "Lyday",
"given": "Robert G."
},
{
"family": "Burdette",
"given": "Jonathan H."
},
{
"family": "Laurienti",
"given": "Paul J."
}
],
"container-title-short":
"volume": "47",
"issue": "5",
"page": "e70525",
"DOI": "10.1002/
"PMID": "41947544",
"PMCID": "PMC13058231",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1162/imag.a.1254 [code]
- The individuality of single-frame functional brain connectivity.Journal: Imaging neuroscience (Cambridge, Mass.)In common: 5 references, author Clayton C. McIntyre
- [2] doi:10.21203/rs.3.rs-9326213/v1 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: Research Square (preprint)In common: cognitive, 5 references
- [3] doi:10.1002/advs.202523009 [code]
- Personalized Network-Guided Neuromodulation Enhances Human Working Memory.Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)In common: Tools for NIfTI and ANALYZE image (MATLAB), cognitive, 3 references
- [4] doi:10.1162/imag.a.1222 [code]
- Network-based near-scalp personalized brain stimulation targets.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Tools for NIfTI and ANALYZE image (MATLAB), 3 references
- [5] doi:10.1016/j.neuron.2026.04.011 [code]
- Precision fMRI reveals densely interdigitated network patches with conserved motifs in the lateral prefrontal cortex.Journal: NeuronIn common: Tools for NIfTI and ANALYZE image (MATLAB), 3 references
- [6] doi:10.7554/elife.108408 [code]
- Frequency and laminar profile of feature-specific visual activity revealed by interleaved EEG-fMRI.Journal: eLifeIn common: Tools for NIfTI and ANALYZE image (MATLAB), 3 references
- [7] doi:10.1038/s41467-026-75745-8 [code]
- A language network in the individualized functional connectomes of 1199 human brains doing arbitrary tasks.Journal: Nature communicationsIn common: cognitive, 4 references
- [8] doi:10.1038/s41467-026-75959-w [code]
- Charting higher-order models of brain function beyond pairwise interactions.Journal: Nature communicationsIn common: 4 references
- [9] doi:10.1162/imag.a.1262 [code]
- Frame-wise multi-echo distortion correction for superior functional MRI.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Tools for NIfTI and ANALYZE image (MATLAB), 3 references
- [10] doi:10.1038/s41598-026-49900-6 [code]
- Global neural oscillations underlie performance variability and attentional state fluctuations in humans.Journal: Scientific reportsIn common: Tools for NIfTI and ANALYZE image (MATLAB), cognitive, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:76fd7c770b7721d9…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
