[DAR-4940][External] - Remove the need to pass the legacy
flag when importing and converting NifTI
annotations
#973
+3,662
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, medical files in the platform may be divided into two groups:
MED_2D_VEWER
FF disabledMED_2D_VIEWER
FF enabledNow that
MED_2D_VIEWER
is globally enabled, all further uploaded files will not be isotropically scaledWhen importing
NifTI
annotations to these items, or when converting their annotations to theNifTI
format, we need to apply exactly the same scaling as was applied to the item itself upon upload. Currently, we control this with thelegacy
flag, but it's very manual and can be tricky for users to manageSolution
This PR removes the need to pass the
legacy
flag in both the import and convert flows by:"handler": "MONAI"
to determine if a file was scaled or not, and apply scaling during the conversion if requiredAfter this is merged, we'll release a new darwin-py version and update backend with it. This will enable backend to automatically scale exported
NifTI
annotations per-file, and then we'll fully remove thelegacy
flag and all related code some weeks in the futureChangelog
Removed the need to pass a flag when importing or converting
NifTI
annotations. Instead, we handle it automatically, significantly reducing confusion and the likelihood of errors