-
Notifications
You must be signed in to change notification settings - Fork 18
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
Handling image templates that don't use zero-padding #646
Comments
Context: some Rigaku datasets (such as these ones: https://xrda.pdbj.org/entry/93) use an image incremental serial number that is not zero-padded. Can we reasonably detect this automatically and import them properly? At worst, perhaps we could provide an option at import that allows the template to be non-padded. |
Link to a workaround: |
How about using a single If you have non-padded images,
If you have zero-padded images,
So this does not change the existing behaviour. Am I missing corner cases? |
I like this proposal, but I wonder how one would select just the first 9 images in the top example. i.e. where you do want to match just one digit. I would be tempted to bring ? into play, but that is recognised by shell Maybe however my concern does not matter because on balance what you suggest is far more useful than the current behaviour. The only other thing which occurs to me in discussing this is whether to move away from the current template to something more |
In this case one has to use
As a programmer, I like this. But for non-programmers, the printf-syntax might seem daunting. |
OK, I agree with your viewpoint here on the single |
It's a bit ugly but apparently this is currently possible:
So something similar could be used to select any range within the single digit numbers, even if |
Ah I see @biochem-fan already suggested similar, using |
See also dials/dials#2376 (comment) |
I have been looking at this today and unfortunately I am stuck. The problem is that there is code used to expand a template to filenames, which does not know if the filenames should be zero-padded or not: Lines 48 to 58 in 7964d4b
I can put a count == 1 special case to expand to a non zero-padded list, but this will fail if the dataset is actually using a zero-padded template. That is under the proposal above,
is supposed to match the files |
Rather than overloading |
Although, reviewing the above I think I may have incorrectly implemented @biochem-fan's suggestion. I was working on the assumption that
in this case, and now I can see why. I'll revise my branch in the light of this and see if it can be rescued. |
Ok, I think it works. PR incoming 🙂 A remaining question is whether e.g.
|
I fixed the
🎉 @graeme-winter, the single digit template was apparently contentious when it was added (dials/dials#972) and I have extended its application. However, I can't think of any realistic circumstances where this could go wrong (perhaps due to lack of imagination). Would appreciate your comments and review at #705 |
NB added a commit that changes tactic slightly. Rather than extending the single-digit pattern meant for images like |
Thanks!
Non-essential suggestion:
How about mentioning the file name issue as a comment, or submiting an issue to the DIALS repository, so that someone who processes ROD datasets can find the workaround.
Originally posted by @biochem-fan in #645 (review)
The text was updated successfully, but these errors were encountered: