Page 1 of 1

Matlab bfGetPlane - Argument 'y' failed validation

PostPosted: Mon May 19, 2014 2:30 pm
by AlexWright
Hi,

I am currently using bfGetPlane to read in parts of Aperio SVS images to batch process.

I have come across the following error which has tripped up my Matlab script a couple of times:

Error using bfGetPlane (line 58)
Argument 'y' failed validation @(x)isscalar(x)&&ismember(x,1:r.getSizeX()).

Caused by:
Error using bfGetPlane (line 58)
Argument 'y' failed validation @(x)isscalar(x)&&ismember(x,1:r.getSizeX()).


This doesn't happen all the time, but a quick eyeball at the code shows that the isValidY variable is validated using the getSizeX function from the reader object. Is this a bug, and it should be using getSizeY, or am I missing something?

The code I'm on about is on line 53 of bfGetPlane:

Code: Select all
% Optional tile arguments check
isValidX = @(x) isscalar(x) && ismember(x, 1 : r.getSizeX());
isValidY = @(x) isscalar(x) && ismember(x, 1 : r.getSizeX());


Thanks in advance,

Alex.

Re: Matlab bfGetPlane - Argument 'y' failed validation

PostPosted: Mon May 19, 2014 3:53 pm
by sbesson
Hi Alex,

many thanks for the bug report. A Pull request has been opened to fix this function in upcoming releases of Bio-Formats.
In the meantime, you are absolutely right and the correct validators should be

Code: Select all
% Optional tile arguments check
isValidX = @(x) isscalar(x) && ismember(x, 1 : r.getSizeX());
isValidY = @(x) isscalar(x) && ismember(x, 1 : r.getSizeY());


Best,
Sebastien

Re: Matlab bfGetPlane - Argument 'y' failed validation

PostPosted: Mon May 19, 2014 4:05 pm
by AlexWright
Excellent, thanks for letting me know, Sebastien! I'm new to BioFormats, and wasn't sure if it was something else my end.

Thanks again,

Alex.