Dear Amy
The NYU dataset has a fixed number of sessions per subject so the conn_batch_workshop_nyudataset.m code expects to find that (the same number of sessions for every subject). If your data is in BIDS format you could more easily import that data into CONN directly from the GUI using the 'Project -> New (import from BIDS dataset)' functionality, which will automatically adapt to a dataset with variable number of sessions per subject. Alternatively, you would want to modify your script to allow a variable number of sessions per subject (e.g. start by creating a list of 222 numbers, each ranging from 1 to 104, indicating the subject number associated with each of the 222 functional files, and then change in the code the lines that define batch.Setup.functionals, batch.Setup.structurals, and batch.Setup.conditions to read in the appropriate file for each subject and session)
Hope this helps
Alfonso
Originally posted by Amy Wang:
Hello,
We are new to CONN and would love some help trying to set up preprocessing for resting state analysis. We are working with 104 participants, each with varying 1-3 sessions (totaling to 222 sessions), so we wanted to script for bulk importing scans to CONN. However, we have been stuck on the file loading step. We are using the code adapted from the conn_batch_workshop_nyudataset.m to load structural and functional files, but have been getting the error "mismatch number of functional files".
We have tried a few things ourselves trying to figure out the error: making sure that structural and resting files are consistent/matching for participants/sessions, checking that there's no duplicates or missing files, looking for typos, unzipping the files before running the code, etc. However, we are still getting the same error message. One thing we have noticed is that when we change "nsubjects" to 222 (total number of sessions), the code runs, but it no longer recognizes the different sessions for each subject. Under "Workspace", we do see that under Functional_File and Structural_File, the correct file path is listed, with the matching subject/session. We can't seem to figure out why or what the mismatch is referring to? I have attached a screenshot of our MATLAB workspace here. We would appreciate any help or suggestions to try next.
Thank you!
Threaded View
| Title | Author | Date |
|---|---|---|
| Amy Wang | Mar 5, 2025 | |
| Alfonso Nieto-Castanon | Mar 6, 2025 | |
