Skip to content

Conversation

@clinton-encord
Copy link
Contributor

Introduction and Explanation

  1. Move VideoSpace into a more general MultiFrameSpace
  2. Added MedicalFileSpace (for Single file DICOMs and NIfTI)
  3. Added MedicalStackSpace (for Multi-file DICOMs)

JIRA

Link ticket(s)

Documentation

There should be enough internal documentation for a product owner to write customer-facing documentation or a separate PR linked if writing the customer documentation directly. Link all that are relevant below.

  • Internal: notion link
  • Customer docs PR: link
  • OpenAPI/SDK
    • Generated docs: link to example if possible
    • Command to generate: here

Tests

Make a quick statement and post any relevant links of CI / test results. If the testing infrastructure isn’t yet in-place, note that instead.

  • What are the critical unit tests?
  • Explain the Integration Tests such that it’s clear Correctness is satisfied. Link to test results if possible.

Known issues

If there are any known issues with the solution, make a statement about what they are and why they are Ok to leave unsolved for now. Make tickets for the known issues linked to the original ticket linked above

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @clinton-encord, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant enhancements to the platform's data handling capabilities by integrating comprehensive support for medical imaging data, specifically DICOM and NIfTI formats. This was achieved by generalizing the existing VideoSpace into a new MultiFrameSpace base class, which now serves as the foundation for all frame-based data types. Building upon this, two specialized classes, MedicalFileSpace and MedicalStackSpace, were implemented to cater to the unique requirements of single-file and multi-file medical datasets, respectively. These changes ensure robust and scalable management of medical annotations.

Highlights

  • Medical Imaging Support: Introduced dedicated support for DICOM and NIfTI medical imaging data, enabling annotation and management of these specialized formats.
  • Space Type Refactoring: The existing VideoSpace has been refactored into a more generic MultiFrameSpace to serve as a base for all multi-frame data types.
  • New Medical Space Classes: Two new space classes, MedicalFileSpace (for single-file DICOMs/NIfTI) and MedicalStackSpace (for multi-file DICOMs), have been added to handle different medical data structures.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Unit test report (Python 3.9.24, Pydantic 2.12.3)

480 tests   480 ✅  12s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 0f39a19.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Unit test report (Python 3.9.24, Pydantic 1.10.22)

480 tests   480 ✅  12s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 0f39a19.

♻️ This comment has been updated with latest results.

Comment on lines 20 to 26
def __init__(self, space_id: str, label_row: LabelRowV2, frames: List[DicomFrameInfo]):
super().__init__(space_id, label_row, number_of_frames=len(frames), height=0, width=0)
self._frames = frames

def _to_space_dict(self) -> MedicalStackSpaceInfo:
"""Export space to dictionary format."""
labels: dict[str, LabelBlob] = {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could also override the put_object_instance, remove_object_instance_from_frames, put_classification_instance, remove_classification_instance_from_frames, to also take in the instance_uuid or file_name?

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for DICOM and NIfTI files by refactoring VideoSpace into a more generic MultiFrameSpace and adding MedicalFileSpace and MedicalStackSpace. The changes are well-structured and include corresponding updates to enums, type definitions, and tests. My review focuses on a critical dependency issue where production code imports from test code, a potential bug in MedicalStackSpace initialization, and an opportunity to reduce code duplication for better maintainability. Overall, the changes are a great step forward, and addressing the identified issues will further improve the code quality.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

SDK integration test report

  1 files  ±0    1 suites  ±0   15m 51s ⏱️ +27s
288 tests ±0  272 ✅  - 12  4 💤 ±0  7 ❌ +7  5 🔥 +5 
289 runs  +1  272 ✅  - 12  4 💤 ±0  7 ❌ +7  6 🔥 +6 

For more details on these failures and errors, see this check.

Results for commit 0f39a19. ± Comparison against base commit 5368243.

♻️ This comment has been updated with latest results.

uri: str


class SceneImageSpaceInfo(BaseSpaceInfo):
Copy link
Contributor

Choose a reason for hiding this comment

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

That one shouldn't be needed yet right?

@clinton-encord clinton-encord merged commit 07dc2bb into master Jan 9, 2026
14 of 19 checks passed
@clinton-encord clinton-encord deleted the clinton/ed-1855/dicom-nifti-space branch January 9, 2026 10:53
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