Skip to content

Commit 61ba111

Browse files
authored
Merge pull request #17 from Topp-Roots-Lab/development
Resolves #14
2 parents 07b2ef5 + 0d8b0c0 commit 61ba111

File tree

21 files changed

+736
-245
lines changed

21 files changed

+736
-245
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ wheels/
2525
*.egg
2626
MANIFEST
2727

28+
# Keep NSI SDK
29+
!rawtools/lib
30+
2831
# PyInstaller
2932
# Usually these files are written by a python script from a template
3033
# before PyInstaller builds the exe, so as to inject date/other infos into it.

HISTORY.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
History
33
=======
44

5+
0.2.0 (2021-01-04)
6+
------------------
7+
8+
* Added efX-SDK library
9+
* Added module to export/convert `nsihdr` files to uint `raw` files using the efX-SDK (Windows only)
10+
* Tentatively implemented a GUI for the nsihdr2raw export tool
11+
* Tweaked logging path for log files generated relative to input data for `nsihdr2raw`
12+
13+
0.1.4 (2020-10-27)
14+
------------------
15+
16+
* Code clean up, remove unnecessary transposing of data, improved debug statements and logging
17+
18+
0.1.3 (2020-10-26)
19+
------------------
20+
21+
* Fixed font file missing when installing via pip
22+
523
0.1.2 (2020-09-25)
624
------------------
725

@@ -10,4 +28,4 @@ History
1028
0.1.0 (2020-06-19)
1129
------------------
1230

13-
* First release on PyPI.
31+
* Initial version

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include README.rst
66
include rawtools/assets/OpenSans-Regular.ttf
77

88
recursive-include tests *
9+
recursive-include rawtools/lib *
910
recursive-exclude * __pycache__
1011
recursive-exclude * *.py[co]
1112

rawtools/assets/caution.ico

4.19 KB
Binary file not shown.

rawtools/assets/caution.png

1.21 KB
Loading

rawtools/assets/tools.ico

4.19 KB
Binary file not shown.

rawtools/assets/tools.png

1.98 KB
Loading

rawtools/cli.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@
44
from importlib.metadata import version
55
from multiprocessing import cpu_count
66

7-
from rawtools import convert, generate, nsihdr, qualitycontrol, log, raw2img
7+
from rawtools import convert, generate, log, qualitycontrol, raw2img
88

99
__version__ = version('rawtools')
1010

1111
def main():
1212
"""Console script for rawtools."""
13-
parser = argparse.ArgumentParser()
14-
parser.add_argument('_', nargs='*')
15-
args = parser.parse_args()
16-
17-
print("Arguments: " + str(args._))
18-
print("Replace this message by putting your code into "
19-
"rawtools.cli.main")
2013
return 0
2114

2215
def raw_convert():
@@ -69,19 +62,27 @@ def raw_generate():
6962
generate.main(args)
7063

7164
def raw_nsihdr():
72-
description = "This tool converts a NSI project from 32-bit float to 16-bit unsigned integer format, and it extracts the midslice and generates a side-view projection of the volume."
65+
description = "This tool converts a NSI project from 32-bit float to 16-bit unsigned integer format."
7366

7467
parser = argparse.ArgumentParser(description=description, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
7568
parser.add_argument("-V", "--version", action="version", version=f'%(prog)s {__version__}')
76-
parser.add_argument("-v", "--verbose", action="store_true", help="Increase output verbosity")
69+
parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Increase output verbosity")
7770
parser.add_argument("-f", "--force", action="store_true", default=False, help="Force file creation. Overwrite any existing files.")
78-
parser.add_argument('path', metavar='PATH', type=str, nargs='+', help='List of .nsihdr files')
71+
parser.add_argument("--gui", action="store_true", default=False, help="(Experimental) Enable GUI")
72+
parser.add_argument('path', metavar='PATH', type=str, nargs="+", help='List of .nsihdr files')
7973
args = parser.parse_args()
8074

8175
args.module_name = 'nsihdr'
8276
log.configure(args)
8377

84-
rt.nsihdr.main(args)
78+
# Use a GUI to select the source directory
79+
if args.gui == True:
80+
from rawtools.gui import nsihdr
81+
nsihdr.App(args)
82+
# Otherwise, assume CLI use
83+
else:
84+
from rawtools import nsihdr
85+
nsihdr.main(args)
8586

8687
def raw_qc():
8788
"""Quality control tools"""

rawtools/dat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def bitdepth(name):
1919
2020
"""
2121
name = str(name)
22-
logging.warning(name)
2322
supported_types = {
2423
'uint8': 'UCHAR',
2524
'uint16': 'USHORT',

rawtools/gui/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)