diff --git a/README.md b/README.md index bc47faa..eefd6aa 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,27 @@ An installation-free demo of UniRes is available in Colab: ## 1. Python -### 1.1. Dependencies -The *NITorch* package is required to use *UniRes*; simply follow the quickstart -guide on its GitHub page: https://github.com/balbasty/nitorch. - -Next, activate a *NITorch* virtual environment and move to the *UniRes* project -directory. Then install the package using either setuptools or pip: -``` bash -cd /path/to/unires +### 1.1. Installation +Clone `UniRes`: +```shell +git clone https://github.com/brudfors/UniRes +``` +Then `cd` into the `UniRes` folder and install it by: +```shell pip install . -``` +``` +**OBS**: The algorithm runs much faster if the compiled backend is used: +```shell +NI_COMPILED_BACKEND="C" pip install --no-build-isolation . +``` +However, for running on the GPU, this only works if you ensure that the PyTorch installation uses the same CUDA version that is on your system; therefore, it might be worth installing PyTorch beforehand, *i.e.*: +```shell +pip install torch==1.9.0+cu111 +NI_COMPILED_BACKEND="C" pip install --no-build-isolation . +``` +where the PyTorch CUDA version matches the output of `nvcc --version`. -### 1.2. Example use cases +### 1.2. Example usage Running *UniRes* is straight forward. Let's say you have three MR images: `T1.nii.gz`, `T2.nii.gz` and `PD.nii.gz`, then diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index d4ebf82..d123eda --- a/setup.py +++ b/setup.py @@ -1,15 +1,17 @@ -from setuptools import setup, find_packages +from setuptools import (setup, find_packages) setup( - name='unires', - version='0.1a', - packages=find_packages(), - url='https://github.com/brudfors/UniRes', author='Mikael Brudfors', author_email='brudfors@gmail.com', + description='UniRes: Unified Super-Resolution of Medical Imaging Data', entry_points={'console_scripts': ['unires=unires._cli:run']}, - description='UniRes: Unified Super-Resolution of Neuroimaging Data', - python_requires='>=3.6' - + install_requires=[ + "nitorch[all]@git+https://github.com/balbasty/nitorch@0.1#egg=nitorch", + ], + name='unires', + packages=find_packages(), + python_requires='>=3.6', + url='https://github.com/brudfors/UniRes', + version='0.0.1a', ) diff --git a/unires/run.py b/unires/run.py index b9fbdcc..2d57664 100644 --- a/unires/run.py +++ b/unires/run.py @@ -238,7 +238,8 @@ def init(data, sett=settings()): # Makes recons aligned with same grid, across subjects sett.do_atlas_align = True sett.crop = True - sett.pow = 256 + if sett.pow == 0: + sett.pow = 256 # Read and format data (images and labels) x = _read_data(data, sett)