Package: hazen
hazenQuality assurance framework for Magnetic Resonance ImagingExplore the docs »View repo·Report Bug·Request FeaturePleaseSTARthis repo to receive updates about new versions of hazen!Overviewhazen is a software framework for performing automated analysis of magnetic resonance imaging (MRI) quality assurance
(QA) data. hazen consists of multipleTaskswhich perform quantitative processing and analysis of
MRI phantom data. Currently, hazen supports theACR Large MRI Phantomand the MagNET Test Objects collection of phantoms.The hazen Tasks provide the following measurements within these phantoms:Signal-to-noise ratio (SNR)Spatial resolutionSlice positionSlice widthUniformityGhostingMR relaxometryEach Task outputs numerical results to the user's terminal. Below is an output from thehazen snrTask performed on
some example MRI data:hazensnrtests/data/snr/Siemens{'snr_smoothing_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':173.97,'snr_smoothing_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_3_1':177.91,'snr_smoothing_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':1698.21,'snr_smoothing_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_3_1':1736.66,'snr_subtraction_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':220.73,'snr_subtraction_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':2154.69}The optional--reportflag allows the user to visualise the image processing performed by each hazen Task:hazen snr tests/data/snr/Siemens --reporthazen acr_ghosting tests/data/acr/Siemens --reportInstallation and usageThere are two main options for running hazen.Install using Python and run directly via command line interface (CLI)Run using the latest Docker container build1) Python install and run (CLI)hazen can be installed with Python 3.9 or higher via pip. It is strongly recommended to use a virtual environment.python3-mvenvhazen-venvsourcehazen-venv/bin/activate
pipinstallhazenUpdating hazenIf you already have an old version of hazen installed, upgrade to the latest version with:sourcehazen-venv/bin/activate
pipinstall--upgradepip
pipinstall--upgradehazenRunning hazen via CLIThe CLI version of hazen is designed to be pointed at single folders containing DICOM file(s). Example datasets are
provided in thetests/data/directory. If you are using the Docker version of hazen (installation described below),
replacehazenwithhazen-appin the following commands.# To see the full list of available Tasks, enter:hazen-h# To perform the spatial resolution Task on example data:hazenspatial_resolutiontests/data/resolution/philips# To perform the SNR Task on example data:hazensnrtests/data/snr/Philips# The `--report` option provides additional information about the image processing measurement methods and is available# for all Tasks. Example usage for the SNR Task, which returns images showing the regions used for SNR calculation.hazensnrtests/data/snr/Philips--report2) DockerThe Docker version of hazen has been made available as it is easy to get up-and-running and is linked to the most recent
stable release. Refer to theDocker installation instructionsto install
Docker on your host computer.The containerised version of hazen can be obtained from DockerHub (see commands below). For ease of use, it is
recommended to copy thehazen-appscript to a location accessible on the PATH such as/usr/local/bin. This will
allow you to run hazen from any directory on your computer. Then, to use Docker hazen, simply run thehazen-appscript
appended with the function you want to use (e.g.:snr).In Terminal:# Ensure Docker installed and running, then pull the latest hazen Docker containerdockerpullgsttmriphysics/hazen:latest# Command line output will look something like:latest:Pullingfromgsttmriphysics/hazen
Digest:sha256:18603e40b45f3af4bf45f07559a08a7833af92a6efe21cb7306f758e8eeab24a
Status:Imageisuptodateforgsttmriphysics/hazen:latest
docker.io/gsttmriphysics/hazen:latest# Copy the 'hazen-app' executable file into your local bin foldercdhazen
cphazen-app/usr/local/bin# Run hazen via Docker with the normal CLI inputshazen-appsnrtests/data/snr/Siemens/# Example command line output for the SNR Task:{'snr_smoothing_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':173.97,'snr_smoothing_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_3_1':177.91,'snr_smoothing_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':1698.21,'snr_smoothing_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_3_1':1736.66,'snr_subtraction_measured_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':220.73,'snr_subtraction_normalised_SNR_seFoV250_2meas_slice5mm_tra_repeat_PSN_noDC_2_1':2154.69}Web InterfaceDevelopment of aweb interface for hazenis in progress.Contributing to hazenUsersPleaseraise an Issuefor any of the following reasons:Problems installing or running hazenSuggestions for improvementsRequests for new featuresWe have used hazen with MRI data from a handful of different MRI scanners, including multiple different vendors. If
hazen does not perform with your MRI data, or the results are unexpected, please raise an Issue.DevelopersPlease seeCONTRIBUTING.mdfor developer guidelines.