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

Results for .mat inputs are computed for all data elements and not only the in-mask elements #167

Open
BryanGuillaume opened this issue Apr 30, 2020 · 0 comments
Assignees

Comments

@BryanGuillaume
Copy link
Collaborator

The contrast and statistic results for .mat inputs are computed for all data elements while it should suffice to do it for the in-mask elements only. This is not a bug per se as the out-mask results are not of interest, but this is unnecessary and this could potentially yield warning or error message.

It seems that the change needs to be done in swe_contrasts.m. For example,

SwE-toolbox/swe_contrasts.m

Lines 143 to 146 in 35d549e

if isMat
beta = importdata(Vbeta);
S = size(beta,2);
end

shows that S, which is supposed to represent the number of in-mask elements is set to the total number of elements, which is wrong. I believe the main issue comes from the way the data is loaded in memory. For images, we can load directly the in-mask elements while for .mat files, it seems necessary to load everything and then select the in-mask elements, which is not done here.

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

No branches or pull requests

1 participant