We're Hiring!

Matlab bfGetPlane - Argument 'y' failed validation

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

Matlab bfGetPlane - Argument 'y' failed validation

Postby AlexWright » Mon May 19, 2014 2:30 pm

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.
AlexWright
 
Posts: 2
Joined: Mon May 19, 2014 2:14 pm

Re: Matlab bfGetPlane - Argument 'y' failed validation

Postby sbesson » Mon May 19, 2014 3:53 pm

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
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Matlab bfGetPlane - Argument 'y' failed validation

Postby AlexWright » Mon May 19, 2014 4:05 pm

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.
AlexWright
 
Posts: 2
Joined: Mon May 19, 2014 2:14 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest