removed silly argument thingy. Refactored
Browse files- livermask/livermask.py +5 -4
- setup.py +2 -26
livermask/livermask.py
CHANGED
@@ -95,14 +95,15 @@ def main():
|
|
95 |
# Memory growth must be set before GPUs have been initialized
|
96 |
print(e)
|
97 |
|
98 |
-
# fix paths
|
99 |
-
ret.input = ret.input.replace("\\", "/")
|
100 |
-
ret.output = ret.output.replace("\\", "/")
|
101 |
-
|
102 |
if ret.input is None:
|
103 |
raise ValueError("Please, provide an input.")
|
104 |
if ret.output is None:
|
105 |
raise ValueError("Please, provide an output.")
|
|
|
|
|
|
|
|
|
|
|
106 |
if not os.path.isdir(ret.input) and not ret.input.endswith(".nii"):
|
107 |
raise ValueError("Input path provided is not in the supported '.nii' format or a directory.")
|
108 |
if ret.output.endswith(".nii") or "." in ret.output.split("/")[-1]:
|
|
|
95 |
# Memory growth must be set before GPUs have been initialized
|
96 |
print(e)
|
97 |
|
|
|
|
|
|
|
|
|
98 |
if ret.input is None:
|
99 |
raise ValueError("Please, provide an input.")
|
100 |
if ret.output is None:
|
101 |
raise ValueError("Please, provide an output.")
|
102 |
+
|
103 |
+
# fix paths
|
104 |
+
ret.input = ret.input.replace("\\", "/")
|
105 |
+
ret.output = ret.output.replace("\\", "/")
|
106 |
+
|
107 |
if not os.path.isdir(ret.input) and not ret.input.endswith(".nii"):
|
108 |
raise ValueError("Input path provided is not in the supported '.nii' format or a directory.")
|
109 |
if ret.output.endswith(".nii") or "." in ret.output.split("/")[-1]:
|
setup.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
from setuptools import setup, find_packages
|
2 |
from setuptools.command.install import install
|
3 |
-
import os
|
4 |
-
|
5 |
-
|
6 |
-
print("\n\n\n\n---:", sys.argv)
|
7 |
|
8 |
|
9 |
with open("README.md", "r") as f:
|
@@ -13,30 +10,9 @@ with open('requirements.txt', 'r', encoding='utf-16') as ff:
|
|
13 |
required = ff.read().splitlines()
|
14 |
|
15 |
|
16 |
-
class InstallCommand(install):
|
17 |
-
user_option = install.user_options + [
|
18 |
-
('cupyyy=', None, 'enable flag to install package with GPU support'),
|
19 |
-
]
|
20 |
-
|
21 |
-
def initialize_options(self):
|
22 |
-
super().initialize_options()
|
23 |
-
self.cupy = "cupy"
|
24 |
-
|
25 |
-
def finalize_options(self):
|
26 |
-
print("CuPy version selected is: ", self.cupyyy)
|
27 |
-
super().finalize_options()
|
28 |
-
|
29 |
-
def run(self):
|
30 |
-
# use options
|
31 |
-
global cupy
|
32 |
-
required.append(self.cupy)
|
33 |
-
|
34 |
-
super().run()
|
35 |
-
|
36 |
-
|
37 |
setup(
|
38 |
name='livermask',
|
39 |
-
version='1.
|
40 |
author="André Pedersen",
|
41 |
author_email="andrped94@gmail.com",
|
42 |
license='MIT',
|
|
|
1 |
from setuptools import setup, find_packages
|
2 |
from setuptools.command.install import install
|
3 |
+
import os
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
with open("README.md", "r") as f:
|
|
|
10 |
required = ff.read().splitlines()
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
setup(
|
14 |
name='livermask',
|
15 |
+
version='1.3.0',
|
16 |
author="André Pedersen",
|
17 |
author_email="andrped94@gmail.com",
|
18 |
license='MIT',
|