Skip to content

Commit a19fcc2

Browse files
committed
Return the photoscan parent directory from database for a given photoscan_id (#198)
1 parent 724212e commit a19fcc2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/openlifu/db/database.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,13 +593,15 @@ def get_volume_info(self, subject_id, volume_id):
593593
def get_photoscan_absolute_filepaths_info(self, subject_id, session_id, photoscan_id):
594594
"""Returns the photoscan information with absolute paths to any data"""
595595
photoscan_metadata_filepath = self.get_photoscan_metadata_filepath(subject_id, session_id, photoscan_id)
596+
photoscan_metadata_directory = Path(photoscan_metadata_filepath).parent
596597
with open(photoscan_metadata_filepath) as f:
597598
photoscan = json.load(f)
598599
photoscan_dict = {"id": photoscan["id"],\
599600
"name": photoscan["name"],\
600-
"model_abspath": Path(photoscan_metadata_filepath).parent/photoscan["model_filename"],
601-
"texture_abspath": Path(photoscan_metadata_filepath).parent/photoscan["texture_filename"],
602-
"photoscan_approved": photoscan["photoscan_approved"]}
601+
"model_abspath": photoscan_metadata_directory/photoscan["model_filename"],
602+
"texture_abspath": photoscan_metadata_directory/photoscan["texture_filename"],
603+
"photoscan_approved": photoscan["photoscan_approved"],
604+
"photoscan_metadata_directory": str(photoscan_metadata_directory)}
603605
if "mtl_filename" in photoscan:
604606
photoscan_dict["mtl_abspath"] = Path(photoscan_metadata_filepath).parent/photoscan["mtl_filename"]
605607
return photoscan_dict

0 commit comments

Comments
 (0)