{"action":"created","issue":{"url":"https://api.github.com/repos/fiji/TrackMate3/issues/55","repository_url":"https://api.github.com/repos/fiji/TrackMate3","labels_url":"https://api.github.com/repos/fiji/TrackMate3/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/fiji/TrackMate3/issues/55/comments","events_url":"https://api.github.com/repos/fiji/TrackMate3/issues/55/events","html_url":"https://github.com/fiji/TrackMate3/pull/55","id":328815232,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjM5NDUx","number":55,"title":"Re-engineer feature framework.","user":{"login":"tinevez","id":3583203,"node_id":"MDQ6VXNlcjM1ODMyMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3583203?v=4","gravatar_id":"","url":"https://api.github.com/users/tinevez","html_url":"https://github.com/tinevez","followers_url":"https://api.github.com/users/tinevez/followers","following_url":"https://api.github.com/users/tinevez/following{/other_user}","gists_url":"https://api.github.com/users/tinevez/gists{/gist_id}","starred_url":"https://api.github.com/users/tinevez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinevez/subscriptions","organizations_url":"https://api.github.com/users/tinevez/orgs","repos_url":"https://api.github.com/users/tinevez/repos","events_url":"https://api.github.com/users/tinevez/events{/privacy}","received_events_url":"https://api.github.com/users/tinevez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/fiji/TrackMate3/milestones/1","html_url":"https://github.com/fiji/TrackMate3/milestone/1","labels_url":"https://api.github.com/repos/fiji/TrackMate3/milestones/1/labels","id":3396193,"node_id":"MDk6TWlsZXN0b25lMzM5NjE5Mw==","number":1,"title":"1.0.0-beta-7","description":null,"creator":{"login":"tinevez","id":3583203,"node_id":"MDQ6VXNlcjM1ODMyMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3583203?v=4","gravatar_id":"","url":"https://api.github.com/users/tinevez","html_url":"https://github.com/tinevez","followers_url":"https://api.github.com/users/tinevez/followers","following_url":"https://api.github.com/users/tinevez/following{/other_user}","gists_url":"https://api.github.com/users/tinevez/gists{/gist_id}","starred_url":"https://api.github.com/users/tinevez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinevez/subscriptions","organizations_url":"https://api.github.com/users/tinevez/orgs","repos_url":"https://api.github.com/users/tinevez/repos","events_url":"https://api.github.com/users/tinevez/events{/privacy}","received_events_url":"https://api.github.com/users/tinevez/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2018-06-03T09:53:45Z","updated_at":"2018-06-05T12:44:48Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2018-06-03T09:53:24Z","updated_at":"2018-08-22T17:40:29Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/fiji/TrackMate3/pulls/55","html_url":"https://github.com/fiji/TrackMate3/pull/55","diff_url":"https://github.com/fiji/TrackMate3/pull/55.diff","patch_url":"https://github.com/fiji/TrackMate3/pull/55.patch"},"body":"This PR implements a series of API-breaking changes to sanitize and improve the feature framework. \r\nThey will affect the `mastodon-tracking` code, because particle detectors and linkers generate features themselves. \r\n\r\nChanges in the common `Feature` API.\r\n------------------------------------------\r\n\r\nThe main change is that now **`Feature`** is an **interface**, that ships an API making it resemble a **read-only version of a property map**, plus commodities to play well with end-users, whether they use features to harvest quantitative data on the image analyzed, or extend Mastodon by writing Feature computers.\r\n\r\nA `Feature` can directly return the values it wraps, using \r\n``` java\r\npublic V get( O o, V ref );\r\n```\r\nwhere `V` is the type of values and `O` the type of objects the feature is defined for (vertices, edges, ...).\r\n\r\nA feature should also be able to **serialize** itself to a file, following what we do with property maps. \r\n``` java\r\npublic void serialize( File file, final ObjectToFileIdMap< O > idmap ) throws IOException;\r\n```\r\n\r\nBecause values can be of any type and we want to let 3rd parties compute their own features, this is not super-useful for integration within Mastodon. We work around this by providing **`FeatureProjection`s.** Feature projections are meant to look like the scalar projections of a feature value on several axis. For instance, the velocity vector is a feature calculated for an edge. Adequate feature projections for this feature would be: \r\n- the speed (velocity vector magnitude). \r\n- the signed velocity along X axis. \r\n- the signed velocity along Y axis. \r\n- the signed velocity along Z axis. \r\n- theta the velocity vector angle measured in the OXY plane with respect to X axis (0º to 360º). \r\n- phi the velocity vector angle measured in the OMZ plane with respect to Z axis (0º to 180º). \r\n\r\nThe last 6 quantities are scalar and real. Note that they are not orthogonal; end-user comfort should prime. Because they are always scalar and real, they can be used in a general way, _e.g._ to generate colors for displays or in a table.\r\n\r\nFeature projections have **physical units** now. There is also a `IntFeatureProjection` marker interface that can be used for feature projections that return integer values, and will be used for instance to beautify the output of values.\r\n\r\nThere concrete classes to simplify generating features, covering common uses cases:\r\n- `DoubleScalarFeature`\r\n- `DoubleArrayFeature`\r\n- `IntScalarFeature`\r\n- `IntArrayFeature`\r\n\r\n\r\nChanges in the common feature computation.\r\n---------------------------------------------------\r\n\r\nSince a `FeatureComputer` is like a self-contained module that can be contributed by 3rd parties, we should try to make them user-friendly. \r\n\r\nNow they need to return a **help string** that explains what the feature is about and how it is calculated. For TrackMate I did not do that and still receive a lot of emails and posts in the forum about what is the exact definition of a quantity. Of course, feature values are what users make sense of their data with and they want to know what is behind a value before putting it in the paper. \r\n\r\nAlso, a `FeatureComputer` can return a **config panel**. This makes it no longer state-less, but will be useful for special features.\r\n\r\nChanges in the Mastodon-app (Mamut) feature computation.\r\n--------------------------------------------------------------------\r\n\r\nWe want to be able to write features that depend on image data, for instance the mean intensity in spots. To do this, the Mamut feature computers need to receive the BDV data. The **`MamutFeatureComputer`** does this and should be the mother class for all Mastodon-app feature computers. It also determines the space units from the BDV data.\r\n\r\nThe `DefaultMamutFeatureComputerService` passes the BDV data to all feature computers before computation. \r\n\r\nMastodon-app feature calculation dialog.\r\n----------------------------------------------\r\n\r\nThe calculation dialog exploits all these capabilities. Here is how it looks like, with a feature computers that can be configured. Clocking on the gear icon next to a feature computer shows an info and config panel on the right pane.\r\n![mastodon_featurecalculation_01](https://user-images.githubusercontent.com/3583203/40885339-a540bd8c-6724-11e8-87be-2a0a307ef28a.PNG)\r\n\r\nIt also shows dependencies when any:\r\n![mastodon_featurecalculation_02](https://user-images.githubusercontent.com/3583203/40885298-10f48956-6724-11e8-9fd9-6883c09a1fc0.PNG)\r\n\r\nThe dialog is now present in the Mastodon app `MainWindow`\r\n![mastodon_mainwindow](https://user-images.githubusercontent.com/3583203/40885308-3bf2979c-6724-11e8-84d8-82eb5e59a1d8.png)\r\n\r\nand there are a new command to toggle its visibility:\r\n``` java\r\npublic static final String COMPUTE_FEATURE_DIALOG = \"compute features\";\r\n```\r\n\r\nHowever, the feature calculation panel is not Mastodon-app specific, and work with generic feature computers.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fiji/TrackMate3/issues/comments/415116847","html_url":"https://github.com/fiji/TrackMate3/pull/55#issuecomment-415116847","issue_url":"https://api.github.com/repos/fiji/TrackMate3/issues/55","id":415116847,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTExNjg0Nw==","user":{"login":"tpietzsch","id":622070,"node_id":"MDQ6VXNlcjYyMjA3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/622070?v=4","gravatar_id":"","url":"https://api.github.com/users/tpietzsch","html_url":"https://github.com/tpietzsch","followers_url":"https://api.github.com/users/tpietzsch/followers","following_url":"https://api.github.com/users/tpietzsch/following{/other_user}","gists_url":"https://api.github.com/users/tpietzsch/gists{/gist_id}","starred_url":"https://api.github.com/users/tpietzsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpietzsch/subscriptions","organizations_url":"https://api.github.com/users/tpietzsch/orgs","repos_url":"https://api.github.com/users/tpietzsch/repos","events_url":"https://api.github.com/users/tpietzsch/events{/privacy}","received_events_url":"https://api.github.com/users/tpietzsch/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T17:40:29Z","updated_at":"2018-08-22T17:40:29Z","author_association":"MEMBER","body":"`AbstractFeatureComputerService.getDependencyGraph()` is broken.\r\n`prune()` will not work as expected. Here is an example:\r\n[Mastodon (1).pdf](https://github.com/fiji/TrackMate3/files/2311430/Mastodon.1.pdf)\r\n"}}
{"actor":{"display_login":"tpietzsch"}}