{"id":27366378,"url":"https://github.com/laulauthom/knimetgmm_reloaded","last_synced_at":"2025-07-25T04:13:12.586Z","repository":{"id":201294400,"uuid":"394299097","full_name":"LauLauThom/knimeTGMM_reloaded","owner":"LauLauThom","description":"Knime workflow to facilitate segmentation and tracking in 3D + time cell images using the TGMM 1.0 software by the Keller lab (https://www.janelia.org/lab/keller-lab).","archived":false,"fork":false,"pushed_at":"2021-08-31T14:15:12.000Z","size":5526,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T05:56:50.543Z","etag":null,"topics":["cell-tracking","microscopy","segmentation","tgmm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LauLauThom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-08-09T13:19:07.000Z","updated_at":"2024-03-26T03:37:39.000Z","dependencies_parsed_at":"2024-03-21T02:47:55.478Z","dependency_job_id":null,"html_url":"https://github.com/LauLauThom/knimeTGMM_reloaded","commit_stats":null,"previous_names":["pierretreh/knimetgmm_reloaded","laulauthom/knimetgmm_reloaded"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LauLauThom/knimeTGMM_reloaded","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauLauThom%2FknimeTGMM_reloaded","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauLauThom%2FknimeTGMM_reloaded/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauLauThom%2FknimeTGMM_reloaded/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauLauThom%2FknimeTGMM_reloaded/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LauLauThom","download_url":"https://codeload.github.com/LauLauThom/knimeTGMM_reloaded/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauLauThom%2FknimeTGMM_reloaded/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266952903,"owners_count":24011513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cell-tracking","microscopy","segmentation","tgmm"],"created_at":"2025-04-13T05:56:53.301Z","updated_at":"2025-07-25T04:13:12.352Z","avatar_url":"https://github.com/LauLauThom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5226948.svg)](https://doi.org/10.5281/zenodo.5226948)\n\n# TGMM in KNIME\n\nKnime workflow to automate the use of the software Tracking by Gaussian Mixture Models (TGMM, Amat et al.) for 3D cell segmentation and cell-lineage tracking in 3D+time image-sequences.  \nTGMM was designed to work with dataset of cells with fluorescently labelled nuclei (ex: H2B-mCherry in developping drosophila embryos). \n\nResults can be viewed either in Knime or displayed better using MaMut plugin in FIJI.\n\nThe IDRdownloader python script in this repository allows downloading additional datasets from the Image Data Resource database (https://idr.openmicroscopy.org/).  \nIt is currently set to download an appropriate dataset from the Keller lab (source of the TGMM software) (https://idr.openmicroscopy.org/webclient/img_detail/4007801/?dataset=3351).\n\n# Requirements  \nTGMM requires a GPU with CUDA support.  \nThis KNIME workflow is only compatible with TGMM for Windows, and was tested with Knime 4.4.0.  \nThe Knime extensions (Image Processing and External Tools) needed by the workflow will be installed automatically by Knime upon opening the workflow.  \n\nIt is recommended to set the logging level in KNIME to DEBUG to visualize the output of the TGMM exectuables called by the workflow directly in the console output of KNIME.  \nTo do so, go to *Preferences \u003e KNIME \u003e KNIME GUI* and select *DEBUG*.  \n\nThe original TGMM repository contains the necessary software to run this workflow (TGMM 1.0) as well as some documentation/user-guide and an example dataset under `data\u003edata`.  \nYou can find it at: https://sourceforge.net/projects/tgmm/files/.  \nTGMM 1.0 is also available at https://git.rcc.uchicago.edu/open-source/TGMM but this version was returning CUDA errors with out configuration.  \nTGMM 2.0 is also available but not compiled. \nThere is also some documentation in the doc directory of this repo https://bitbucket.org/fernandoamat/tgmm-paper/src/master/.  \n\n# Citations\nIf you use this workflow for your research, please cite the original publication \n\nAmat, F., Lemon, W., Mossing, D. P., McDole, K., Wan, Y., Branson, K., Myers, E. W. and Keller, P. J. (2014).  \n*Fast, accurate reconstruction of cell lineages from large-scale fluorescence microscopy data.*  \nNature Methods 11, 951–958,  \ndoi:10.1038/nmeth.3036  \n\nas well as the DOI of this repository from Zenodo (see at the top of this page).  \nIf you have a github account, you can also \"star\" the repo (icon on the top right) ;)\n\n# Expected datasets\n\nWe recommend to use 3D dataset (also 2D is supposed to work for some values of connectivity) and to process at least 10 timepoints.  \nErrors were observed using less timepoints.  \n\nZ-stack for each timepoints have to be saved in separate `.tif` files (single \"f\" not sure if \"tiff\" double-f are working, TGMM is matching image filenames against a wildcard pattern and by appending the tif extension).  \n\nAdditionally, the filenames should contain the timepoint, and filenames shoud be identical (except the timepoint) between the images. \nThe reason is that the image location is provided to the workflow (ad to TGMM), as a wildcard pattern for the filepath, with ??? in-place of the timepoints, and no extension.  \nExample to match the following images: \n```\nmyPath/frame0001.tif\nmyPath/frame0002.tif\n``` \nOne should use the pattern\n`myPath/frame????` with 4 `?` since all frames have a timepoint encoded as a 4-digit value.  \n\n# Processing steps\n\nThis workflow includes the different functions:\n\n### __Hierarchical segmentation of 3D images into supervoxels__  \nThis is performed by the node \"Pyramidal Segmentation Hierarchy\".  \n\nThis first step includes:\n - reducing noise in images using median filter (use CUDA)\n - identification of foreground regions using the \"background threshold\" parameter\n - watershed\n - Persistence Based Clustering (PCB), creating the hierarchy of segmentation levels\n\nThe node is internally calling `ProcessStackBatchMultiCore.exe \u003cTGMMconfig.txt\u003e \u003cfirstTimepoint\u003e \u003clastTimepoint\u003e`.   \nThe config file is automatically generated from the parameters provided in the GUI of the node (refer to the mouse-over description of the GUI elements and/or to the TGMM user-guide for a more detailed description of the parameters).    \nThis command actually parallelizes `ProcessStack.exe \u003cTGMMconfig.txt\u003e \u003cimage\u003e` called with individual Z-stacks of timepoints (the `\u003cimage\u003e`), and using as many CPU cores as available (ie timepoints are processed in parallel).   \n\nThe output is a hierarchical segmentations for each timepoint, saved as `.bin` files in the image directory.      \nThese bin files can be used to derive different segmentations, by choosing a cut-off (Tau), ie to a Tau value corresponds one segmentation level.     \nBy selecting a Tau, the hierarchical segmentation is \"cut\" to a given level, yielding a first set of supervoxel (next workflow).  \n\nNote: ProcessStack can also be called to generate such bin file for single timepoints Z-stacks by calling  \n`ProcessStack.exe \u003cimage\u003e \u003cradiusMedianFilter\u003e \u003cminTau\u003e \u003cbackgroundThr\u003e \u003cconn3D\u003e`\n\n### __Visualization of the segmentation for a given Tau (optional)__  \nThis is calling `ProcessStack.exe \u003cbinFile\u003e \u003cTau\u003e \u003cminSuperVoxelSize\u003e`.  \nThis allows to visualize the resulting segmentation for a given Tau and minimum nuclei size (also called supervoxel size).  \nIt is basically a way to optimize Tau before running the tracking (which is also asking for Tau).  \nIt takes the `.bin` files generated at the previous step, and outputs segmentation mask as `.tif` files in the image directory.     \nThe masks are then loaded in Knime and can be viewed overlaid on the original images.   \nFrom the original publication \"The higher the value of Tau, the coarser the segmentation, as more image regions are merged.\"  \n\n### __Tracking of cells__  \nThis is calling `TGMM.exe \u003cTGMMconfig.txt\u003e \u003cfirstTime\u003e \u003clastTime\u003e`.  \nIt performs the following steps:\n- from the `.bin` files containing the hierarchical segmentation, derive a segmentation corresponding to the selected Tau (what is done in the optional step above)\n- remove supervoxels below `minNucleiSize` \n- apply Otsu thresholding followed by filtering with `maxNucleiSize` \n- Fit gaussians on the supervoxels/nuclei (the Gaussian Mixture Model)\n- Establish cell tracks and lineage based on the gaussian fit\n\nThe output is a set of XML file (one per timepoint).  \nThe XML contains the coordinates of the gaussian fitted on the nuclei, as well as track/lineage information.  \nThe XML files can be loaded in Fiji using MaMut to view the nuclei rendered from the gaussian fits and their tracks.  \n\n### __Display of localized nuclei__  \nTakes `.xml` files, allows visualization of centroids overlaid on the original images.  \nThe color of the centroid labeling is determined by the index of the cell lineage (ie cells from the same lineage have the same labeling color).  \n\n\n## MaMut import\n\nTo import results in MaMut, all images need to be integrated into a hyperstack with the correct number of slices and frames in FIJI.\n\nThen, the Big Data Viewer plugin can be used to export the stack to hdf5 + xml.\n\nThe `Import TGMM results into MaMut` submenu of MaMut takes the path to the `GMEMtracking3D_\\XML_finalResult_lht` directory (created by TGMM in your results folder) and the XML created by Big Data Viewer.\n\nIt produces a new XML file, which is used by MaMut in the `Open MaMut annotation` submenu and directly provides access to the different viewers provided by MaMut.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaulauthom%2Fknimetgmm_reloaded","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaulauthom%2Fknimetgmm_reloaded","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaulauthom%2Fknimetgmm_reloaded/lists"}