bachlab / PsPM

A matlab suite for Psycho-Physiological Modelling
GNU General Public License v3.0
43 stars 10 forks source link

Issue running first-level contrasts in DCM/Non-linear tutorial #545

Closed dhewitt16 closed 9 months ago

dhewitt16 commented 1 year ago

Hi,

I am trying to run through the DCM/non-linear SCR tutorial from the PsPM manual. When I try to run the first-level contrasts (section 20.2) following the manual instructions, I get an error:

------------------------------------------------------------------------
12-Oct-2023 18:03:23 - Running job #2
------------------------------------------------------------------------
12-Oct-2023 18:03:23 - Running 'First-Level Contrasts'
Loading data ... 
Writing contrasts to /Users/dhewitt/Data/Tutorial_dataset_DCM/pspm/dcm_s1.mat
Warning: Calculated data.stats contain NaNs that are caused by unknown reasons. data.stats are then used in a
contrasts, producing an invalid result (NaN). 
Warning: Calculated data.stats contain NaNs that are caused by unknown reasons. data.stats are then used in a
contrasts, producing an invalid result (NaN). 
12-Oct-2023 18:03:28 - Failed  'First-Level Contrasts'
Unable to perform assignment because dot indexing is not supported for variables of this type.
In file "/Users/dhewitt/Analysis/PsPM6.1/pspm_con1.m" (???), function "pspm_con1" at line 172.
In file "/Users/dhewitt/Analysis/PsPM6.1/pspm_cfg/pspm_cfg_run_contrast1.m" (???), function "pspm_cfg_run_contrast1" at line 26.

The following modules did not run:
Failed: First-Level Contrasts
If the problem can be fixed without modifying the job, the computation can be resumed by running
   cfg_util('cont',2)
from the MATLAB command line.

I have looked on other threads and can't work out why this issue is happening. I also tried first-level contrasts with my own SCR data and had the same error, which is why I decided to run through the tutorial. If any advice could be given it would be much appreciated. The error, along with the batch jobs and associated files, are attached.

Files.zip

Technical Info

teddychao commented 12 months ago

Hi @dhewitt16 Thanks for posting the issue with so many details. I looked at the issue and I think it is caused by the last line of "NaN" at the file dcm_s1. If you load dcm_s1.mat at locate to dcm.stats, you can see the last line of NaNs. I am not sure about where this file is from. Could you please let me know whether this is from an example file or from your own dataset? Best wishes Teddy

dhewitt16 commented 12 months ago

Hi @teddychao thanks for your reply. I see the NaNs too.

The file is an example file from the non-linear SCR tutorial in the manual (p.20) - the dataset is Tutorial_dataset_DCM downloaded from https://bachlab.github.io/PsPM/software/ (I was not sure which file to download as none matched the instructions, so I downloaded this one and hoped it was correct). The steps were as follows:

  1. Create a timing file - event_timings_s1.mat
  2. Prepare a first-level non-linear model - input filename {dcm_s1}, data file {tpspm_s1.mat - the manual said to select 'tscr_s1.mat' but I do not have a file matching this, perhaps it is the wrong file?), timing file {event_timings_s1.mat}
  3. Within first-level model, specify 3 new conditions:
  • Condition · Name: CS+|US- · Index: 6 7 11 14 16 18 26 29 38 40
  • Condition · Name: CS+|US+ · Index: 13 17 19 20 21 24 28 31 32 37
  • Condition · Name: CS- · Index: 1 2 3 4 5 8 9 10 12 15 22 23 25 27 30 33 34 35 36 39

This then produces the dcm_s1.mat file which I sent previously. I have attached the files. Best wishes, Danielle FirstLevelModelFiles.zip

teddychao commented 11 months ago

Hi @dhewitt16,

Many thanks for the updates.

We have discussed this issue internally and we think it may be caused by some outdated or deprecated content in the document that has not been in line with the latest software. We will need to fix this issue by testing our example data with the latest fixes since there could be incompatibility between the current software and the outdated example data. We apologise for the inconvenience caused by the example data and we understand the frustration cased by the issues. We will try to fix it and provide updated data as soon as possible and then get back to you.

Thank you for using PsPM.

Best wishes Teddy

dhewitt16 commented 11 months ago

Hi @teddychao - this is much appreciated, thank you. I will await your response.

Best wishes,

Danielle