Tyelab / bruker_pipeline

Python implementation of data processing pipeline for data from the Bruker Ultima microscope in conjunction with bruker_control.
1 stars 2 forks source link

Bulk Fluoresence Calculation from 2P Data #31

Open jmdelahanty opened 2 years ago

jmdelahanty commented 2 years ago

Austin has been collecting data from some mice that have a dopamine sensor expressed in the brain. The plan is to do bulk fluorescence measurements which effectively means to take the whole image, average it, and then take the average value of the pixels in the image and turning that into a number that's written to disk. Some considerations after talking with Jianna and Caroline today:

One way of doing it in Dask with zarr would probably look something similar to this, but might not work straight out of the box with what I'm thinking...

I think we could start by having tiffs put into an h5 file maybe using this without the lzf compression since I don't think MATLAB supports it. In fact using no compression at all is probably fine (for now...). This H5 file could be run with pyimagej or MATLAB or whatever to just take the average of each frame and spit out that number into a file at the end.

I think the cooler way to do this would be with these steps (and more towards a more complete pipeline for generating H5/zarr from the bruker more generally) but it will maybe be harder/take more work 👀

jmdelahanty commented 2 years ago

The initial work for this has been done and we get some kind of number for each frame from a 56k image recording in about 40 seconds (on Cheetos) which is pretty cool. Writing all the images to H5 takes like 3 minutes.

The next step is to both make sure the zarr store to h5 produces images you can actually look at (at first it looks like the images are corrupted or something in the h5 file) in imagej's N5 viewer. Then actually cleaning up the code and making it into a real module we can invoke for the recordings.

Some things in bruker_control should also be done to make sure the dopamine sensor is appropriately named in the filename because I don't think it currently is... I should make an issue for that...

I'll push the code for that tomorrow probably.

jmdelahanty commented 1 year ago

Jianna has successfully done this for some recordings in MATLAB I believe.