rmldj / hcp-utils Goto Github PK
View Code? Open in Web Editor NEWUtilities to use HCP and HCP-like data with nilearn and other Python tools
License: MIT License
Utilities to use HCP and HCP-like data with nilearn and other Python tools
License: MIT License
Hello! When using view_parcellation, is there a way to only visualize one hemisphere at a time like in nilearn?
Is there a way to specify what functional networks to color/highlight in a brain figure using hcp.view_parcellation(mesh_sub.inflated, hcp.ca_network)? For example, if analyses identify specific networks within the Cole-Anticevic Network partition that we want to illustrate (say the first 5 out of the 12 networks), is there currently a way to do this using hcp-utils?
Similarly, is there a way to specify parcels from a given parcellation that we want to highlight in generating brain figures?
I may have uncovered an issue:
in hcp_utils.py, line 334
Xp = np.zeros(np, dtype=X.dtype)
should be:
Xp = np.zeros(n, dtype=X.dtype)
Don't you agree?
Do you have a preferred citation we should use in publications if we display results of brain figures using hcp-utils?
I am trying to convert the ROI label colors from hcp.mmp to those that correspond to a figure I have. I generated a colormap.csv file that contains the new RGB values and a reference map called roimap that lists the Glasser parcellation ROIs with the same ROI label and network ID as before. See code below:
import nibabel as nib
import nilearn.plotting as plotting
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas
import csv as csv
import os
import copy
%matplotlib inline
import hcp_utils as hcp
colormap = "colormap.csv"
roimap = "ROI_Mapping_Python_csv.csv"
cmap = pandas.read_csv(colormap, header=None)
rmap = pandas.read_csv(roimap)
myparc = copy.deepcopy(hcp.mmp)
for l in range(1,361):
# get network id
networkID = (rmap['Network #'].loc[rmap['Region Label']==hcp.mmp.labels[l]]).values
# get rgb
newR, newG, newB = cmap[0][networkID].values[0], cmap[1][networkID].values[0], cmap[2][networkID].values[0]
rgbval = [float(newR)/255.0, float(newG)/255.0, float(newB)/255.0]
# saturate
hsv = matplotlib.colors.rgb_to_hsv(rgbval)
hsv[1] = hsv[1] + 0.1
newrgbval = matplotlib.colors.hsv_to_rgb(hsv)
# set new rgb map
myparc.rgba[l][0:3] = newrgbval
Although I have 379 ROIs as in hcp.mmp, I can't access the final 361-379. Moreover, the new RGB values in myparc.rgba are not being converted correctly. Could you provide some help with this?
Of the preloaded parcellations that come with hcp_utils, hcp.mmp includes 360 regions (180 per hemisphere) plus 19 FreeSurfer subcortical regions, for a total of 379 regions. Along with this parcellation, could the 22 (or 23 if subcortical is included) functional networks described in Glasser et. al. 2016 and shown in the scene file, Glasser_et_al_2016_HCP_MMP1.0_4_SupplementaryNeuroanatomicalResults.scene, from https://balsa.wustl.edu/sceneFile/show/n889 be added as a new preloaded parcellation?
This would be extremely helpful in depicting both the ROIs and corresponding functional networks in 3D surface plot figures for research presentations and papers. It would also be useful for network-level analyses using Glasser parcellation.
When I want to classify the hcp task-based dataset, I need some specific region, like below:
Gambling Punish--region:Striatum; MMP code:361, 362; Prediction:--
Could you please explain me what's the meaning of those params?
Thank you.
Hello!
I was trying to use hcp-utils on some of the 7T data from HCP, which has a shape of (921, 170494). So the number of grayordinates is 170494 instead of 91282. However I noticed that in hcp-utils, struct
and mesh
both have hard coded indexes based on 3T HCP data (91282 grayordinates). Does this package support 7T data? If not, do you happen to know where I can find out how 7T data were subdivided?
Thank you very much!
As a novice in fMRI, what confuses me is that when I execute the following code, the brain unfolding map appears to be inverted. I am unsure where the problem lies.
import hcp_utils as hcp
from matplotlib import pyplot as plt
from nilearn import image, plotting
plotting.plot_surf(surf_mesh=hcp.mesh.flat_left)
plt.savefig("plot_surf_map-hcp.png", bbox_inches="tight")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.