-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GE files with an EDF header #554
Conversation
This file type started coming from APS in ~2022 with a `.edf.ge5` extension. In fabio, these were being interpreted as EDF files because of their EDF-like header. With the changes in this PR, the file is interpreted as a GE file instead and the frames are read in correctly. The added logic is as follows: 1. If the file is identified as EDF, we check the file extension, and if the file extension is `ge` plus a number, it is interpreted as GE instead. 2. We check for EDF header formats in the GE reader, and if we have a match, we read in the header using EDF style and grab the number of frames from there. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
I can share the dark file, which is ~80 MB! Is that too large for public testing, or is it okay? |
Hi Patrick - I would suggest to gzip the file to make it smaller for testing. Normally fabio reads that transparently, but it breaks the format guessing from file extensions.... |
Hi, in FabIO, files are distributed as Please send me such a file to put it on edna (our server, used for distributing those images). Then remains the non regression test to implement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now it just misses the testcase ... ?
I sent a test case by email. We can make that public. |
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
I added the file to the GE tests! Let me know if anything further is needed for merging this PR. |
I had a quick look. and it seems like compression gets broken like this, as openimage is not picking up the filetype from the name. Historically, I thought edfimage used to complain when the file is the wrong size?
|
So I guess the question is whether anyone would want to support reading dark_before_000428.edf.ge5.bz2, I will ping the private email thread |
We can potentially modify the regex to allow Also, in this PR, I am assuming that |
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
I just fixed this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Thanks @jonwright and @kif! I guess we'll need to wait for a new release on pypi to get access to these features in a release? |
indeed ... I am making 2 to 3 releases a year. |
This file type started coming from APS in ~2022 with a
.edf.ge5
extension.In fabio, these were being interpreted as EDF files because of their EDF-like header. With the changes in this PR, the file is interpreted as a GE file instead and the frames are read in correctly.
The added logic is as follows:
ge
plus a number, it is interpreted as GE instead.I have an ~80 MB dark example... let me see if we can make that public for testing.
Fixes: #553