-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
More pessimistic caching of outputs #1719
Conversation
@benjamindeleener @jcohenadad even if this is not finished, if you can take a look at the code and provide preliminary comments, just to make sure that you agree on the approach. |
@zougloub i definitely like this approach. So, in the case of cache_sig = cache_signature(input_data=[data_seg.nii.gz, disc_labels.nii.gz]): What did you have in mind for the field |
Maybe this is a bad example for |
10dc6f5
to
ebd408f
Compare
OK, here we go.
|
…sing bad ones (see #1669)
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.
- I have my doubts about the usefulness of sct_make_ground_truth (Is sct_make_ground_truth still useful? #1732), so let's not spend too much effort on that one for validating this PR.
- I ran sequentially
sct_straighten_spinalcord
and thensct_label_vertebrae
and the straightening was re-done, while it should not have. I understand this is related to your second point here, but some people (very few probably) could in fact runsct_straighten_spinalcord
separately. So to be clean we should address this issue at some point: Output ofsct_straighen_spinalcord
should be able to be reused via the preexisting cache mechanism #1733 --> ACCEPTABLE - To check cross-compatibility, I've run batch_processing without re-downloading the data: they were already processed by the current master's version cdbe5b8. Straightening was run for
sct_label_vertebrae
(expected), and also forsct_register_to_template
(expected, as per previous point). No crash/issue. Output is clean. --> OK - Tried re-running
sct_label_vertebrae
two times sequentially: the 2nd time, the cached straightening was used. --> OK - Tried to re-run
sct_straighten_spinalcord
and thensct_label_vertebrae
. The cached straightening was used --> OK - Then, ran
sct_register_to_template
. Straightening was re-ran, which is expected (and desired), because in this case the straightening depends on the labels. In fact, in that case, the previous straighening could have been used (because only two labels were used, hence did not need the "fancy" disc-based straightening). However, accounting for the type of straightening would require more work, and is probably not worth the development time, given that at some point, straightening will only be used for register_to_template (i.e., label_vertebrae will be based on deep learning, without straightening needed) --> ACCEPTABLE - Tried re-running
sct_register_to_template
sequentially. Cached straightening was used. --> OK - Tried modifying the labels (by adding one label), then re-running
sct_register_to_template
. Straightening was re-run (and it should) --> OK
Noted in #1625 that the caching was very optimistic, and this PR brings:
Using the caching helpers looks like:
Notes:
sct_convert
doesn't produce reproducible outputs, so (until it's fixed?) avoid to use caching based on its outputs