quantumjot / btrack

Bayesian multi-object tracking
https://btrack.readthedocs.io
MIT License
310 stars 50 forks source link

combine cellpose segmentation with tracking result into h5 file[FEATURE REQUEST] #409

Open fabricesenger opened 1 month ago

fabricesenger commented 1 month ago

Hello,

I use Btrack to track labeled images, segmentation from cellpose. To further use it with another software CellPlato , I would like to generate an h5 file wich retains the Btarck outpu AND the segmentaion layer, either trough napari or trough a notebook. I think such a feature would be of great help not only for me.

Thank you in advance

Fabrice.

quantumjot commented 1 month ago

Hi Fabrice,

This should be pretty simple from a notebook, using the H5 file handler, something like this:


with btrack.io.HDF5FileHandler("/path/to/file.h5", "w") as hdf:
    hdf.write_segmentation(cellpose_segmentation_as_numpy_arr)
    hdf.write_tracks(btrack_tracks)

Let me know if you have any issues!

fabricesenger commented 1 month ago

Thank you very much for your answer. Unfortunately I'm rather bad at coding. While I understand your answer and the possibilities of encoding h5 files I will have a hard time to implement it. If you can afford the time to provide me some code examples I would appreciate it a lot.  Thank you again for coming back to me so quickly, I highly appreciate your help  Fabrice 

-----Message original-----

De: Alan @.> à: quantumjot @.> Cc: fabricesenger @.>; Author @.> Envoyé: mardi 16 juillet 2024 17:19 CEST Sujet : Re: [quantumjot/btrack] combine cellpose segmentation with tracking result into h5 file[FEATURE REQUEST] (Issue #409)

Hi Fabrice, This should be pretty simple from a notebook, using the H5 file handler, something like this: with btrack.io.HDF5FileHandler("/path/to/file.h5", "w") as hdf: hdf.write_segmentation(cellpose_segmentation_as_numpy_arr) hdf.write_tracks(btrack_tracks) Let me know if you have any issues! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>