Coder Social home page Coder Social logo

altar's Introduction

ALTAR - Artifact Labelling Tool for Artifact Reduction

A cross-platform desktop application written in PyQt to help researchers manually and efficiently annotate large healthcare imaging datasets.

The application runs locally and securely connects to a remote server to access and plot one image at a time. The user can look through the 3D image and label various quantities, such as the presence of metal dental artifacts. The app loads the subsequent image while you label, so that the next image is immediately available.

Getting Started

Installation

  1. If you do not already have Python 3.7 and the conda package manager, install them here.
  2. Download or clone the app repository.
$ git clone https://github.com/CArrowsm/label_artifacts.git
  1. Create and activate a new conda environment for the app.
$ conda env create -f environment.yml

App setup

The settings.json file contains all settings used by the app. These include the host and port of the server, and paths to remote files. In particular, you may need to change "Remote CSV Path" and "Remote Image Path".

The app assumes that the images you want to label are listed in a CSV (found at "Remote CSV Path") with columns

index   patient_id    has_artifact   a_slice

where index is an integer ordering each patient and patient_id is a unique number for each patient which appears in that patient's image file name. has_artifact is the DA status (2=strong, 1=weak, 0=none) and a_slice is the axial slice index you want to label for each patient.

The app will access all images from "Remote Image Path" and assumes each image to be an NPY file named patientID_img.npy. Changing any of these assumptions is fairly straight-forward and can be found in app/label.py.

Usage

To start the app, navigate to the application directory on the command line, activate the environment, and run main.py:

$ cd path/to/ALTAR
$ conda activate label-app
$ python main.py

Login

Upon starting the app, you will be presented with a sign-in page to the host found in settings.json. Enter your username and password and click "Login". Note: The page may freeze briefly after you click login. This is expected behaviour as it sometimes takes time for the first image to load.

Labelling Images

Once you have successfully logged in, you will be presented with a 3D image of the first patient which you can scroll through. Next:

  1. Scroll to the slice you want to label as "stronges DA" "central mouth".
  2. Click the button corresponding to the DA class you want to label this patient. This immediately saves your annotation and displays the next image.
  3. The app will download the next image into memory while you label an image. This way you don't have to wait for each image to load consecutively.
  4. You can display a specific image by typing the patient ID into the text field and clicking "Plot Patient". The app will then carry on loading images from that patient's index.

Have a look at this example!

Editing Settings

Settings can be changed anytime (either from login page or from label page) by clicking on the icon in the top-left corner of the app window. Simply change the text in the fields and click save.

Warnings

  1. The app uses multithreading to load one image in the background while you label another. When logging-in and when plotting a specific patient (by clicking "Plot Patient") the app only uses one thread and the GUI therefore freezes until the image is loaded. The app can crash if buttons are pressed during this process. This will be fixed in later releases.

  2. Closing the application while an image is loading (in the background or otherwise) may cause the app to crash without saving.

  3. The app should be closed from the GUI, by clicking "x", rather than with a keyboard interrupt from the command line.

altar's People

Contributors

carrowsm avatar christophereeles avatar deanamic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.