-
Notifications
You must be signed in to change notification settings - Fork 40
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
[ANN-760][external] nifti import to multi slot item #549
Conversation
ANN-760 Nifti import to multi-slot item
Description: We currently only support nifti imports to MPR view or single volume view. This ticket extends support to multi-slot items, allowing imports to specific slots. It is necessary for Jubilant (50k deal) Acceptance Criteria: |
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.
Am I right in saying that broadly the issue here was asynchronicity? Hence the addition of slot names for "reuniting" imported anns afterwards?
If so, nice one, good catch. Might be good to break down the Nifti silo a bit too.
I think mostly comments, but the eval needs careful consideration, as someone putting a wayward value in a JSON might get it to do something unexpected.
…i annotation to a single slot or group of slots
# Sometimes we have a list of lists of AnnotationFile, sometimes we have a list of AnnotationFile | ||
# We flatten the list of lists | ||
if isinstance(parsed_files, list): | ||
if isinstance(parsed_files[0], list): |
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.
not a required change
if not doing anything else with the inner conditional, can flatten this, python supports conditional short circuiting
if isinstance(parsed_files, list) and isinstance(parsed_files[0], list):
...
This won't raise if parsed_files isn't indexable because the first condition will short circuit.
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.
This change actually causes these tests to fail for some reason:
FAILED tests/darwin/importer/importer_mcpu_test.py::Test_find_and_parse::test_runs_single_threaded_if_use_multi_cpu_false - Asse...
FAILED tests/darwin/importer/importer_mcpu_test.py::Test_find_and_parse::test_uses_mpire_if_use_multi_cpu_true - AssertionError:...
Going to merge without it, can't spend any longer on this ticket.
Currently when a user imports a nifti file using darwin-py it will upload the annotation to the zeroth slot. This PR introduces the ability to specify which slot you are uploading to.