← Back to list

Unit testing data for medical imaging

It is critical to analyze the data to determine whether or not there are any obvious problems in the data set. We can usually open a…

Martin Soria Røvang · 2022-09-09 13:13 · 5 claps · 1.8 min read
#medical-imaging #unit-testing #pypi #medical-image-analysis #deep-learning
Open on Medium ↗
Wiki topics: ML · Machine Learning IMG · Medical Imaging & Radiology EDU · Education & Learning

Unit testing data for medical imaging

It is critical to analyze the data to determine whether or not there are any obvious problems in the data set. We can usually open a Jupyter notebook and set up some functions to plot some image examples, get distribution information, and so on. But we should also have unit tests for the data should be added as an extra layer of protection.

There are some great tools for this; for example, if you have tabular data, the package “Great Expectations” is very well developed and maintained, with excellent documentation.

However, this package struggles with image data which can’t be put in the tabular forms and for medical image data types such as nifti and DICOM, although these can’t be reformatted into numpy arrays and such.

Therefore I have started to develop Fiora, which is an unit testing suite for image data (nifti & DICOM). Right now is in alpha stage and only works for nifti, but DICOM will soon be added. This package will be developed on the basis of the problems that are encountered.

This package allows you to create a suite file based on reference data (most of the times the training data). Anyone can use this suite file to test the same metrics on different data sets.

There is currently no documentation, but this is being worked on and should be available very soon. However, the functions are quite simple;

after a $pip install — extra-index-url https://test.pypi.org/simple/ Fiora (This package is only available on testpypi at the moment), you can initialize the project with:

$fiora — init

This will generate a folder in the current directory.

Now you can generate a test suite file with:

$fiora — suite new

This will allow you to specify the data path for generating the test suite. You can use it to validate on another dataset after providing the path and name of the test suite:

$fiora — validate SUITE_NAME PATH_TO_DATA_FOLDER

Your results will be saved in the Fiora_module/validations folder and also be written out in the console.

You can also create custom tests by following the template generated by:

$fiora — custom_test NAME_OF_TEST

Alter the test file generated to your needs.


메타데이터
post_id
1dfd1fe5431b
slug
unit-testing-data-for-medical-imaging-1dfd1fe5431b
url
https://medium.com/@Martinsr/unit-testing-data-for-medical-imaging-1dfd1fe5431b
canonical_url
https://medium.com/@Martinsr/unit-testing-data-for-medical-imaging-1dfd1fe5431b
author_url
https://medium.com/@Martinsr
status
ok
fetched_at
2026-06-29 22:44:20