help > Mismatched dimensions Error in Setup
Showing 1-21 of 21 posts
Display:
Results per page:
Feb 25, 2020  07:02 PM | Hongru Zhu
Mismatched dimensions Error in Setup
Hi there,
I am using the newest version to conduct the data imported from fmriprep. Since before prepossessing in fmriprep, I delete 5 time points in the raw data. I found you uploaded a patch in conn18, but it seems does not work for the conn19b. I appreciate if someone could offer some ways to solve this problem.

Thanks
Hongru

ERROR DESCRIPTION:

ERROR: Subject 41 Session 1 first-level covariate realignment mismatched dimensions (205 rows, while functional data has 200 scans; the number of rows of a first-level covariate should equal the number of scans for this subject/session)
ERROR: Subject 41 Session 1 first-level covariate scrubbing mismatched dimensions (205 rows, while functional data has 200 scans; the number of rows of a first-level covariate should equal the number of scans for this subject/session)
Feb 26, 2020  05:02 AM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi,
I want to add more details about this issue. I found just 30 of my subjects appear this error when I processed all my 151 subjects. However, when I just dida single analysis choosing one subjects who was reported mismatched error, it works fine. And when I checked the CNN_X, indeed, I found the confounds are 205 row, while I only have 200 time points. Even I checked the subjects without error, I cannot understand how the confounds in CONN come from. Because the confounds are not same with they are in fmriprep's regressor.csv, eg,"QC_csf" is not the  "csf" in fmriprep's csv file. Very Appreciate if someone could explain what is the relationship between confounds in CONN and the original confounds in csv from fmriprep, since I found they are not the same. And I think maybe that is why I got 205 row confounds even though it is only 200 row in original csv file. I also attached my original regressor.csv from fmriprep.

Thanks!
Hongru
Feb 26, 2020  05:02 AM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Here is the realignment of this subjects in CONN, which is 205 row now.
Attachment: data.mat
Feb 26, 2020  09:02 AM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru

That is strange. My guess is that perhaps fmriprep preprocessing steps did not correctly finished for 30 of your subjects and these subjects'  *regressor.tsv files may be missing? To check this, could you please:

1) start from zero a new project using the option 'Project. New (import). From fMRIPrep dataset' (not the 'Tools.Import.From fMRIPrep' option on an already existing project; this is to avoid mixing up any pre-existing data in your project with the data that you are trying to import)

2) select your study root fmriprep folder, then click on 'select' and 'import' to import the data for all 151 subjects

After this finishes, manually check in the Setup.Covariates (1st-level) tab whether the QC_* covariates exist for all subjects (subjects where the regressor.csv file does not exist or could not be read will appear as having empty/missing first-level covariate data). If in doubt, please send me your conn_*.mat file and I will take a look to see if I find something amiss there

Best
Alfonso
Originally posted by Hongru Zhu:
Hi,
I want to add more details about this issue. I found just 30 of my subjects appear this error when I processed all my 151 subjects. However, when I just dida single analysis choosing one subjects who was reported mismatched error, it works fine. And when I checked the CNN_X, indeed, I found the confounds are 205 row, while I only have 200 time points. Even I checked the subjects without error, I cannot understand how the confounds in CONN come from. Because the confounds are not same with they are in fmriprep's regressor.csv, eg,"QC_csf" is not the  "csf" in fmriprep's csv file. Very Appreciate if someone could explain what is the relationship between confounds in CONN and the original confounds in csv from fmriprep, since I found they are not the same. And I think maybe that is why I got 205 row confounds even though it is only 200 row in original csv file. I also attached my original regressor.csv from fmriprep.

Thanks!
Hongru
Feb 26, 2020  06:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
I did what you suggested. I found every subjects has their regressors, but this time only 14 subjects show size of 205, which is inconsistent with their original regressor.csv from fmriprep (200). The rest of 137 subjects are fine. I have not find ways to upload the conn_*.mat since it was 83mb, and attached the 14 subjects's original regressor.csv here.

Thanks
Hongru
Attachment: regressors.zip
Feb 26, 2020  06:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Here I also attached the con_*.mat via google drive. here is the link https://drive.google.com/open?id=1So6ELX...
Feb 26, 2020  07:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
And I am going to add some thing really strange. When I copy these 14 subjects that shown errors to another folder, and used OPEN new from fmriprep separately, this time all covariates for each subjects turns to size 200! Even though they were wrong when I import all 151 subjects.  However, this time when I click DONE in Setup, another error pop up, which said one subject's bold image only has 14, while the covariates is 200. So, I doubt this happened in the import step. I attached the conn_*.mat for these 14 subjects.

Thanks

Hongru
Attachment: conn_errorsSub.mat
Feb 26, 2020  09:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Thanks for the thorough report, that was very useful!
I took a closer look and your data and I believe the issue here was a bug in CONN when dealing with non-zero-padded BIDS subjectID numbers. Could you please try the attached patch and let me know if you are still running into any issues? (this patch is for release 19b, to install it simply unzip this file and copy the two .m files there to your conn distribution folder overwriting the files with the same name there)

Thanks
Alfonso
Originally posted by Hongru Zhu:
And I am going to add some thing really strange. When I copy these 14 subjects that shown errors to another folder, and used OPEN new from fmriprep separately, this time all covariates for each subjects turns to size 200! Even though they were wrong when I import all 151 subjects.  However, this time when I click DONE in Setup, another error pop up, which said one subject's bold image only has 14, while the covariates is 200. So, I doubt this happened in the import step. I attached the conn_*.mat for these 14 subjects.

Thanks

Hongru
Attachment: patch20200226.zip
Feb 26, 2020  09:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,

Thanks for your reply. I applied these two patch. It seems the conditions for multiple subjects is normal now, while I need to change it manully before. However, these 14 subjects still have 205 covariates while others have 200. I attached the new conn_*.mat here.

Thanks
Hongru
Feb 26, 2020  10:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Sorry for the extra trouble, if you have not done so yet please after installing the patch create a new project from the "new (import). From fMRIPrep dataset" option once again (sorry about this, the patch needs to re-do this step in order to get the sorting of the non-zero-padded subject-IDs right, which still does not look correct in your conn project file). Let me know how that goes


Thanks
Alfonso

Originally posted by Hongru Zhu:
Hi Alfonso,

Thanks for your reply. I applied these two patch. It seems the conditions for multiple subjects is normal now, while I need to change it manully before. However, these 14 subjects still have 205 covariates while others have 200. I attached the new conn_*.mat here.

Thanks
Hongru
Feb 26, 2020  10:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
I used the "new (import). From fMRIPrep dataset" option once again, to create a new project, but this problem is still there. I attached the conn_*.mat there.
Feb 26, 2020  10:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,
Sorry, before repeating the import step please install first the attached modified patch file
Thanks
Alfonso
Originally posted by Alfonso Nieto-Castanon:
Hi Hongru,

Sorry for the extra trouble, if you have not done so yet please after installing the patch create a new project from the "new (import). From fMRIPrep dataset" option once again (sorry about this, the patch needs to re-do this step in order to get the sorting of the non-zero-padded subject-IDs right, which still does not look correct in your conn project file). Let me know how that goes


Thanks
Alfonso

Originally posted by Hongru Zhu:
Hi Alfonso,

Thanks for your reply. I applied these two patch. It seems the conditions for multiple subjects is normal now, while I need to change it manully before. However, these 14 subjects still have 205 covariates while others have 200. I attached the new conn_*.mat here.

Thanks
Hongru
Attachment: conn_bidsdir.m
Feb 26, 2020  10:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
To clarify, I report my whole process I did
1. I unzip this file and copy the two .m files there to my conn distribution folder overwriting the files with the same name there
2. Then I input conn in matlab command window and start CONN.
3. I click the "new (import). From fMRIPrep dataset" option to import the data for all 151 subjects.
4. I check in the Setup.Covariates (1st-level) tab whether the QC_* covariates exist for all subjects.
Are there any step I missed? Sorry for that.

Thanks again
Hongru
Attachment: conn_project01.mat
Feb 27, 2020  12:02 AM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Yes, that looks right, are you leaving all default options in the "import from fMRIPrep dataset" tab or doing anything there other than clicking 'select' and 'import'?

In any ways, sorry for all the back and forth, still not able to replicate this issue locally but please try the attached patch and send me the resulting conn_*.mat file and conn_*/logfile.txt as well if possible. 

Thanks!
Alfonso
Originally posted by Hongru Zhu:
Hi Alfonso,
To clarify, I report my whole process I did
1. I unzip this file and copy the two .m files there to my conn distribution folder overwriting the files with the same name there
2. Then I input conn in matlab command window and start CONN.
3. I click the "new (import). From fMRIPrep dataset" option to import the data for all 151 subjects.
4. I check in the Setup.Covariates (1st-level) tab whether the QC_* covariates exist for all subjects.
Are there any step I missed? Sorry for that.

Thanks again
Hongru
Attachment: patch20200227.zip
Feb 27, 2020  06:02 AM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
Yes, I leave all default options in the "import from fMRIPrep dataset" tab. Here I also attached the logfile.txt.

Thanks
Hongru
Attachment: fmripreped.zip
Feb 27, 2020  08:02 AM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Sorry, it seems that for some reason the patch files are not being taken into account when you run the import step. Could you please do the following:

1) type in Matlab "which conn_importbids" (that should point to your conn installation folder, if it does not, cd to a different folder and/or remove other folders from your Matlab path to avoid conflicting versions; if in doubt type "conn_checkdistributionfiles" and see if that lists you any conflicts)

2) unzip the latest patch file (named patch20200227.zip) and copy the 3 files in there to the directory listed in (1) above (overwriting the files with the same name that already exist there)
and 3) re-run (once again, sorry) the "Project.New (import..." step and send me the conn_*.mat file and associated conn_*/logfile.txt file. To double-check, if everything above works fine the logfile should be longer and contain lines of the form "functional ... imported to subject ..."

Thanks
Alfonso
Originally posted by Hongru Zhu:
Hi Alfonso,
Yes, I leave all default options in the "import from fMRIPrep dataset" tab. Here I also attached the logfile.txt.

Thanks
Hongru
Feb 27, 2020  03:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
Thanks for your patience. Here I describe what I did:
1. I delete all existed conn data and files.
2. I deleted the conn from MATLAB path.
3. I download conn again and covered with three patch files (conn_bidsdir.m, conn_importbids.m, and conn_process.m). I just found patch20200226.zip (conn_bidsdir.m, conn_importbids.m) from your relpy to me, and conn_process.m from your reply to maloman. And you update the conn_bidsdir.m in another relpy to me.
3. I set path in MATLAB again (reinstall). 
4. I also update spm12 using "spm_update update". 
5. I typed "which conn_importbids" and got:
D:\MATLAB\R2017b\toolbox\conn\conn_importbids.m
6. I typed "conn_checkdistributionfiles" got:
spm @ D:\MATLAB\R2017b\toolbox\spm12
conn @ D:\MATLAB\R2017b\toolbox\conn 
5. type conn in MATLAB command window to start conn.
6. I re-run the "Project.New (import..."
This issue is still there.
ps. I selected data from 2 subjects who shown 205 covariates when I import all 151 subjects, and re-run these 2 subjects separately. I noticed that this time their covariates back to 200 which is correct. So, this error only happens when I import all subjects. Hope this helpful. 

Thanks
Hongru
Attachment: fmripreped.zip
Feb 27, 2020  08:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Thanks for the thorough description, unfortunately I believe in (3) you may have overwritten the latest patch files (20200227) with an older version of the same files (20200226). Please copy the connn_bidsdir.m and conn_importbids.m files in patch20200227.zip to your current conn distribution folder (D:\MATLAB\R2017b\toolbox\conn\), and then try again (from step 5). 

Thanks
Alfonso
Originally posted by Hongru Zhu:
Hi Alfonso,
Thanks for your patience. Here I describe what I did:
1. I delete all existed conn data and files.
2. I deleted the conn from MATLAB path.
3. I download conn again and covered with three patch files (conn_bidsdir.m, conn_importbids.m, and conn_process.m). I just found patch20200226.zip (conn_bidsdir.m, conn_importbids.m) from your relpy to me, and conn_process.m from your reply to maloman. And you update the conn_bidsdir.m in another relpy to me.
3. I set path in MATLAB again (reinstall). 
4. I also update spm12 using "spm_update update". 
5. I typed "which conn_importbids" and got:
D:\MATLAB\R2017b\toolbox\conn\conn_importbids.m
6. I typed "conn_checkdistributionfiles" got:
spm @ D:\MATLAB\R2017b\toolbox\spm12
conn @ D:\MATLAB\R2017b\toolbox\conn 
5. type conn in MATLAB command window to start conn.
6. I re-run the "Project.New (import..."
This issue is still there.
ps. I selected data from 2 subjects who shown 205 covariates when I import all 151 subjects, and re-run these 2 subjects separately. I noticed that this time their covariates back to 200 which is correct. So, this error only happens when I import all subjects. Hope this helpful. 

Thanks
Hongru
Feb 27, 2020  09:02 PM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi
Sorry for the mix up. This time I used the 3 m files in the patch20200227.zip.
Here I attached the logfile.txt and con_*.m.

>> which conn_importbids
D:\MATLAB\R2017b\toolbox\conn\conn_importbids.m
>> conn_checkdistributionfiles
spm @ D:\MATLAB\R2017b\toolbox\spm12
conn @ D:\MATLAB\R2017b\toolbox\conn


Thanks
Hongru
Attachment: fmripreped.zip
Feb 27, 2020  09:02 PM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions Error in Setup
Hi Hongru,

Sorry but for some reasons you seem not to have yet used the patch20200227.zip files. To double-check type :

edit conn_importbids

then look in line 26. The following is what you will find for each of the three versions of this file (the correct one that we want to use is the latest)

UNPATCHED:       select=cellfun('length',regexp(file_name,['^sub-',id]))>0;
PATCH20200226: select=cellfun('length',regexp(file_name,['^sub-',id,'(?!\d)']))>0;
PATCH20200227: select=cellfun('length',regexp(file_name,['^sub-',id,'$|^sub-',id,'_']))>0;

Hope this helps
Alfonso

Originally posted by Hongru Zhu:
Hi
Sorry for the mix up. This time I used the 3 m files in the patch20200227.zip.
Here I attached the logfile.txt and con_*.m.

>> which conn_importbids
D:\MATLAB\R2017b\toolbox\conn\conn_importbids.m
>> conn_checkdistributionfiles
spm @ D:\MATLAB\R2017b\toolbox\spm12
conn @ D:\MATLAB\R2017b\toolbox\conn


Thanks
Hongru
Feb 28, 2020  12:02 AM | Hongru Zhu
RE: Mismatched dimensions Error in Setup
Hi Alfonso,
I did all the process again and even changed my data/conn path.  Finally, this time it works!
Many thanks for your time!

Best,
Hongru