Skip to content
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

Merged
merged 14 commits into from
Dec 19, 2023

Conversation

tomvars
Copy link
Contributor

@tomvars tomvars commented Nov 21, 2023

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 and instances which both write polygons into Darwin, users now have mask mode which writes to the raster layer and creates mask 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.

Copy link

linear bot commented Nov 21, 2023

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 raster_layer & mask annotations and persisted in the database such that they can be loaded by the client.

Acceptance Criteria:

The user should be able to import NIFTI annotations using darwin-py.

@tomvars tomvars requested a review from Nathanjp91 December 3, 2023 10:51
@tomvars tomvars marked this pull request as ready for review December 3, 2023 10:51
Copy link
Contributor

@Nathanjp91 Nathanjp91 left a 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.

@@ -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):
Copy link
Contributor

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.

@tomvars tomvars requested a review from Nathanjp91 December 15, 2023 15:06
@tomvars
Copy link
Contributor Author

tomvars commented Dec 15, 2023

Would also love to see some tests added if possible.

Added a test

@tomvars tomvars merged commit e3165e4 into master Dec 19, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants