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 Project/checkExistings if nProcessedFiles > 0 (without GUI) #57

Open
morryis opened this issue Feb 2, 2022 · 1 comment
Open

Comments

@morryis
Copy link

morryis commented Feb 2, 2022

I am using automagic without GUI. When calling preprocessAll() I get an error whenever nProcessedFiles > 0:
`>> project.preprocessAll();
Index exceeds the number of array elements (0).

Error in Project/checkExistings (line 1654)
[main_pos(3)/2/screen_size(3) main_pos(4)/2/screen_size(4)], ...

Error in Project/preprocessAll (line 441)
skip = self.checkExistings();`
The variable "main_pos" is empty when running the scripts without GUI. Possible solution could be to add an additional parameter e.g. skip_existing = true/false

@ksgfan
Copy link
Collaborator

ksgfan commented Feb 15, 2022

Hi, thanks for catching that!

For now, we will only check whether the main_pos is empty. If yes, there will be no option of skipping the files, but the preprocessed files will be skip per default.

if ~isempty(main_pos)
        screen_size = get( groot, 'Screensize' );
        choice = MFquestdlg(...
            [main_pos(3)/2/screen_size(3) main_pos(4)/2/screen_size(4)], ...
            ['Some files are already processed. Would ',...
            'you like to overwrite them or skip them ?'], ...
            'Pre-existing files in the project folder.',...
            'Over Write', 'Skip','Over Write');
        switch choice
            case 'Over Write'
                skip = 0;
            case 'Skip'
                skip = 1;
        end
end

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