Definition and tools for Open Imaging Finding Models
Project description
findingmodel Package
Contains library code for managing FindingModel objects.
Look in the demo notebook.
Models
FindingModelBase
Basics of a finding model, including name, description, and attributes.
Properties:
name: The name of the finding.description: A brief description of the finding. Optional.synonyms: Alternative names or abbreviations for the finding. Optional.tags: Keywords or categories associated with the finding. Optional.attributes: A collection of attributes objects associated with the finding.
Methods:
as_markdown(): Generates a markdown representation of the finding model.
FindingModelFull
Uses FindingModelBase, but adds contains more detailed metadata, especially requiring IDs on models and attributes and allows codes at many levels.
FindingInfo
Information on a finding, including description and synonyms, can add detailed description and citations.
Properties:
name: The name of the finding.synonyms: Alternative names or abbreviations for the finding. Optional.description: A brief description of the finding. Optional.detail: A more detailed description of the finding. Optional.citations: A list of citations or references related to the finding. Optional.
Tools
describe_finding_name()
Takes a finding name and generates a usable description and possibly synonyms (FindingInfo) using OpenAI models (requires OPENAI_API_KEY to be set to a valid value).
from findingmodel.tools import describe_finding_name
await describe_finding_name("Pneumothorax")
>>> FindingInfo(finding_name="pneumothorax", synonyms=["PTX"],
description="Pneumothorax is the...")
get_detail_on_finding()
Takes a described finding as above and uses Perplexity to get a lot of possible reference information, possibly including citations (requires PERPLEXITY_API_KEY to be set to a valid value).
from findingmodel.tools import get_detail_on_finding
finding = FindingInfo(finding_name="pneumothorax", synonyms=['PTX'],
description='Pneumothorax is the presence...')
await get_detail_on_finding(finding)
>>> FindingInfo(finding_name='pneumothorax', synonyms=['PTX'],
description='Pneumothorax is the...'
detail='## Pneumothorax\n\n### Appearance on Imaging Studies\n\nA pneumothorax...',
citations=['https://pubs.rsna.org/doi/full/10.1148/rg.2020200020',
'https://ajronline.org/doi/full/10.2214/AJR.17.18721', ...])
create_finding_model_from_markdown()
Creates a FindingModel from a markdown file or text using OpenAI API.
create_finding_model_stub_from_finding_info()
Given even a basic FindingInfo, turn it into a FindingModelBase object with at least two attributes:
- presence: Whether the finding is seen
(present, absent, indeterminate, unknown) - change from prior: How the finding has changed from prior exams
(unchanged, stable, increased, decreased, new, resolved, no prior)
add_ids_to_finding_model()
Generates and adds OIFM IDs to a FindingModelBase object and returns it as a FindingModelFull object. Note that the source parameter refers to the source component of the OIFM ID, which describes the originating organization of the model (e.g., MGB for Mass General Brigham and MSFT for Microsoft).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file findingmodel-0.1.2.tar.gz.
File metadata
- Download URL: findingmodel-0.1.2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4cd73e4b290855a8efd644a404b4b77572bef56add202cd678217cc66e7e87d
|
|
| MD5 |
128b3f02fd37f9fd6918800af02ae28e
|
|
| BLAKE2b-256 |
3849c4e107f33c9f337a375f11d4dd0f4cc1219835b8eb657946795d76d7ac90
|
File details
Details for the file findingmodel-0.1.2-py3-none-any.whl.
File metadata
- Download URL: findingmodel-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
128012cb2942f72a996cd82c266a11f85fac15ad0a58e2db3c491b11ed10feaa
|
|
| MD5 |
a242df776b979c2f2ee05cbb9f453046
|
|
| BLAKE2b-256 |
7cc9a9eeaa9dd20c48accf2e4c9cb61a96b052c7b8bfd666971f6355f2233c73
|