Page 1 of 2

new reader struggle

PostPosted: Tue Jun 26, 2018 10:07 am
by Albin
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

Re: new reader struggle

PostPosted: Tue Jun 26, 2018 10:55 am
by dgault
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

Re: new reader struggle

PostPosted: Tue Jun 26, 2018 11:00 am
by Albin
The file is over 2GB, gonna check if I have a smaller one

Re: new reader struggle

PostPosted: Wed Jun 27, 2018 11:38 am
by Albin
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

Re: new reader struggle

PostPosted: Thu Jun 28, 2018 6:35 am
by Albin
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

Re: new reader struggle

PostPosted: Thu Jun 28, 2018 1:54 pm
by dgault
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?

Re: new reader struggle

PostPosted: Fri Jun 29, 2018 6:34 am
by Albin
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

Re: new reader struggle

PostPosted: Fri Jun 29, 2018 8:08 am
by Albin
Also why does my getImageCount() constantly return 0? How do I fix that? :?

Re: new reader struggle

PostPosted: Fri Jun 29, 2018 10:33 am
by dgault
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.

Re: new reader struggle

PostPosted: Fri Jun 29, 2018 11:48 am
by Albin
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