Skip to content

Commit

Permalink
Renaming library to platipy
Browse files Browse the repository at this point in the history
  • Loading branch information
pchlap committed Aug 11, 2020
1 parent 716513a commit bf9f8bf
Show file tree
Hide file tree
Showing 37 changed files with 80 additions and 180 deletions.
6 changes: 3 additions & 3 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "IMPIT Development",
"name": "PlatiPy Development",
"dockerComposeFile": "./docker-compose.yml",
"service": "impit",
"workspaceFolder": "/impit",
"service": "platipy",
"workspaceFolder": "/platipy",
"shutdownAction": "stopCompose",
"appPort": [ 8001, 7777 ],

Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"--disable=W0102",
"--disable=W0105",
"--init-hook",
"import sys; sys.path.append('..')",
"--extension-pkg-whitelist=vtk"
],
"python.formatting.blackArgs": [
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN pip install -r requirements.txt
COPY requirements-dev.txt requirements-dev.txt
RUN pip install -r requirements-dev.txt

COPY . impit
COPY . platipy

COPY entrypoint.sh /entrypoint.sh

Expand All @@ -31,9 +31,9 @@ ENV WORK C.UTF-8
ARG dicom_listen_port=7777

ENV DICOM_LISTEN_PORT ${dicom_listen_port}
ENV DICOM_LISTEN_AET IMPIT_SERVICE
ENV DICOM_LISTEN_AET PLATIPY_SERVICE

RUN printf '#!/bin/bash\npython3 -m impit.framework.manage $@\n' > /usr/bin/manage && chmod +x /usr/bin/manage
RUN printf '#!/bin/bash\npython3 -m platipy.framework.manage $@\n' > /usr/bin/manage && chmod +x /usr/bin/manage

EXPOSE 8000
EXPOSE ${dicom_listen_port}
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# IMPIT (Ingham Medical Physics Imaging Toolbox)
# PlatiPy (Processing Library and Analysis Toolkit for Medical Imaging in Python)

This toolbox contains tools and scripts used for image processing within the Medical Physics group
at Ingham Institute in Liverpool, Australia. The code makes use of ITK and VTK and is written in
Python. Jupyter notebooks are provided where possible, mainly for guidance on getting started with
using the tools.
This library contains tools and scripts used for image processing and analysis of medical images.
The code makes use of ITK and VTK and is written in Python. Jupyter notebooks are provided where
possible, mainly for guidance on getting started with using the tools.

## Getting Started

Expand Down
98 changes: 0 additions & 98 deletions Vagrantfile

This file was deleted.

8 changes: 4 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sudo apt-get install -y orthanc
mkdir ~/environments
cd ~/environments

python3 -m venv impit_env
python3 -m venv platipy_env

source ~/environments/impit_env/bin/activate
echo ". ~/environments/impit_env/bin/activate" > ~/.profile
source ~/environments/platipy_env/bin/activate
echo ". ~/environments/platipy_env/bin/activate" > ~/.profile

export PYTHONPATH="${PYTHONPATH}:/"
echo 'export PYTHONPATH="${PYTHONPATH}:/"' >> ~/.profile

pip install -r /impit/requirements.txt
pip install -r /platipy/requirements.txt


# Install Docker
Expand Down
4 changes: 2 additions & 2 deletions dicom/nifti_to_rtstruct/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import argparse
import nibabel
import os
from impit.dicom.nifti_to_rtstruct.export_to_rtstruct import export_to_rtstruct
from impit.dicom.nifti_to_rtstruct.gen_contours import gen_contours
from platipy.dicom.nifti_to_rtstruct.export_to_rtstruct import export_to_rtstruct
from platipy.dicom.nifti_to_rtstruct.gen_contours import gen_contours
import pydicom
from collections import OrderedDict
from loguru import logger
Expand Down
2 changes: 1 addition & 1 deletion dicom/tests/test_convert_nifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pydicom
import numpy as np

from impit.dicom.nifti_to_rtstruct.convert import convert_nifti
from platipy.dicom.nifti_to_rtstruct.convert import convert_nifti

def test_convert_nifti():

Expand Down
2 changes: 1 addition & 1 deletion dicom/tests/test_convert_rtstruct.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import SimpleITK as sitk

from impit.dicom.rtstruct_to_nifti.convert import convert_rtstruct
from platipy.dicom.rtstruct_to_nifti.convert import convert_rtstruct

def test_convert_rtstruct():

Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: '3'

services:
impit:
image: impit
platipy:
image: platipy
ports:
- "8001:8000"
- "7777:7777"
volumes:
- .:/impit
- impit_data:/data
- .:/platipy
- platipy_data:/data
links:
- redis:redis
entrypoint: /bin/sh -c "while sleep 1000; do :; done"
environment:
PYTHONPATH: "/"
PYTHONPATH: "/platipy"
deploy:
resources:
limits:
Expand All @@ -26,5 +26,5 @@ services:
- redis_data:/data

volumes:
impit_data:
platipy_data:
redis_data:
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ celery beat --app=service:celery --loglevel=INFO &
celery worker --app=service:celery --loglevel=INFO &

# Start the Dicom listen celery task
python3 -c "from impit.framework.tasks import listen_task; listen_task.apply_async([$DICOM_LISTEN_PORT, '$DICOM_LISTEN_AET'])"
python3 -c "from platipy.framework.tasks import listen_task; listen_task.apply_async([$DICOM_LISTEN_PORT, '$DICOM_LISTEN_AET'])"

exec gunicorn -b :8000 --timeout 300 --graceful-timeout 60 --access-logfile - --error-logfile - service:app

Expand Down
12 changes: 6 additions & 6 deletions framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from flask_restful import Api
from celery import Celery

from impit.framework.application import FlaskApp
from platipy.framework.application import FlaskApp

from loguru import logger

Expand Down Expand Up @@ -45,9 +45,9 @@

# Configure API
api = Api(app)
app.config.from_object('impit.framework.api.CustomConfig')
app.config.from_object('platipy.framework.api.CustomConfig')

import impit.framework.views
import impit.framework.api
import impit.framework.tasks
from impit.framework.models import DataObject
import platipy.framework.views
import platipy.framework.api
import platipy.framework.tasks
from platipy.framework.models import DataObject
2 changes: 1 addition & 1 deletion framework/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from impit.framework import app, api
from platipy.framework import app, api
from loguru import logger

import flask_restful
Expand Down
4 changes: 2 additions & 2 deletions framework/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FlaskApp(Flask):
celery_started = False
beat_started = False
dicom_listener_port = 7777
dicom_listener_aetitle = "IMPIT_SERVICE"
dicom_listener_aetitle = "PLATIPY_SERVICE"

api = None # Holds reference to api for extensibility

Expand Down Expand Up @@ -81,7 +81,7 @@ def run_beat(self):

def run(self, host=None, port=None, debug=None,
dicom_listener_port=7777,
dicom_listener_aetitle="IMPIT_SERVICE",
dicom_listener_aetitle="PLATIPY_SERVICE",
load_dotenv=True, **options):

logger.info('Starting APP!')
Expand Down
6 changes: 3 additions & 3 deletions framework/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Provides a client to interact with IMPITs framework
Provides a client to interact with PlatiPy's framework
"""
import time
import os
Expand All @@ -20,8 +20,8 @@
API_DOWNLOAD_OBJECT = "{0}/api/dataobject/download"


class IMPITClient:
"""Client to help iteract with the framework implemented within IMPIT.
class PlatiPyClient:
"""Client to help iteract with the framework implemented within PlatiPy.
"""

def __init__(self, host, port, api_key, algorithm_name):
Expand Down
2 changes: 1 addition & 1 deletion framework/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from impit.framework import db
from platipy.framework import db
import datetime
import json

Expand Down
4 changes: 2 additions & 2 deletions framework/sample/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from loguru import logger

from impit.framework import app, DataObject
from impit.dicom.nifti_to_rtstruct.convert import convert_nifti
from platipy.framework import app, DataObject
from platipy.dicom.nifti_to_rtstruct.convert import convert_nifti

import SimpleITK as sitk
import pydicom
Expand Down
4 changes: 2 additions & 2 deletions framework/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from impit.framework import celery, db, app
from platipy.framework import celery, db, app
from celery.schedules import crontab

from loguru import logger
Expand All @@ -16,7 +16,7 @@
celery.conf.beat_schedule = {
# Executes every hour
'clean-up-every-hour': {
'task': 'impit.framework.tasks.clean_up_task',
'task': 'platipy.framework.tasks.clean_up_task',
'schedule': crontab(minute=0),
'args': (),
},
Expand Down
2 changes: 1 addition & 1 deletion framework/tests/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import json
import tempfile
from impit.framework import app
from platipy.framework import app


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion framework/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from impit.framework import app, celery, log_file_path
from platipy.framework import app, celery, log_file_path
from ..dicom.communication import DicomConnector
from .models import db, APIKey

Expand Down
2 changes: 1 addition & 1 deletion jupyter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM impit:latest
FROM platipy:latest

RUN pip3 install matplotlib==3.1.0 jupyterlab pandas itkwidgets seaborn gitpython

Expand Down
2 changes: 1 addition & 1 deletion jupyter/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Jupyter Tools

A Dockerfile is provided to create a useful Jupyter environment to develop and
work with these impit tools. It can be launched using ```docker-compose up -d```
work with these platipy tools. It can be launched using ```docker-compose up -d```

Work in progress.

Expand Down
2 changes: 1 addition & 1 deletion segmentation/bronchus/bronchus.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import SimpleITK as sitk

from impit.segmentation.common.tools import detect_holes, get_lung_mask
from platipy.segmentation.common.tools import detect_holes, get_lung_mask


def fast_mask(img, start, end):
Expand Down
2 changes: 1 addition & 1 deletion segmentation/bronchus/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from loguru import logger

from impit.segmentation.bronchus.bronchus import (
from platipy.segmentation.bronchus.bronchus import (
generate_lung_mask,
generate_airway_mask,
default_settings,
Expand Down
Loading

0 comments on commit bf9f8bf

Please sign in to comment.