{"id":23442373,"url":"https://github.com/repronim/kwyk2nidm","last_synced_at":"2025-04-09T21:49:09.015Z","repository":{"id":70236709,"uuid":"222810459","full_name":"ReproNim/kwyk2nidm","owner":"ReproNim","description":"NIDMification of kwyk output","archived":false,"fork":false,"pushed_at":"2019-12-03T22:12:00.000Z","size":32,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-09T21:49:03.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReproNim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-19T23:35:11.000Z","updated_at":"2020-03-29T22:52:27.000Z","dependencies_parsed_at":"2023-04-08T10:37:59.179Z","dependency_job_id":null,"html_url":"https://github.com/ReproNim/kwyk2nidm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReproNim%2Fkwyk2nidm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReproNim%2Fkwyk2nidm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReproNim%2Fkwyk2nidm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReproNim%2Fkwyk2nidm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReproNim","download_url":"https://codeload.github.com/ReproNim/kwyk2nidm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119407,"owners_count":21050754,"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","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":[],"created_at":"2024-12-23T17:29:32.032Z","updated_at":"2025-04-09T21:49:08.994Z","avatar_url":"https://github.com/ReproNim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kwyk2nidm\nNIDMification of kwyk output\n\nThis project uses **kwyk** (https://github.com/neuronets/kwyk).\nPaper, code, and model corresponding to [preprint](https://arxiv.org/abs/1812.01719), which is now published.\n\nCite: [McClure P, Rho N, Lee JA, Kaczmarzyk JR, Zheng CY, Ghosh SS, Nielson DM, Thomas AG, Bandettini P and Pereira F (2019) Knowing What You Know in Brain Segmentation Using Bayesian Deep Neural Networks. Front. Neuroinform. 13:67. doi:10.3389/fninf.2019.00067](https://www.frontiersin.org/articles/10.3389/fninf.2019.00067/full)\n\n# Steps\n## Run kwyk\n\n## Interpret kwyk output for regional volumes\nWe include a BASH script, 'kwykput.sh' that takes a resulting output from kwyk, and used the FSL *fslstats* utility to determine the volume for each of the regions. This script uses the *kwyk_region_list.txt* file for the region lables (derived from *FreeSurfer*. It generates a text file (example provided *test_out.txt*) of the form:\n\n\u003cpre\u003e\nkwyk_index label number_voxels vol_inmm3\n1 Cerebral-White-Matter 496396 496396.000000 \n2 Ventricular-System 11025 11025.000000 \n3 Cerebellum-White-Matter 32515 32515.000000 \n4 Cerebellum-Cortex 144992 144992.000000 \n5 Thalamus-Proper 18118 18118.000000 \n6 Caudate 10851 10851.000000 \netc...\n\u003c/pre\u003e\n\n## Convert the volume result file into NIDM\nThe steps for this include generating a kwykmap.json file that described \nthe content of out reults file (*kwykmap.json*). As a developer, you can \nthen work with ReproNim to create a set of custom terms for your software,\nwhich are harmonized with other software. This generates a list of custom\ndata elements for the software with additional information. For example,\nin the case of kwyk, this maps every structure to a common anatomical name,\nmeasurement type, and measurement units.\n\n```\nkwyk:kwyk_000002 a kwyk:DataElement ;\n    kwyk:label \"Cerebral-White-Matter vol_inmm3 (mm^3)\" ;\n    kwyk:measure \"vol_inmm3\" ;\n    kwyk:structure \"Cerebral-White-Matter\" ;\n    kwyk:structure_id 1 ;\n    kwyk:unit \"mm^3\" ;\n    nidm:datumType ilx:0738276 ;\n    nidm:hasUnit \"mm^3\" ;\n    nidm:isAbout uberon:0002437 ;\n    nidm:measureOf ilx:0112559 .\n```\n\n## Using the kwyk data elements to generate a NIDM result\n\n### Software environment\n\nYou can run the kwyk2nidm script using either of the methods below.\n\n1. Install `kwyk2nidm` into your Python 3 environment\n\n```\npip install https://github.com/ReproNim/kwyk2nidm/archive/master.zip\n\nkwyk2nidm -f kwyk_stats_file\n```\n\n2. Clone the repo and create a Docker container\n\n```\ngit clone https://github.com/ReproNim/kwyk2nidm.git\ncd kwyk2nidm\ndocker build -t kwyk2nidm:latest .\ndocker run -v $(pwd):/data kwyk2nidm -f /data/kwyk_stats_file\n```\n\nRunning the kwyk2nidm command will generate an output file \n`kwyk_stats_file.ttl` unless a different name is specified using the \n`-o` flag.\n\nTo generate all the NIDM KWYK data elements add `-g` to the commands above. \nThis will generate a `KWYK-NIDM.ttl` that should be added to triplestore\nto provide the link between the NIDM stats file to the common data attributes.\n \n# Great!  I have a NIDM **kwyk** result.  Now What???\n\n1. Upload to ReproPond or ReproLake\n2. Query across files!\n3. Merge it with other NIDM, and query it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepronim%2Fkwyk2nidm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepronim%2Fkwyk2nidm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepronim%2Fkwyk2nidm/lists"}