{"action":"created","issue":{"url":"https://api.github.com/repos/inanhkn/analysis/issues/109","labels_url":"https://api.github.com/repos/inanhkn/analysis/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/inanhkn/analysis/issues/109/comments","events_url":"https://api.github.com/repos/inanhkn/analysis/issues/109/events","html_url":"https://github.com/inanhkn/analysis/pull/109","id":103139837,"number":109,"title":"Inanhkn/pca sss","user":{"login":"inanhkn","id":5778377,"avatar_url":"https://avatars.githubusercontent.com/u/5778377?v=3","gravatar_id":"","url":"https://api.github.com/users/inanhkn","html_url":"https://github.com/inanhkn","followers_url":"https://api.github.com/users/inanhkn/followers","following_url":"https://api.github.com/users/inanhkn/following{/other_user}","gists_url":"https://api.github.com/users/inanhkn/gists{/gist_id}","starred_url":"https://api.github.com/users/inanhkn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inanhkn/subscriptions","organizations_url":"https://api.github.com/users/inanhkn/orgs","repos_url":"https://api.github.com/users/inanhkn/repos","events_url":"https://api.github.com/users/inanhkn/events{/privacy}","received_events_url":"https://api.github.com/users/inanhkn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-25T23:47:03Z","updated_at":"2015-08-27T06:57:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/inanhkn/analysis/pulls/109","html_url":"https://github.com/inanhkn/analysis/pull/109","diff_url":"https://github.com/inanhkn/analysis/pull/109.diff","patch_url":"https://github.com/inanhkn/analysis/pull/109.patch"},"body":"This PR is meant to be the continuation of #101 which introduced the cell extraction method with PCA+SSS. I made some changes since then:\r\n\r\n1) `run_pca` is updated. The script now estimates an upper bound on the number of cells in a movie using a newly added script `local_maxima_2D.m`. If user still wants to manually specify number of PCs, s/he can do so by calling the script as\r\n`run_pca('movie source', 'num_PCs',<number of asked PCs>)` .\r\nTo let the script decide, just type\r\n`run_pca('movie source')` .\r\n\r\nI would highly recommend median filtering and trimming with `run_pca`. In that case, type\r\n`run_pca(movie_source, 'medfilt','trim')` .\r\n\r\n2)  `local_maxima_2D.m` is added. This script takes an image (in our case, the max-projection image) and detects the local maxima in it. It estimates an upper bound on the number of local maxima (cells in our case) by computing 2 goodness measures: laplacian and pixel intensity at the found centroids(local maxima). The (scaled) laplacian and intensity values are then sorted and an exponential is fit to the these trends, assuming(confidently) that these trends obey power law. The time constants of the exponentials are extracted and the upper bound is calculated as the average of 4 times the time constants.\r\nYou can call   `local_maxima_2D.m` as \r\n`centroids = local_maxima_2D(<the image>,'visualize')`\r\nto get the centroids and plot the image with  the centroid overlay + the trends for laplacian and pixel intensities with the exponential fit. Below are example output plots:\r\n![img](https://cloud.githubusercontent.com/assets/5778377/9482379/64b49bc6-4b48-11e5-8c63-7ad280711cd9.png)\r\n![trends](https://cloud.githubusercontent.com/assets/5778377/9482381/671a291c-4b48-11e5-87df-965ed43335a2.png)\r\n\r\nAfter running PCA, call extract cells by typing\r\n`extract_cells('movie file path','pca*.mat file path')` .\r\nRefer to #101 for more details on `extract_cells` script."},"comment":{"url":"https://api.github.com/repos/inanhkn/analysis/issues/comments/135315464","html_url":"https://github.com/inanhkn/analysis/pull/109#issuecomment-135315464","issue_url":"https://api.github.com/repos/inanhkn/analysis/issues/109","id":135315464,"user":{"login":"kimtonyhyun","id":2081503,"avatar_url":"https://avatars.githubusercontent.com/u/2081503?v=3","gravatar_id":"","url":"https://api.github.com/users/kimtonyhyun","html_url":"https://github.com/kimtonyhyun","followers_url":"https://api.github.com/users/kimtonyhyun/followers","following_url":"https://api.github.com/users/kimtonyhyun/following{/other_user}","gists_url":"https://api.github.com/users/kimtonyhyun/gists{/gist_id}","starred_url":"https://api.github.com/users/kimtonyhyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimtonyhyun/subscriptions","organizations_url":"https://api.github.com/users/kimtonyhyun/orgs","repos_url":"https://api.github.com/users/kimtonyhyun/repos","events_url":"https://api.github.com/users/kimtonyhyun/events{/privacy}","received_events_url":"https://api.github.com/users/kimtonyhyun/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T06:57:12Z","updated_at":"2015-08-27T06:57:12Z","body":"Also, if you're going to go through the trouble of computing a \"quality metric\", then it would be nicer to plot it non-inverted."}}