Videos should be copied to conversions folder with appropriate filename
Describe the issue
When testing out the miniscope pipeline, which involves linking .avi files, absolute paths to the video files are stored in the ImageSeries objects in the NWB file.
A relative path should be stored.
Perhaps in addition, the linked video files should be copied to the same place as the conversions folder, into a subfolder, following the DANDI video linking and naming conventions, so that it is more intuitive for a user to know that the video is part of the data and should be moved with the NWB file. However, this can be expensive depending on the size of the video files.
Steps to Reproduce
Run NWB GUIDE with Miniscope Imaging and Video, with folder path: ophys_testing_data/imaging_datasets/Miniscope/C6-J588_Disc5 from gin.
Operating System
Mac M1
GUIDE Version
1.0.6 (with fix on ndx-miniscope issue)
Code of Conduct
Yes
Did you confirm this issue was not already reported?
Yes
This is ultimately a neuroconv issue. I can reproduce it using the latest neuroconv 0.7.5 on the gin miniscope test data. In the resulting NWB file, the ImageSeries at /acquisition/BehavCamImageSeries has the "external_file" dataset with absolute paths on my machine, e.g., "/Users/rly/Documents/NWB/gin-test-data/ophys_testing_data/imaging_datasets/Miniscope/C6-J588_Disc5/15_03_28/BehavCam_2/0.avi". Running nwbinspector on the NWB file results in the same best practice violations, e.g.:
1.1 test_miniscope.nwb: check_image_series_external_file_relative - 'ImageSeries' object at location '/acquisition/BehavCamImageSeries'
Message: The external file '/Users/rly/Documents/NWB/gin-test-data/ophys_testing_data/imaging_datasets/Miniscope/C6-J588_Disc5/15_03_28/BehavCam_2/0.avi' is not a relative path. Please adjust the absolute path to be relative to the location of the NWBFile.
On further thought, I think an absolute file path is probably OK and makes sense, but I think the user should be informed about this hard linkage from the NWB file to the videos at those absolute paths on their filesystem, and what this entails. The nwb inspector messages should also probably be filtered out?
This is something usually fixed at runtime of automatic upload to DANDI (since it is a part of the download/organize/validate/upload workflow)
Specifically, the 'organize' step renames video files, adjusts internal NWB references, and puts them in the expected subfolders DANDI expects
Though I agree this has always been an issue with the GUIDE workflow, since it does not apply organization until the very end, but nonetheless runs full inspection along the way
Two solutions:
- ignore that check during GUIDE inspection, expecting it to resolve magically once they reach DANDI upload
- add an endpoint for organization and apply it after converting any video related interface (might require some injection of logic from inside the NeuroConv
automatic_dandi_upload)