We're Hiring!

new reader struggle

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.

new reader struggle

Postby Albin » Tue Jun 26, 2018 10:07 am

Hi!

When trying to crop my image I get a IllegalArgumentException which implies that my readPlane() (line 76) within my openBytes() method is not passed correctly? One or more of the values passed must then be 0 or null right? My problem is that I don't see where the values fail.

Also my thumbnail size is 128 x -1. I set the value of m.thumbSizeY = 128; and
m.thumbSizeX = 128; which "solved" this part, is this allowed?


link to Git: https://github.com/Hedwall/ISQReader


Thanks

//kind regards
Albin
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby dgault » Tue Jun 26, 2018 10:55 am

Hi Albin

The thumbSize should default to 128 x 128. The -1 suggests that sizeY is set to -1 which may be the cause of the readPlane issue also.

If you have a small sample file which you could send to us I would be happy to help debug the problem. You can upload the file to https://www.openmicroscopy.org/qa2/qa/upload/

David Gault
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: new reader struggle

Postby Albin » Tue Jun 26, 2018 11:00 am

The file is over 2GB, gonna check if I have a smaller one
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby Albin » Wed Jun 27, 2018 11:38 am

I have now uploaded one significantly smaller file.

Hope you can find it

link to Matlab code: https://se.mathworks.com/matlabcentral/ ... 66-readisq

link to git: https://github.com/Hedwall/ISQReader


//Albin
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby Albin » Thu Jun 28, 2018 6:35 am

Did the file upload?:)

dgault wrote:
If you have a small sample file which you could send to us I would be happy to help debug the problem. You can upload the file to https://www.openmicroscopy.org/qa2/qa/upload/

David Gault
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby dgault » Thu Jun 28, 2018 1:54 pm

Thanks Albin, we received the sample file and I have been able to start testing it. Do you know what the dimensions of the provided file are supposed to be?

In the init method the following code:
Code: Select all
                m.sizeX = in.readInt(); //dimx_p [12]
                m.sizeY = in.readInt(); //dimy_p [13]
                m.sizeZ = in.readInt(); //dimz_p [14] = nr of slices in current series


results in:
sizeX = 1381979697
sizeY = 50331648
sizeZ = 4874004

This looks as though perhaps the values arent stored as 4 bytes?
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: new reader struggle

Postby Albin » Fri Jun 29, 2018 6:34 am

According to their site (http://www.scanco.ch/en/support/custome ... neral.html --> header format) the metadata are all 4-byte integers, while the actual image data are all signed 2-byte int.

I will test with other types and different position from where they are read, think that the problem may lie there.


//Albin
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby Albin » Fri Jun 29, 2018 8:08 am

Also why does my getImageCount() constantly return 0? How do I fix that? :?
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Re: new reader struggle

Postby dgault » Fri Jun 29, 2018 10:33 am

The call to getImageCount returns the value for imageCount set on the current CoreMetadata. This means that simply setting the value in https://github.com/Hedwall/ISQReader/bl ... r/src#L146 should be enough, the call to getImageCount prior will always return 0 as it has not been set yet.
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: new reader struggle

Postby Albin » Fri Jun 29, 2018 11:48 am

Ahh thanks!

The code on Git now receives the same value (still very high) for sizeX and sizeY (2048), but my sizeZ value is way off, is this because of the position or because it maybe reads to many bytes, e.g 8 bytes instead of 4 or 4 instead 2, still not sure if it should be 4 or 2 How do I find out which one it should be for the size values?

git code: https://github.com/Hedwall/ISQReader/blob/master/src


//Albin
Albin
 
Posts: 22
Joined: Mon Jun 18, 2018 12:23 pm

Next

Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest