Skip to content

Conversation

@JBWilkie
Copy link
Contributor

@JBWilkie JBWilkie commented Nov 5, 2024

Problem

Now that MED_2D_VIEWER has been globally enabled, the default behaviour of the NifTI annotation importer should be not to scale annotations

Solution

  • Swap the default behaviour of the NifTI annotation importer not to scale annotations isotropically upon import. This means annotations uploaded to post MED_2D_VIEWER files will be correct by default, but use of the legacy flag will be needed when uploading to pre MED_2D_VIEWER files
  • Additionally: This PR replaces no-legacy with legacy everywhere. Why? We had planned to do this eventually after the environment had stabilised with MED_2D_VIEWER globally enabled, but we never go round to it. legacy is also a simpler concept to understand and work with than no-legacy

Changelog

Made the default behaviour of the NifTI annotation importer more coherent with the state of Darwin

@linear
Copy link

linear bot commented Nov 5, 2024

json.dump(input_data, f, indent=4)


def round_polygon_annotation_coordinates(annotation, decimal_places=2):
Copy link
Contributor Author

@JBWilkie JBWilkie Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary because we export coordinates with 4 decimal places of precision, but scaling annotations results in coordinates with many more decimal places. We therefore have to ensure 4 dp for the assertions to pass

@JBWilkie JBWilkie merged commit ea72b6c into master Nov 7, 2024
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.

3 participants