-
Notifications
You must be signed in to change notification settings - Fork 42
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
[MED-22][external] import nifti to raster layer mask annotations #725
[MED-22][external] import nifti to raster layer mask annotations #725
Conversation
…de paths and they seem to work as before, dropped import_format in favour of mode: mask
MED-22 Import NIFTI to raster_layer & mask annotations
Description: It is a common request to import NIFTI Masks created in external software to v7. These should be converted to Acceptance Criteria: The user should be able to import NIFTI annotations using darwin-py. |
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.
Would also love to see some tests added if possible.
darwin/importer/formats/nifti.py
Outdated
@@ -177,8 +196,96 @@ def get_video_annotation( | |||
raise Exception("If is_mpr is True, slot_names must be of length 3") | |||
|
|||
|
|||
def nifti_to_video_annotation( | |||
volume, class_name, class_idxs, slot_names, view_idx=2, pixdims=(1, 1, 1) | |||
def get_mask_video_annotations(volume, processed_class_map, slot_names): |
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.
Can you type annotate this? Inputs and outputs.
Added a test |
Co-authored-by: Nathan Perkins <[email protected]>
Problem
We previously supported nifti imports as polygons, this PR introduces support for nifti imports into the raster layer.
Solution
Users now have a new mode available at upload. In addition to
video
andinstances
which both write polygons into Darwin, users now havemask
mode which writes to the raster layer and createsmask
annotations.Changelog
We've introduced the ability to import nifti labels directly into the raster layer! This means users can perform inference off-platform or import existing annotations into a project and then annotate them using our Masks feature.