Skip to content

Conversation

@arhowe00
Copy link
Contributor

@arhowe00 arhowe00 commented Mar 5, 2025

Closes #234

This is necessary for downstream work of generating a photoscan/mesh from the 70-80 photos from 3D Open Water. The 3D Open Water app does not generate a mesh, it just takes photos. So we store the photos for downstream analysis.

In detail

Adds a concept of photocollections to the database. Photocollections are associated with the specific session_id of a specific subject_id, and they are identified by the reference_number. 'reference_number' was used instead of photocollection_id for consistency with 3D Open Water. 3D Open Water takes a collection of .jpeg photos and the goal of photocollections are to store that collection of photos into the database for downstream processing; specifically, the plan is for a photocollection of 70-80 photos of a patient's head to be used to create a mesh via an algorithm (i.e. a "photoscan" object). There is no special object associated with a photocollection -- it's just a collection of photos stored in a directory and identified by the reference_number.

For review

This code is not unit tested but is pretty independent within the subject/session tree. Errors will likely be caught in its usage. Other than reading the code, you could pipe it through an LLM and see if you rolled the right RNG for it to discover a bug.

@arhowe00 arhowe00 requested a review from ebrahimebrahim March 5, 2025 19:36
@arhowe00 arhowe00 force-pushed the 234-add-openlifu-PhotoCollection-concept-to-database branch 2 times, most recently from b6cf1bd to 2a46ba3 Compare March 5, 2025 20:27
Copy link
Collaborator

@ebrahimebrahim ebrahimebrahim left a comment

Choose a reason for hiding this comment

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

  • Also initialize the empty folders when a new session is created, right? Is that needed?
  • I think we should add the photocollection reference number as an attribute to Photoscan, so that there is a record of which photoscan came from which photocollection. But that would complicate this PR, requiring DVC data updates as well. So maybe a separate issue to be done later?

@arhowe00
Copy link
Contributor Author

arhowe00 commented Mar 6, 2025

  • Also initialize the empty folders when a new session is created, right? Is that needed?

Yes, that is what happens in def write_session when creating the empty photocollections.json. I might have forcepushed while you were reviewing.

  • I think we should add the photocollection reference number as an attribute to Photoscan, so that there is a record of which photoscan came from which photocollection. But that would complicate this PR, requiring DVC data updates as well. So maybe a separate issue to be done later?

I agree, I think in the end it will be helpful to also tag the photoscans, but right now we can treat them as independent and do that integration later. I'll open up an issue regarding that.

@arhowe00 arhowe00 requested a review from ebrahimebrahim March 6, 2025 16:08
Copy link
Collaborator

@ebrahimebrahim ebrahimebrahim left a comment

Choose a reason for hiding this comment

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

Looks good then, and thanks for opening that issue!

Please feel free to merge when happy with it

@arhowe00 arhowe00 force-pushed the 234-add-openlifu-PhotoCollection-concept-to-database branch from 2a46ba3 to 1b4c68e Compare March 6, 2025 18:41
Adds a concept of photocollections to the database. Photocollections are
associated with the specific session_id of a specific subject_id, and
they are identified by the reference_number. 'reference_number' was used
instead of photocollection_id for consistency with 3D Open Water. 3D
Open Water takes a collection of `.jpeg` photos and the goal of
photocollections are to store that collection of photos into the
database for downstream processing; specifically, the plan is for a
photocollection of 70-80 photos of a patient's face to be used to create
a mesh (i.e. a "photoscan" object). There is no special object
associated with a photocollection -- it's just a collection of photos
stored in a directory and identified by the reference_number.

- Updates the database to valid state. The updated database includes two
  example photocollections for example_subject
@arhowe00 arhowe00 force-pushed the 234-add-openlifu-PhotoCollection-concept-to-database branch from 1b4c68e to 55bd6b3 Compare March 6, 2025 18:43
@arhowe00 arhowe00 enabled auto-merge (rebase) March 6, 2025 18:43
@arhowe00 arhowe00 merged commit f941ba7 into main Mar 6, 2025
9 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.

add openlifu PhotoCollection concept to database

3 participants