Pylinac General Overview - pylinac 3.25.0 documentation (2024)

View this page

Toggle table of contents sidebar

Pylinac General Overview - pylinac 3.25.0 documentation (1)Pylinac General Overview - pylinac 3.25.0 documentation (2)Pylinac General Overview - pylinac 3.25.0 documentation (3)

What is pylinac?

Pylinac (pr. “pie-linac”) is a Python library to analyze the images and datasets commonly used by therapy medical physicistsin the course of their routine QA. These data usually follow tests outlined by AAPM TG-142 and similar TGs. An example would be the“picket fence” test of MLCs done weekly or monthly.

Pylinac will take in the image/data and can output numeric results, plots showing the analysis, or a PDF including both thenumerical and plot data.

  • Pylinac consumes raw data/images to compute meaningful output related to common physics tests

  • Pylinac consumes raw data/images to present meaningful data types for further exploration

What is pylinac NOT?

  • Pylinac is not a database. Data outputs should be placed onto your clinic’s data repository. You should use a high-qualityspecialty application like QAtrack+, an open source application taylor-made (bah-dum-ch) for routine physics QA.

  • Pylinac is not liable for incorrect outputs. Either by inputting incorrect data, or the algorithm being incorrect,you should always validate pylinac against a known methodology (automatic or manual), just as you shoulddo for any software used in your clinic.

  • Pylinac is not commercial software. It is open-source with a very lenient MIT licensewhich means it can be used publicly, privately, or even used in commercial applications royalty-free. Infact, it’s the image analysis engine for RadMachine, where boththe pylinac and QATrack+ authors currently work. Join us!

Intended Audience

Pylinac is intended to be used by physicists who know at least a bit of programming, although just the basicsshould be enough for most applications.

Philosophy

Pylinac runs on a few philosophical principles:

  • A given module should only address 1 overarching task.

  • Using pylinac should require a minimal amount of code.

  • The user should have to supply as little information as necessary to run an analysis.

  • The underlying code of pylinac should be easy to understand.

  • Analyses are limited to commercial phantoms or widely-accepted methodologies.

  • Although evaluation against a reference or baseline may occur, it is not theend-goal. As stated above, there are better places for containing reference information.Pylinac’s goal moving forward is to provide top-tier analysis and results. How thoseresults are evaluated are more suited for other applications such as QATrack+ and RadMachine.

Algorithm Design Overview

Generally speaking, the design of algorithms should all follow the same guidelines and appear as similar as possible. Each module willoutline its own specific algorithm in its documentation.

  • Descriptions of algorithms are sorted into steps of the following:

    • Allowances – These describe what the pylinac algorithm can account for.

    • Restrictions – These are the things pylinac cannot do and must be addressed before the module can be properly used.

    • Pre-Analysis – Algorithm steps that prepare for the main algorithm sequence.

    • Analysis – The steps pylinac takes to analyze the image or data.

    • Post-Analysis – What pylinac does or can do after analysis, like showing the data or checking against tolerances.

  • Algorithm steps should be expressible in a word or short phrase.

  • Algorithm method names should be as similar as possible from module to module.

The joy of coding Python should be in seeing short, concise, readable classes that expressa lot of action in a small amount of clear code – not in reams of trivial code that boresthe reader to death.

—Guido van Rossum

Module Design

Pylinac has a handful of modules, but most of them work somewhat the same, so here we describe the general patterns you’ll see when usingpylinac.

  • Each module has its own demonstration method(s) – If you don’t yet have an image or data and want to see how a module worksyou can run and inspect the code of the demo to get an idea. Most demo methods have a name like or starts with .run_demo().

  • Each module has its own demo image/dataset(s) – Want to test the analysis but are having trouble with your image? Use the provideddemo images. All major classes have a demo image or dataset and are usually similar to .from_demo_image().

  • Each module has similar load, analyze, and show methods and behavior – The normal flow of a pylinac module use is to 1) Load the data in,2) Analyze the data, and 3) Show the results.

  • Most modules can be fully utilized in a few lines – The whole point of pylinac is to automate and simplify the process ofanalyzing routine QA data. Thus, most routines can be written in a few lines.

Relation to RadMachine

Pylinac is the image analysis engine for RadMachine.The primary author (James Kerns) is currently employed at Radformation. Pylinac has and willcontinue to be open-source, even as it’s used in RadMachine. This is a win-win for the communitybecause the algorithms are visible to all, both RadMachine customers and the community, andthe overall community benefits from advances Radformation makes, such as new phantom analysesthat RadMachine customers request. There is no intention to close-source pylinac now or in thefuture. That being said, pylinac remains focused on image analysis and being a utility library.It is unlikely that, for example, pylinac will expand to include a GUI, add database functionality,or data monitoring since that overlaps with QATrack+/RadMachine.

Pylinac General Overview - pylinac 3.25.0 documentation (2024)

References

Top Articles
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 5360

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.