GithubHelp home page GithubHelp logo

openheart's Introduction

OpenHeart

overview

Installation

You need to have docker as well as docker-compose installed. All other requirements will be installed into the docker container where the application is running.

Developing OpenHeart

The current setup in the Dockerfile runs RUN pip install -e . and mounts the current directory into the /app directory. This means while you develop the application locally it will automatically update inside the docker container and you don't need to rebuild the image or stop the container. The app will re-start automatically upon storing changes to the source code. (Caveat: this means you should not change the code while you use the app or wait for an upload etc.)

This of course only includes changes to the app. Python packages you add to the requirements.txt will require a new build of the image of course.

Usage

To start the app run

docker-compose up

and the image should build from Dockerfile if it is not already existing. If you need to rebuild the image you have to run docker-compose up --build. The docker-compose command picks up information on volumes and ports from the docker-compose.yml file.

Afterwards the app can be accessed on port 5001 of the machine it is started on. In Dockerfile the line CMD ["python3", "-m", "flask", "run", "--host=0.0.0.0", "--port=5001"] defines the host and port numbers.

Building the reconstruction container for the XNAT server

ToDo

Testing

For running the tests two things are required:

  • Setup of Test XNAT projects: In the file tests/conftest.py the dictionary test_app_configuration defines the parameters passed to the app in the test configuration. The keys 'XNAT_SERVER' 'XNAT_ADMIN_USER', 'XNAT_ADMIN_PW', 'XNAT_PROJECT_ID_VAULT' and 'XNAT_PROJECT_ID_OPEN' must point to an existing XNAT server and projects that are dedicated to testing.
  • Supplying of test data: To run the tests inside the running docker container the you need to mount a folder (in the following called TESTPATH) to /test in the container where some data are available to run the tests. The current tests require to supply the substructure /test/input/dicoms where some dicoms should be stored and /test/output where the tests store some files. Important: TESTPATH must not be a vagrant-synchronised folder (i.e. a shared folder) cause zip extraction will not work in them.

Since the app runs in a container the container must be started before executing pytest. Probably there is a smarter way incorporating the docker-compose.yml for this but manually starting up the container and running the pytest works.

docker run -v $(pwd)/:/app -v sql_volume:/logs -v sql_volume:/db -v data_volume:/data -v temp_volume:/temp -v /home/sirfuser/XNATTestData:/test -it openheart_app /bin/bash -c "python3 -m pytest -s"

(The command above does not expose ports yet, potentially for testing email sending from the app the option -p 465:465 is required.)

openheart's People

Contributors

ckolbptb avatar johannesmayer avatar samadu01 avatar

Watchers

 avatar

openheart's Issues

Documentation

  • in the README: should it not be docker compose up rather than docker-compose up? The first one works for me the secon option does not
  • test data needs to be made publicly available
  • provide information about access to log files
  • information about creating/finding e.g. openheart_sql_volume missing

The suggested file structure does not work

The suggested file structure with

Filename.zip
-- Subject1
    -- File1.h5
    -- File2.h5
-- Subject2
    -- File3.h5
    -- File4.h5

does not work because the extraction of the zip file picks up a / and the XNAT server get's confused with folder structures.
To solve this we can simply replace the / characters with a hyphen.

get_container_info_for_scan() prints some error

The error is:

openheart-app-1 | 2023-03-17 13:01:04,914 ERROR openheart Thread-72 [xnat.py:217 - get_container_info_for_scan() ]: raw-in not found in container json

However, the reconstructions are still performed correctly and the snapshots are picked up by the webpage.

import user fails

The line

from sqlalchemy_mutable.types import MutablePickleType

causes an error when I try to run app.py.

Traceback (most recent call last):
  File "app.py", line 13, in <module>
    from user import UserModel, db, login
  File "./utils/user.py", line 2, in <module>
    from sqlalchemy_mutable.types import MutablePickleType
ModuleNotFoundError: No module named 'sqlalchemy_mutable.types'

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.