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

Error in seq.default(logpmin, logpmax, length.out = Nh) : 'to' must be a finite number #3

Closed
matthigger opened this issue Mar 27, 2019 · 4 comments

Comments

@matthigger
Copy link

I'm struggling with what looks like a numerical issue. Running this stat file and mask seem to get me in trouble:

library(oro.nifti) 
library(pTFCE) 
Z=readNIfTI('stat.nii.gz') 
MASK=readNIfTI('mask.nii.gz') 
pTFCE=ptfce(Z, MASK) 

Estimating smoothness based on the data...
|=============================================================| 100%
Error in seq.default(logpmin, logpmax, length.out = Nh) :
'to' must be a finite number

here are the files I'm working with. I checked to ensure all values are above board, the statistic is positive across the whole mask.

mask.nii.gz
stat.nii.gz

(Also, thanks for the great software! the download / install / test example all went beautifully)

@spisakt
Copy link
Owner

spisakt commented Mar 28, 2019

Hi @matthigger,
Are you sure your input is a valid z-score image?
It does not look like any real data application I have seen before.
You have some unrealistically high Z-scores, that's why pTFCE crashes with overflow.

Depending on hardware, Z-score greater than about 35 will cause this error.
If you are sure that you want to enhance this map, consider truncating Z values at a reasonable level.
It shouldn't affect the results of the enhancement very much.

Cheers,
Tamas

@spisakt spisakt closed this as completed Mar 28, 2019
@spisakt spisakt pinned this issue Mar 28, 2019
@matthigger
Copy link
Author

Hi @spisakt,

You're right, they aren't Z scores, I'm simulating effects to measure sensitivity. I suspect that these super high scores (T^2 stats) occur only in the obvious effects which are easily recovered, so I bet I'll only need to threshold for those straightforward examples which aren't so interesting anyways.

Thanks again for the speedy response. Cheers,

-Matt

@spisakt
Copy link
Owner

spisakt commented Mar 29, 2019

Hi Matt,
Please note that pTFCE is only valid with Z-scores as input!
Otherwise you are right, practically no enhancement is needed for very high peaks, thus truncating peaks to e.g. 30 will still do the job and enhnace low-intensity border regions equally well.

Cheers,
Tamas

@matthigger
Copy link
Author

Hi Tamas,

Sorry, I misunderstood that bit. I'll be sure to represent it as a Z score in the analysis.

Best,

-Matt

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