-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualizing fMRI data following 2015 paper. #350
Comments
Hi @iPsych, I believe the code you are referring to in the paper was meant to be a proof of concept. I would suggest you look at the example gallery, which is updated to the latest version of pycortex https://gallantlab.github.io/auto_examples/index.html. In particular you might want to test your installation of pycortex running the demo https://gallantlab.github.io/install.html#demo |
Hi, @mvdoc, Thank you for the reply. |
You will need to provide a volume dataset as a numpy array (instead of the randomly generated volume). You can load volumes in python using nibabel, with something like this (assuming you're loading a 4D volume) import nibabel as nib
img = nib.load('/path/to/your/functional.nii.gz')
data = img.get_data()
data = data.T # pycortex assumes the first dimension to be TRs
subject_id = 'your_subject_id'
transform_name = 'your_transform_name'
data_to_show = data[0] # assuming you want to show the first TR
vol = cortex.Volume(data_to_show, subject_id, transform_name)
cortex.webgl.show(vol) where you need to change |
@mvdoc |
Can you post the code you're using and that gives you this error? In general, that error occurs whenever there's a shape mismatch between the data you're trying to visualize and the reference image that was stored in the database. If the shape is different, pycortex will try to use known masks (for example, a cortical mask selecting only voxels near the surface boundaries). If none of them works, it will raise this error. |
There are brainmask and brainmask_mask file in anatomicals folder. The error is below.
|
What is Inserting your own custom mask into the pycortex filestore so that it is automatically detected is currently a bit weird (I've never done this and don't know exactly what it would take off-hand)--masks belong to transforms, so you would need to place it in the directory for your transform with the right filename and right format. Supplying a mask using the |
can you tell me how to create the subject and transform into the build fileFileNotFoundError: [Errno 2] No such file or directory: 'build/bdist.macosx-10.9-x86_64/wheel/pycortex-1.1.1.data/data/share/pycortex/db/'sub_id'/transforms/'XXX'/matrices.xfm' |
Following the 2015 Paper, Step 1 and Step 2 successfully segment and made a Sub01 folder and files in db.
However, the third step shows error, since the variable data was not set.
cortex.webshow(( data, "Sub01" ,"transform_name " ))
I thought step2 will pass the part of 'functional.nii.gz' to step 3 but it wasn't.
What should be done to visualize (part of) aligned functional.nii.gz. in 3rd step?
The text was updated successfully, but these errors were encountered: