MedARC-AI / fMRI-reconstruction-NSD

fMRI-to-image reconstruction on the NSD dataset.
MIT License
307 stars 44 forks source link

Dataset Issue #33

Closed DavisMeee closed 1 year ago

DavisMeee commented 1 year ago

Dear Paul,

I would like to know how you extract the data during the preprocessing stage. If it is convenient, would you like to provide a simple example program for reference?

Best,

PaulScotti commented 1 year ago

We used the outputs from GLMSingle provided by the NSD authors and then made our own webdatasets (similar to the following code):

https://github.com/MedARC-AI/fMRI-Algonauts-Challenge-2023/blob/main/src/algo_webdataset_creation.ipynb

DavisMeee commented 1 year ago

Dear Paul,

Thank you for your reply, but there's still a small question about the code. I noticed there's a normalization step when extracting brain signals from your own webdatasets. So I'm wondering if the data has been normalized in this work.

image

Best,

PaulScotti commented 1 year ago

Yes all betas are session-wise z-scored

littlepure2333 commented 10 months ago

@PaulScotti , Hi Paul, thanks for sharing the code. But I still have some questions: I am trying to make webdatasets for the rest 4 subjects (3,4,6,8). While using the code, I can not find several files in the original NSD dataset:

lh_file = f"/fsx/proj-medarc/fmri/natural-scenes-dataset/algonauts_data/dataset/{subject}/roi_masks/lh.all-vertices_fsaverage_space.npy"

rh_file = f"/fsx/proj-medarc/fmri/natural-scenes-dataset/algonauts_data/dataset/{subject}/roi_masks/rh.all-vertices_fsaverage_space.npy"

indices_path = "/fsx/proj-medarc/fmri/natural-scenes-dataset/COCO_73k_subj_indices.hdf5"

betas_nsd_mean = np.load(f"/fsx/proj-medarc/fmri/natural-scenes-dataset/challenge_scalars/challenge_mean_sess{sess}_{subj}.npy")

betas_nsd_std = np.load(f"/fsx/proj-medarc/fmri/natural-scenes-dataset/challenge_scalars/challenge_std_sess{sess}_{subj}.npy")

Could you please hint me where these files are? Or do you have the webdatasets of the rest subjects? Really appreciate your kindness and effort❤️

DavisMeee commented 10 months ago

@PaulScotti , Hi Paul, thanks for sharing the code. But I still have some questions: I am trying to make webdatasets for the rest 4 subjects (3,4,6,8). While using the code, I can not find several files in the original NSD dataset:

lh_file = f"/fsx/proj-medarc/fmri/natural-scenes-dataset/algonauts_data/dataset/{subject}/roi_masks/lh.all-vertices_fsaverage_space.npy"

rh_file = f"/fsx/proj-medarc/fmri/natural-scenes-dataset/algonauts_data/dataset/{subject}/roi_masks/rh.all-vertices_fsaverage_space.npy"

indices_path = "/fsx/proj-medarc/fmri/natural-scenes-dataset/COCO_73k_subj_indices.hdf5"

betas_nsd_mean = np.load(f"/fsx/proj-medarc/fmri/natural-scenes-dataset/challenge_scalars/challenge_mean_sess{sess}_{subj}.npy")

betas_nsd_std = np.load(f"/fsx/proj-medarc/fmri/natural-scenes-dataset/challenge_scalars/challenge_std_sess{sess}_{subj}.npy")

Could you please hint me where these files are? Or do you have the webdatasets of the rest subjects? Really appreciate your kindness and effort❤️

You can find all the related resources on huggingface:link

Zoe-Wan commented 9 months ago

I think you can download the mask data from the algonauts 2023 data after filling a short table. @littlepure2333

Zoe-Wan commented 9 months ago

@PaulScotti Hi! I find the subject01's mask used in code https://github.com/MedARC-AI/fMRI-Algonauts-Challenge-2023/blob/main/src/algo_webdataset_creation.ipynb has size 39548, so the subject01's voxel size is 39548. But in this experiment the size is 15724. Are these two experiment using the same preprocess pipeline? Did I miss something?

And btw, I wonder if I can get the 3d voxel [N, 81, 104, 83](like the code in src/models.py:214), not a flattened one, where can I get nsd data like that?

Zoe-Wan commented 9 months ago

I have found the roi data you used! I mistakenly thought you got the data with the script in the link, but the data actually comes from https://natural-scenes-dataset.s3.amazonaws.com/nsddata/ppdata/subj01/func1pt8mm/roi/nsdgeneral.nii.gz .