AllenInstitute / segmentation-labeling-app

Data pipeline and UI for human labeling of putative ROIs from 2p cell segmentations
Other
0 stars 0 forks source link

deployment tweaks #54

Closed djkapner closed 4 years ago

djkapner commented 4 years ago

These are deployment tweaks required and requested during Pika's dev testing of the app.

1. changing manifest extension from .jsonl to .json

2. linking movie frame rate and trace time axis

webapp movie playback defined by fps passed to imageio_ffmpeg and trace playback defined by pointInterval. These were not connected. Added a playback_factor arg default to 1.0 (real time) that connected these 2 data sources. Demo:

import json                                                               
tpath = "/allen/aibs/informatics/labeling_artifacts/segmentation_run_id_954/trace_1575130.json"                                                     
with open(tpath, "r") as f: 
    print(json.load(f)['pointInterval'])                                                                            
0.25

and

$ ffmpeg -i /allen/aibs/informatics/labeling_artifacts/segmentation_run_id_954/video_1575130.mp4
...
    Stream #0:0(und): Video: h264 (High) ... 4 fps, 4 tbr, 16384 tbn, 8 tbc (default)
...

note that in python:

import imageio_ffmpeg as mpg                                              
vpath = "/allen/aibs/informatics/labeling_artifacts/segmentation_run_id_954/video_1575130.mp4"                                                    
frames, seconds = mpg.count_frames_and_secs(vpath) 
print(frames / seconds)                                                  
4.047058823529412

imageio-ffmpeg has some known issue.

3. Added a video/image normalization strategy.

Thus far the strategy is:

4. exposing bitrate parameter for potentially helping to control movie sizes.

5. Added timestamp to local transform results folder.

To avoid re-writing some manifest contents. Could get confusing.

kschelonka commented 4 years ago

Ensure traces and videos are on the same time scale. Currently videos are 10FPS and traces are 4 points per second.

djkapner commented 4 years ago

~TODO: add a test for normalize_array~ done