Skip to main content

python framework for FROC/AFROC analysis

Project description

pyfroc

Python framework for FROC/AFROC analysis

Table of contents

About

What pyfroc does

  • Improve the FROC/AFROC analysis process.
  • Manage responses of raters.
    • The responses can be made using segmentation tools (e.g., 3D Slicer).
    • You can use your tool if you write a loader class inheriting BaseLoader class.
  • Evaluate responses and devide them into true positive or false positive automatically.
    • Using built-in module, the responses within the paired lesion approximated as a sphere is regarded as true positive, otherwise false positive.
  • Build a .xlsx file for the RJafroc, a R library which runs statistical tests of AFROC (alternative Free-response receiver operating characteristic) analysis.
  • Write images of responses with paired lesions (if exists).

What pyfroc doesn't

  • Statistical analysis of JAFROC. This is out of scope of pyfroc. Use RJafroc for statistical analysis.
  • FROC/AFROC analysis including multi-modality references because pyfroc doesn't implement an algorithm to match intermodality lesions.

Use case

pyfroc is designed for specific scenarios of FROC/AFROC analysis. pyfroc itself supports only one modality for reference lesions. If you want to compare two modality using two reference modality, run pyfroc for each reference modality, write .xlsx files for RJafroc, and combine the two .xlsx file manually.

Here are the sample scenarios.

Scenario #1

  • Compare detection performance between radiologists with and without AI
  • The responses will be recored on the same series of DICOM images for radiologists with and without AI.

Scenario #2

  • Compare a standard MRI protocol with an abbreviated protocol in terms of lesion detection.
  • The responses will be recored on the same series of DICOM images for both protocols.

Scenario #3

  • Compare images reconstructed using an advanced method with images reconstructed using conventional method in terms of the lesion detectability.
  • Using either series to record responses.

Instalation

Run the command below in your terminal.

pip install pyfroc

Sample code (CLI)

# Install pyfroc
pip install pyfroc

# Prepare dicrectories for an experiment
pyfroc prepare --dicom-dir ./dicom --num-of-raters 2 --num-of-modalities 2

# Record responses of the raters using 3D Slicer
# See the turorial 2 for details

# Read the responses and create rjafroc_input.xlsx file for RJafroc analysis
pyfroc evaluate --out-format rjafroc_xlsx --write-img --dicom-dir •/dicom

# Run AFROC statistical analysis using the RJafroc
RScript samples/afroc_analysis.R

Sample code (Python)

from pyfroc.loaders import BaseLoader

Tutorials

1. Demonstration using sample data

This tutorial demostrates a walkthrough of AFROC analysis using the pyfroc framework.

See ./samples/tutorial1.ipynb

2. Perform an AFROC experiment

In this tutorial, you will perform an AFROC analysis using the pyfroc framework with your DICOM images.

See ./samples/tutorial2.ipynb

3. How to modify behavior in pyfroc

If you want to modify behavior in pyfroc other than CLI options, you can write your own class inheriting base class to make new behavior.

See ./samples/tutorial3.ipynb

Author

Satoshi Funayama (@akchan)

Department of Radiology, Hamamatsu University School of Medicine, Shizuoka, Japan

License

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfroc-0.3.3.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

pyfroc-0.3.3-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

Details for the file pyfroc-0.3.3.tar.gz.

File metadata

  • Download URL: pyfroc-0.3.3.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for pyfroc-0.3.3.tar.gz
Algorithm Hash digest
SHA256 61942d6fae167204fb3bb83cb3c70c5c171c86a0aae48f739926b544bc9977a6
MD5 8aba4b75946005a20dc71fc7fd76fa7f
BLAKE2b-256 c3c0a03f554c550fb4938275901ba11626b26979108c2107ec5fb95653bdb033

See more details on using hashes here.

File details

Details for the file pyfroc-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pyfroc-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 78.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for pyfroc-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c78ee590149e1d1b1cac90afde5e24d124be4f3b9e758d800bd17e83bb646e91
MD5 71133bda9b109b1c59fb1d972e00a5c6
BLAKE2b-256 2c4625efe7077468e33f958b61596734cad281b93453672abe8c771bef1c80f0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page