gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
582 stars 137 forks source link

repeated volume dataset in webshow #167

Closed sealhuang closed 7 years ago

sealhuang commented 8 years ago

Dear pycortex team,

I'm attempting to display a volume dataset which only cover visual area using webshow, however, it seems like a repeated volume which cover whole brain was projected onto the surface (see attanchement). Is there any way to avoid this settings or anything I missed in the procedure.

I did this with following lines. first, I have align the volume with the anatomical surface, resulting the transform retinotopy2anat, and I display the volume on the surface dv = cortex.Volume('S1_roi_mask.nii.gz', 'S1', 'retinotopy2anat') cortex.webshow(dv)

image

pbeukema commented 7 years ago

Have you tried setting those voxels which don't contain any data to NaN?

sealhuang commented 7 years ago

Thank you for your reply @pbeukema In fact, the volume data only covers the occipital region, not whole brain, that's why I think there may be something wrong for webshow procedure. I have tried many possibilities, and finally I fix the problem. I change the shape of 3D volume data, i.e., I reshape the 3D data from (18, 64, 64) to (64, 64, 18), the data can be correctly displayed. The point is the axis with the minimum length should be at the final position.

alexhuth commented 7 years ago

Pycortex always expects volumes to be provided in (x,y,z) order, but with coronal slice prescriptions there seems to be some wiggle in that definition. I believe what we actually expect is more like (readout, phase encode, slice) order.

Anyway, I'm glad you managed to solve the problem!