Skip to content

Catch empty images #761

@MichaelStritt

Description

@MichaelStritt

Description

In xASL_module_ASL it can happen that the loaded image is empty. This should lead to an error in the following part, but shouldn't crash the pipeline. I suggest this simple edit:

Old:

%% Skip processing if invalid image

tempASL = xASL_io_Nifti2Im(x.P.Path_ASL4D);
if max(tempASL(:))==0 || numel(unique(tempASL(:)))==1
    error('Invalid ASL image');
end

New:

%% Skip processing if invalid image
tempASL = xASL_io_Nifti2Im(x.P.Path_ASL4D);
if isempty(tempASL) || (max(tempASL(:))==0 || numel(unique(tempASL(:)))==1)
    error('Invalid ASL image');
end

Requirements

Optional: add bug requirements here

How to test

Optional: insert description about how to test the code changes here

Release notes

Stop pipeline from crashing for empty NIfTI files.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions