From 945fa82c589d0bc55b60cd429b42fa6002f2caf9 Mon Sep 17 00:00:00 2001 From: Mikael Brudfors Date: Wed, 6 Oct 2021 13:35:00 +0000 Subject: [PATCH 1/6] FIX: ensure pow is set correctly --- unires/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) From d8c35b5f0a1528679011b2d00c15c872b301c929 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 19 Nov 2021 17:58:29 +0000 Subject: [PATCH 2/6] FEAT: install with specific nitorch tag --- README.md | 29 +++++++++++++++++++---------- setup.py | 18 ++++++++++-------- 2 files changed, 29 insertions(+), 18 deletions(-) mode change 100755 => 100644 setup.py diff --git a/README.md b/README.md index bc47faa..8df02c0 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, 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 torch beforehand, *i.e.*: +```shell +pip install torch==1.9.0+cu111 +NI_COMPILED_BACKEND="C" pip install --no-build-isolation . +``` +Run the `nvcc --version` command to see what CUDA version you are using. -### 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', ) From 21f9192cfb19918f3798db4b1734526c655bbd8d Mon Sep 17 00:00:00 2001 From: Mikael Brudfors Date: Fri, 19 Nov 2021 18:00:29 +0000 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8df02c0..8a15e60 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ pip install . ```shell NI_COMPILED_BACKEND="C" pip install --no-build-isolation . ``` -However, 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 torch beforehand, *i.e.*: +However, 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 . From 14b91d7a96357ddc6d0ba7432ecdc4952cfae5b4 Mon Sep 17 00:00:00 2001 From: Mikael Brudfors Date: Fri, 19 Nov 2021 18:09:21 +0000 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a15e60..5811b56 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ pip install . ```shell NI_COMPILED_BACKEND="C" pip install --no-build-isolation . ``` -However, 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.*: +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 . From 7aedcfae82d75cd2c0af1d49ae24618a7fa9a17c Mon Sep 17 00:00:00 2001 From: Mikael Brudfors Date: Fri, 19 Nov 2021 18:10:28 +0000 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5811b56..18a2dae 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ However, for running on the GPU, this only works if you ensure that the PyTorch pip install torch==1.9.0+cu111 NI_COMPILED_BACKEND="C" pip install --no-build-isolation . ``` -Run the `nvcc --version` command to see what CUDA version you are using. +where the PyTorch version matches the output of `nvcc --version`. ### 1.2. Example usage From f825ec6bf464484e3ecdd7212c7e98646e131f9f Mon Sep 17 00:00:00 2001 From: Mikael Brudfors Date: Fri, 19 Nov 2021 18:11:05 +0000 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18a2dae..eefd6aa 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ However, for running on the GPU, this only works if you ensure that the PyTorch pip install torch==1.9.0+cu111 NI_COMPILED_BACKEND="C" pip install --no-build-isolation . ``` -where the PyTorch version matches the output of `nvcc --version`. +where the PyTorch CUDA version matches the output of `nvcc --version`. ### 1.2. Example usage