{"id":15358643,"url":"https://github.com/mckib2/phantominator","last_synced_at":"2025-04-15T07:21:02.471Z","repository":{"id":55046479,"uuid":"193168610","full_name":"mckib2/phantominator","owner":"mckib2","description":"Generate numerical phantoms.","archived":false,"fork":false,"pushed_at":"2023-04-16T22:21:30.000Z","size":82,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T17:47:38.511Z","etag":null,"topics":["image-reconstruction","mri","phantom","shepp-logan"],"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/mckib2.png","metadata":{"files":{"readme":"README.rst","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-06-21T22:55:34.000Z","updated_at":"2025-03-13T01:03:00.000Z","dependencies_parsed_at":"2024-06-21T14:51:27.731Z","dependency_job_id":"95d781d8-4c76-4007-a4d2-77ea649cf627","html_url":"https://github.com/mckib2/phantominator","commit_stats":{"total_commits":70,"total_committers":3,"mean_commits":"23.333333333333332","dds":0.02857142857142858,"last_synced_commit":"710088cc1849dcdf9fde5460df84d887d8fc364f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckib2%2Fphantominator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckib2%2Fphantominator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckib2%2Fphantominator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckib2%2Fphantominator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mckib2","download_url":"https://codeload.github.com/mckib2/phantominator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023990,"owners_count":21200004,"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":["image-reconstruction","mri","phantom","shepp-logan"],"created_at":"2024-10-01T12:42:03.359Z","updated_at":"2025-04-15T07:21:02.450Z","avatar_url":"https://github.com/mckib2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installation\n============\n\n.. code-block:: bash\n\n    python -m pip install phantominator\n\nThe goal is to have easy installation and usage for everyone.  If\nsomething doesn't work, please open an issue and/or submit a pull\nrequest.  We'll get it figured out.\n\n`pygrappa` is an optional dependency required to run the\n`phantominator.examples.radial_coil_sens` example.\n\nAbout\n=====\n\nPython package for easy generation of numerical phantoms.  I often\nneed a simple image to try something out on.  In MATLAB, I would use\nthe `phantom` command to quickly get something to work with.  In\nPython, it's not always quite so easy, so I made this package that's quick\nto install and use so there's as little friction as possible.  There\nare other implementations of Shepp-Logan available from other\nprojects, but they are usually not as easy to install or include other\nthings that I don't want for this project.\n\nThis package offers both CT and MR versions.\n\nGoing forward, this module will support Python \u003e= 3.8.\n\nUsage\n=====\n\nAlso see the `examples` module and docstrings.  The interface for CT\nphantom generation is similar to MATLAB's `phantom` function.\n\nExamples can be run as:\n\n.. code-block:: bash\n\n    # python -m phantominator.examples.[example-name], e.g.:\n    python -m phantominator.examples.shepp_logan\n\nBasic usage:\n\n.. code-block:: python\n\n    # CT phantom\n    from phantominator import shepp_logan\n    ph = shepp_logan(128)\n\n    # MR phantom (returns proton density, T1, and T2 maps)\n    M0, T1, T2 = shepp_logan((128, 128, 20), MR=True)\n\nThe Shepp-Logan 3D phantom has ellipsoids in [-1, 1] along the z-axis.\nThe 2D Shepp-Logan exists at z=-0.25, so if we want just a subset\nalong the z-axis with the first slice being the traditional 2D\nphantom, we can use the `zlims` option:\n\n.. code-block:: python\n\n    from phantominator import shepp_logan\n    M0, T1, T2 = shepp_logan((64, 64, 5), MR=True, zlims=(-.25, .25))\n\nWe can also generate simple oscillating concentric circles:\n\n.. code-block:: python\n\n    # Dynamic (concentric circles), 20 time frames\n    from phantominator import dynamic\n    ph = dynamic(128, 20)\n\nIf we want to modify ellipse/ellipsoid parameters or we just want to\nsee what they are.  For example, we can get the MR ellipsoid\nparameters like this:\n\n.. code-block:: python\n\n    from phantominator import mr_ellipsoid_parameters\n    E = mr_ellipsoid_parameters()\n\nSee docstrings for `ct_shepp_logan`, and `mr_shepp_logan` for how\nthe array `E` is structured.  It follows conventions from MATLAB's\nphantom function.\n\nArbitrary k-space sampling is supported for the single coil 2D\nShepp-Logan phantom:\n\n.. code-block:: python\n\n    # Given k-space coordinates (kx, ky), where kx and ky are 1D\n    # arrays using the same unit conventions as BART's traj command,\n    # we can find the corresponding k-space measurements:\n    from phantominator import kspace_shepp_logan\n    k = kspace_shepp_logan(kx, ky)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckib2%2Fphantominator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmckib2%2Fphantominator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckib2%2Fphantominator/lists"}