Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning in running rmMain: "Warning: Matrix is close to singular (...)" #344

Open
fails1to1compile09 opened this issue Sep 1, 2020 · 4 comments

Comments

@fails1to1compile09
Copy link

fails1to1compile09 commented Sep 1, 2020

Dear Experts,

We're now running the pRF model on the new lab Macbook (Mojave - we bought an older version).
Everything seems to work. We do mrInit, alignment, averaging over scans, defining the gray 3 window, transforming from inplane to gray (trilinear interpolation) and defining the stimulus parameters. But when we then run the pRF in its simplest form, we get the following warning (plus other messages for context) in 2 of 3 subjects:


[niftiApplyXform:] The transform does not need to be applied. Returning nifti without change.
Done xforming tSeries.
Updated stored stimulus parameters in dataTYPES.
[rmDefineParameters]:Stimulus size: 8.00deg.
[rmDefineParameters]:Scan 1:HRF type: [two gammas (spm style)]; parameters: [ 5.40 5.20 10.80 7.35 0.35]. (01-Sep-2020 16:42:53)
[rmDefineParameters]:PRF size spacing: from 0.20 to 8.00 deg (24).
[rmDefineParameters]:Stimulus sample size: 0.16 deg.
[rmDefineParameters]:Minimimal pRF position spacing in triangular grid: 0.47 deg.
[rmDefineParameters]:Number of [x,y,s] models for grid search: 68406.
[makeStimFromScan]: Loading images: /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Stimuli/stimulus_images_20161010T142525.mat...
[makeStimFromScan]: Loading images for scan 1...
[makeStimFromScan]: Filtering images...
[makeStimFromScan]: Downsampling images to stimulus grid...
[makeStimFromScan]: Averaging images within a TR...
[makeStimFromScan]: Done.
Updated stored stimulus parameters in dataTYPES.
[rmDefineParameters]:Stimulus size: 8.00deg.
[rmDefineParameters]:Scan 1:HRF type: [two gammas (spm style)]; parameters: [ 5.40 5.20 10.80 7.35 0.35]. (01-Sep-2020 16:43:35)
[rmDefineParameters]:PRF size spacing: from 0.20 to 8.00 deg (24).
[rmDefineParameters]:Stimulus sample size: 0.16 deg.
[rmDefineParameters]:Minimimal pRF position spacing in triangular grid: 0.47 deg.
[rmDefineParameters]:Number of [x,y,s] models for grid search: 68406.
[makeStimFromScan]: Loading images: /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Stimuli/stimulus_images_20161010T142525.mat...
[makeStimFromScan]: Loading images for scan 1...
[makeStimFromScan]: Filtering images...
[makeStimFromScan]: Downsampling images to stimulus grid...
[makeStimFromScan]: Averaging images within a TR...
[makeStimFromScan]: Done.
[reserveToolbox]:optimization toolbox reserved.
[rmDefineParameters]:Stimulus size: 8.00deg.
[rmDefineParameters]:Scan 1:HRF type: [two gammas (spm style)]; parameters: [ 5.40 5.20 10.80 7.35 0.35]. (01-Sep-2020 16:43:45)
[rmDefineParameters]:PRF size spacing: from 0.20 to 8.00 deg (24).
[rmDefineParameters]:Stimulus sample size: 0.16 deg.
[rmDefineParameters]:Minimimal pRF position spacing in triangular grid: 0.47 deg.
[rmDefineParameters]:Number of [x,y,s] models for grid search: 68406.
[makeStimFromScan]: Loading images: /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Stimuli/stimulus_images_20161010T142525.mat...
[makeStimFromScan]: Loading images for scan 1...
[makeStimFromScan]: Filtering images...
[makeStimFromScan]: Downsampling images to stimulus grid...
[makeStimFromScan]: Averaging images within a TR...
[makeStimFromScan]: Done.
[rmMain]:Two stage coarse-to-fine fit.
[rmGridFit]:Making 68406 model samples:..........Done[0 min]. (01-Sep-2020 16:43:59)
[dhkGraySmooth]:Smoothing data:...Done[0.1min].
[rmMakeTrends]: Removing 7 trends from combined data.
[rmGridFit]: Decimating data:...
[rmGridFit]:Number of voxels: 29306.
[rmGridFit_oneGaussian]:Estimated processing time: 9 minutes. (01-Sep-2020 16:45:12)
[rmGridFit_oneGaussian]:Grid (x,y,sigma) fit:..........Done[10 minutes]. (01-Sep-2020 16:54:07)
[rmSave]:Saved /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Gray/Averages_all_3motcomp/retModel-20200901-164345-gFit.mat.
[reserveToolbox]:optimization toolbox reserved.
[rmMakeTrends]: Removing 7 trends from combined data.
[rmSearchFit]:Processing voxels with variance explained >= 0.10
[rmSearchFit_oneGaussian]:Estimated processing time: 80703 voxels: 4 hours.
[rmSearchFit_oneGaussian]:Nonlinear optimization (x,y,sigma):......
_> In backsolveSys
In solveKKTsystem
In computeTrialStep
In barrier
In fmincon (line 798)
In rmSearchFit_oneGaussian (line 73)
In rmSearchFit (line 362)
In rmMain (line 128)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.238763e-16.

In backsolveSys
In solveKKTsystem
In computeTrialStep
In barrier
In fmincon (line 798)
In rmSearchFit_oneGaussian (line 73)
In rmSearchFit (line 362)
In rmMain (line 128)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 5.577999e-17.
In backsolveSys
In solveKKTsystem
In computeTrialStep
In barrier
In fmincon (line 798)
In rmSearchFit_oneGaussian (line 73)
In rmSearchFit (line 362)
In rmMain (line 128)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 5.577999e-17.
In backsolveSys
In solveKKTsystem
In computeTrialStep
In barrier
In fmincon (line 798)
In rmSearchFit_oneGaussian (line 73)
In rmSearchFit (line 362)
In rmMain (line 128)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.919709e-16.
In backsolveSys
In solveKKTsystem
In computeTrialStep
In barrier
In fmincon (line 798)
In rmSearchFit_oneGaussian (line 73)
In rmSearchFit (line 362)
In rmMain (line 128)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.919709e-16._
....Done [5 hours].
[rmSearchFit_oneGaussian]:Removed negative fits: 1129 (1.4%).
[rmSave]:Saved /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Gray/Averages_all_3motcomp/retModel-20200901-164345-sFit.mat.
[reserveToolbox]:optimization toolbox reserved.
[rmMakeTrends]: Removing 7 trends from combined data.
[rmSearchFit]:Processing voxels with variance explained >= 0.00
[rmSearchFit_oneGaussian]:Estimated processing time: 116577 voxels: 2 minutes.
[rmSearchFit_oneGaussian]:Nonlinear optimization (x,y,sigma):..........Done [2 minutes].
[rmSearchFit_oneGaussian]:Removed negative fits: 5398 (4.6%).
[rmSave]:Saved /Users/PC/Documents/30_8_2020/XXX/XXX_PC_newVistaSoft/Gray/Averages_all_3motcomp/retModel-20200901-164345-fFit.mat.


For further context, we run with a version of vistasoft that was downloaded on 11 May 2020. When we try to run with the version we downloaded on 6 October 2019, we don't get the error.

Can someone here help us interpret the Warning? Is it problematic or can we proceed?

@fails1to1compile09
Copy link
Author

Anyone? Are any extra details required?

@marco-create
Copy link

marco-create commented Nov 18, 2020

Hi, I work on Windows but I encountered a similar warning related to the matrix.
During the definition of the stimuli (I did this step using the GUI), change the Image filter from none to binary.
This fixed the warning for me.

Basically when defining the stimulus using binary, you just create a black 'n white image of the stimulus. That's how I understood this.

@fails1to1compile09
Copy link
Author

Thank you so much for the reply and the good suggestion. Unfortunately, in this case, we're already setting it to the binary stimulus filter. We have the problem despite that.

Yours sincerely,

F

@marco-create
Copy link

@fails1to1compile09 I'm back again because I encountered the same warning and I remembered you posted here the issue.
I checked the defined parameters for the stimuli and I noticed that I left the hrf type to One Gamma (Boynton style), instead of using the Two gammas (SPM style).

As soon as I changed it to two gammas, I no longer received the warning.

But, well, I just noticed in the log you pasted, that probably you already used that setting:

> [rmDefineParameters]:Scan 1:HRF type: [two gammas (spm style)]; parameters: [ 5.40 5.20 10.80 7.35 0.35]. (01-Sep-2020 16:42:53)

But it's still worth a try
¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants