help > struggling to get SampleData to work on various setups
Showing 1-23 of 23 posts
Display:
Results per page:
Dec 18, 2017  04:12 PM | O Robinson
struggling to get SampleData to work on various setups
I managed to run gPPI successfully a couple of years ago, but am having bad luck setting it up again.

I couldnt get it to work on my windows machine with spm12 or spm8 and matlab2017a and have just switched to linux with spm8 (which is what worked for me previously). I am using matlab R2017b.

I have the most recent gPPI version and have extracted the sampleData.

When I run runOnSampleData.m I get:

%%%

Operands to the || and && operators must be convertible to logical scalar values.

Error in dlmwrite (line 133)
useVectorized = realdata && precnIsNumeric && ~contains('%\',dlm) ...
Error in PPPI (line 861)
dlmwrite([P.subject '_' region1 '_session' num2str(z) '_' P.method '_PPI_regressors.txt'],[OUT.PPI.C
OUT.P.C OUT.Y.C OUT.C.C],' ');
Error in runOnSampleData (line 50)
PPPI(P, ['/home/brain/PPPIv13/running_gPPI_generic' filesep 'sampleData' filesep 'stats' filesep
'gPPI_sampleDataTest.mat']);
Operands to the || and && operators must be convertible to logical scalar values.
Error in rmiml.hasReqDataFile
Error in rmiml.visibleInToolstrip
Operands to the || and && operators must be convertible to logical scalar values.
Error in rmiml.hasReqDataFile
Error in rmiml.visibleInToolstrip

%%%

(n.b I kept getting the "Operands to the || and && operators must be convertible to logical scalar values." error on windows too).

If I silence the Save Output section in PPPI I get:

%%%
P =

struct with fields:
subject: 'sampleData_Study'
directory: '/home/brain/PPPIv13/running_gPPI_generic/sampleData/stats'
VOI: '/home/brain/PPPIv13/running_gPPI_generic/rmedPrecCing.nii'
Region: 'rmedPrec'
analysis: 'psy'
method: 'cond'
Estimate: 1
contrast: 0
extract: 'eig'
Tasks: {1×13 cell}
Weights: []
equalroi: 1
FLmask: 0
CompContrasts: 1
Contrasts: [1×2 struct]
Log File: sampleData_Study_PPPI_12_18_2017_6.log
PPPI Version: 13.1.4-17-2014
Parameters used:
Processing subject: sampleData_Study
VOI file : /home/brain/PPPIv13/running_gPPI_generic/rmedPrecCing.nii
Output file will be: sampleData_Study_rmedPrec_session#_cond_PPI_regressors.txt
Contrast : No adjustment
Analysis : Psychophysiological Interactions
Extraction : eigenvariate
Tasks : _0_etoh_on_onsets_run1_etoh_off_onsets_run1_etoh_urge_onsets_run1_attn_on_onsets_run1_attn_off_onsets_run1_attn_urge_onsets_run1_etoh_on_onsets_run2_etoh_off_onsets_run2_etoh_urge_onsets_run2_attn_on_onsets_run2_attn_off_onsets_run2_attn_urge_onsets_run2
Method : Condition Specific
VOI has 549 voxels in 3x3x3 space
VOI has 549 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
VOI has 549 voxels in 3x3x3 space
VOI has 549 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
Estimation Failed
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
PPI Contrasts were not estimated for some reason.
Operands to the || and && operators must be convertible to logical scalar values.
Error in rmiml.hasReqDataFile
Error in rmiml.visibleInToolstrip
Operands to the || and && operators must be convertible to logical scalar values.
Error in rmiml.hasReqDataFile
Error in rmiml.visibleInToolstrip

%%%

Ive run out of debugging ideas at this point! Its not an issue with MATLAB 2017 is it? Any help at all gratefully received! Thanks for providing this tool!
Dec 18, 2017  05:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
It appears that the task names are not being set correctly in Matlab2017 (there is only 1 Task listed in Tasks:).

I'm looking into the source of this now. Did the program generate an SPM.mat in the directory specified for the gPPI output?

Can you send me the P.mat file as well?

Best,
Donald
Dec 18, 2017  05:12 PM | O Robinson
RE: struggling to get SampleData to work on various setups
An SPM is made. P.mat attached (I edited this as a .zip i tried earlier didnt work)

What version of MATLAB are you confident it works in? l can try installing that tomorrow and see if I have better luck.

Thanks!
Attachment: P.mat
Dec 18, 2017  05:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
The latest version I have is Matlab2015b, but I think it's just a parsing issue in the configuration, so I should be able to get a testable fix for you to run on Matlab2017, plus users will switch and need the fix.
Dec 18, 2017  05:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Looks like on P.mat got attached.
Dec 18, 2017  05:12 PM | O Robinson
RE: struggling to get SampleData to work on various setups
And SPM.mat attached here
Attachment: SPM.mat
Dec 18, 2017  05:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
The attached SPM.mat is for the first-level model, is there an SPM.mat for the gPPI model?
Dec 18, 2017  08:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Could you please check if you have multiple pathdef.m files in your path?

>> which -all pathdef.m
The 'pathdef.m' that is currently used must be the one pertaining to the release of MATLAB you are using currently. If an older 'pathdef.m' exists, it will shadow the new one and does not add the directory to the path, which results in the error.
Renaming the old 'pathdef.m', if you have one, should fix the error.

*This seems like it might be a common issue with Matlab2017a
Dec 19, 2017  08:12 AM | O Robinson
RE: struggling to get SampleData to work on various setups
I only have one pathdef:

/usr/local/MATLAB/R2017b/toolbox/local/pathdef.m

(this is actually a brand new install on a NeuroDebian virtual box).

Is the attached SPM the PPI one?
Dec 19, 2017  08:12 AM | O Robinson
RE: struggling to get SampleData to work on various setups
Trying to post SPM again! (this system really doesnt like my attachments!)
Attachment: SPM.mat
Dec 19, 2017  02:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Yep. I now have both PPI files. I'll try to see what is going on now.
Dec 19, 2017  02:12 PM | O Robinson
RE: struggling to get SampleData to work on various setups
N.B I have now tried re-running with Matlab 2015a using linux and spm8. I deleted and re extracted the sample data. The && error and save error go away, but there are still issues with estimating the contrasts
 
%%%
Log File: sampleData_Study_PPPI_12_19_2017.log

PPPI Version: 13.1.4-17-2014
Parameters used:
Processing subject: sampleData_Study
VOI file : /home/brain/PPPIv13/running_gPPI_generic/rmedPrecCing.nii
Output file will be: sampleData_Study_rmedPrec_session#_cond_PPI_regressors.txt
Contrast : No adjustment
Analysis : Psychophysiological Interactions
Extraction : eigenvariate
Tasks : _0_etoh_on_onsets_run1_etoh_off_onsets_run1_etoh_urge_onsets_run1_attn_on_onsets_run1_attn_off_onsets_run1_attn_urge_onsets_run1_etoh_on_onsets_run2_etoh_off_onsets_run2_etoh_urge_onsets_run2_attn_on_onsets_run2_attn_off_onsets_run2_attn_urge_onsets_run2
Method : Condition Specific
VOI has 549 voxels in 3x3x3 space
VOI has 549 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
VOI has 549 voxels in 3x3x3 space
VOI has 549 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
Estimation Failed
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
PPI Contrasts were not estimated for some reason.

%%
Dec 19, 2017  03:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Hi All,

I believe that I have identified the issue with the test dataset. It appears that the SPM.swd field is not properly being set, as such it causes an error.

I am checking the test dataset code now to see if this is indeed the case. Testing will likely be complete tomorrow or Thursday to make sure there are no other issues.

Best,
Donald
Dec 19, 2017  03:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Did you run "prepareToRunOnSampleData.sh" first?

If not, could you run that command, then try using the newly generated runOnSampleData.m?


I think this might resolve the issue.
Dec 19, 2017  03:12 PM | O Robinson
RE: struggling to get SampleData to work on various setups
Yes, I did this. I removed all the old data, redownloaded the zip and re-ran the bash script.
Dec 19, 2017  03:12 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
Can you update the template with the attached version, then re-run the bash script.

I think I found the issue and have fixed it -- SPM.mat files weren't being updated with new file locations.

If it works, I'll work on a new distribution for both windows and linux.
Dec 19, 2017  03:12 PM | O Robinson
RE: struggling to get SampleData to work on various setups
spm_changepath is broken now:

%%
Error using spm_changepath (line 53)
Cannot load
/Users/mclaren/Downloads/data_day3/running_gPPI_generic_spm12Octtest/sampleData/stats/SPM.mat.
Error in runOnSampleData (line 3)
spm_changepath(['/Users/mclaren/Downloads/data_day3/running_gPPI_generic_spm12Octtest'
filesep 'sampleData' filesep 'stats' filesep 'SPM.mat'],
'/export/research/analysis/human/khutchison/etohtaste_07226/AUTO_ANALYSIS/triotim/M87103240/Study20080417at142008/analysis/TASTE_IND_TIM/stats',
['/home/brain/PPPIv13/running_gPPI_generic' filesep 'sampleData' filesep
'stats'] );
Jan 24, 2018  05:01 PM | Donald McLaren
RE: struggling to get SampleData to work on various setups
I'm going to create a new version of SampleData from scratch and upload it again.
Jul 9, 2018  02:07 PM | wyl_phding - VUB
RE: struggling to get SampleData to work on various setups
Hi, i just got the same error as yours with gPPI
Aug 1, 2019  10:08 AM | Sónia Ferreira
RE: struggling to get SampleData to work on various setups
Originally posted by wyl_phding:
Hi, i just got the same error as yours with gPPI

Hi there,

I'm trying to run runOnSampleData.m on Windows with SPM12 to test gPPI but I get the following error:
spmpath =

'C:\Users\sonia\Documents\MATLAB\spm12'
Log File: sampleData_Study_PPPI_8_1_2019.log
PPPI Version: 13.1.4-17-2014
Parameters used:
Processing subject: sampleData_Study
VOI file : C:\Users\sonia\Desktop\running_gPPI_generic\rmedPrecCing.nii
Output file will be: sampleData_Study_rmedPrec_session#_cond_PPI_regressors.txt
Contrast : No adjustment
Analysis : Psychophysiological Interactions
Extraction : eigenvariate
Tasks : _0_etoh_on_onsets_run1_etoh_off_onsets_run1_etoh_urge_onsets_run1_attn_on_onsets_run1_attn_off_onsets_run1_attn_urge_onsets_run1_etoh_on_onsets_run2_etoh_off_onsets_run2_etoh_urge_onsets_run2_attn_on_onsets_run2_attn_off_onsets_run2_attn_urge_onsets_run2
Method : Condition Specific
VOI has 549 voxels in 3x3x3 space
VOI has 549 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.

Operands to the || and && operators must be convertible to logical scalar values.
Error in dlmwrite (line 133)
useVectorized = realdata && precnIsNumeric && ~contains('%\',dlm) ...
Error in PPPI (line 862)
dlmwrite([P.subject '_' region1 '_session' num2str(z) '_' P.method '_PPI_regressors.txt'],[OUT.PPI.C OUT.P.C OUT.Y.C OUT.C.C],' ');
Error in runOnSampleData (line 48)
PPPI(P, [workdir filesep 'sampleData' filesep 'stats' filesep 'gPPI_sampleDataTest.mat']);

Do you know if there is a new version of runOnSampleData.m already? The one that I downloaded is from 2013, but I couldn't find other.

Thanks a lot!
Aug 1, 2019  10:08 AM | Sónia Ferreira
RE: struggling to get SampleData to work on various setups
Sorry, right after writing the post I found the solution :)

So I renamed the contains.m inside the PPPI directory to old_contains.m (following this [url=https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=spm;bc9a2a3c.1803]post[/url]) and I replaced the function spm_contrasts_PPI.m by the new version here.

Hope it helps someone!

Regards,

Sónia
Dec 17, 2021  03:12 PM | Ehssan Amini
RE: struggling to get SampleData to work on various setups
Originally posted by Donald McLaren:
I'm going to create a new version of SampleData from scratch and upload it again.
Dear Dr.McLaren

Hope you are doing well.

I am trying to apply gPPI on SPM 12, Matlab 2021b, Mac.
I downloaded the toolbox, adapted it with SPM 12 and added it to the path as the manual document.
In my first attempt with sample data I also faced with the "Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values" error.
Based on the information on current forum I excluded the Contains.m file and replaced runOnSampleData.m.Template with the file presented here.

Now I get the error:

Error using spm_changepath (line 57)
Cannot load "/Users/mclaren/Downloads/data_day3/running_gPPI_generic_spm12Octtest/sampleData/stats/SPM.mat".

Error in runOnSampleData (line 3)
spm_changepath(['/Users/mclaren/Downloads/data_day3/running_gPPI_generic_spm12Octtest' filesep 'sampleData' filesep 'stats' filesep 'SPM.mat'], '/export/research/analysis/human/khutchison/etohtaste_07226/AUTO_ANALYSIS/triotim/M87103240/Study20080417at142008/analysis/TASTE_IND_TIM/stats', ['/Users/eamini/Desktop/running_gPPI_generic' filesep 'sampleData' filesep 'stats'] );

Could you please help me with the matter.
Best,
Ehssan

Dec 20, 2021  03:12 PM | Ehssan Amini
RE: struggling to get SampleData to work on various setups
The issue is resolved.

In this case there was another folder added to the Matlab path I was not aware of. (folder name was NVC and it included the whole PPI package) So I also changed the name of "Contains.m" in this folder and everything worked out. 
notice: It worked with the first "runOnSampleData.m.Template" file. no change was needed.