From bca5cfe7ffcd3bfb2250d02cf1c7f70e4b1bcddc Mon Sep 17 00:00:00 2001 From: kushalbakshi Date: Mon, 18 Nov 2024 14:25:22 -0500 Subject: [PATCH] Add filepath@store Part table to `Processing` --- .../imaging_no_curation.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/element_calcium_imaging/imaging_no_curation.py b/element_calcium_imaging/imaging_no_curation.py index 642e86a8..704ae108 100644 --- a/element_calcium_imaging/imaging_no_curation.py +++ b/element_calcium_imaging/imaging_no_curation.py @@ -495,6 +495,14 @@ class Processing(dj.Computed): package_version='' : varchar(16) """ + class File(dj.Part): + definition = """ + -> master + file_name: varchar(255) + --- + file: filepath@imaging-processed + """ + # Run processing only on Scan with ScanInfo inserted @property def key_source(self): @@ -704,6 +712,17 @@ def make(self, key): raise ValueError(f"Unknown task mode: {task_mode}") self.insert1(key) + self.File.insert( + [ + { + **key, + "file_name": f.relative_to(output_dir).as_posix(), + "file": f, + } + for f in output_dir.rglob("*") + if f.is_file() + ] + ) # -------------- Motion Correction --------------