Skip to content

Commit

Permalink
Merge pull request #5 from jankukacka/dev
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
jankukacka authored Mar 7, 2022
2 parents af99915 + 7eeabcc commit a30cf75
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Image viewer mk2
# Image viewer Mk2
Viewer for spectral images, in particular suitable from multispectral optoacoustic tomography.

![Screenshot of the image viewer.](doc/screenshot.png)
Expand All @@ -7,7 +7,7 @@ Viewer for spectral images, in particular suitable from multispectral optoacoust
## Installation

```
pip install image-viewer-mk2==1.0.0b3
pip install image-viewer-mk2==1.0.0
```

See [dependencies](https://github.com/jankukacka/image_viewer_mk2/blob/master/dependencies.md) for versions of dependency libraries that were tested with this software but are not strictly required during installation.
Expand All @@ -21,15 +21,15 @@ See [releases](https://github.com/jankukacka/image_viewer_mk2/releases) for olde
```

**From within python scripts and interactive sessions.** The viewer can be either used as an interactive image viewer, giving the user the ability to manually adjust the settings. The rendered image is returned back so that it can be further used inside the script.
```
```python
import image_viewer_mk2.app as imv

img = np.zeros((height, width, channels))
render = imv.start(image=img)
```

Alternatively, it can be used to apply existing configuration and directly return a rendered image without opening the interactive GUI:
```
```python
import image_viewer_mk2.app as imv

img = np.zeros((height, width, channels))
Expand All @@ -50,7 +50,6 @@ When using in interactive session, all other matplotlib figures have to be close
This software reuses code and icons produced by: Alistair Muldal, cilame, Benjamin Johnson, Remin Emonet, [Icon home](https://www.flaticon.com/authors/icon-home), [Gregor Cresnar](https://www.flaticon.com/authors/gregor-cresnar), [Freepik](https://www.flaticon.com/authors/Freepik), [Google](https://www.flaticon.com/authors/google), Uptal Barman, [Arkinasi](https://www.flaticon.com/authors/arkinasi), [Royyan Wijaya](https://www.flaticon.com/authors/royyan-wijaya), and Pancracysdh.

## License

The software is provided under the [MIT open license](LICENSE.txt).

## Citation
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = image-viewer-mk2
author = Jan Kukacka
version = 1.0.0b3
version = 1.0.0
description = Image viewer for spectral images
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
9 changes: 7 additions & 2 deletions src/image_viewer_mk2/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,17 @@ def show_all(self, *_):
for i in range(len(self.model.channel_props)):
self.model.channel_props[i]['visible'] = True

def render_to_clipboard(self, _):
def render_to_clipboard(self):
'''
Code from https://stackoverflow.com/a/62007792/2042751
'''
try:
import win32clipboard
except ImportError:
print('Cannot import win32clipboard. Copy to clipboard not available.')
return

from io import BytesIO
import win32clipboard
from PIL import Image

def send_to_clipboard(clip_type, data):
Expand Down
2 changes: 1 addition & 1 deletion src/image_viewer_mk2/tk_widgets/window_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, master, skin):
frame = tk.Frame(frame, bg='#ff0000')
frame.pack(side=tk.TOP, expand=True, fill=tk.X, padx=10)
tk.Label(frame, text='Image Viewer MK2', fg=self.skin.fg_color, bg=self.skin.bg_color, font=('Segoe UI', 14, 'bold')).pack(side=tk.TOP, expand=False, fill=tk.X)
tk.Label(frame, text=f'v{__version__} (2022-02-07)', fg=self.skin.fg_color, bg=self.skin.bg_color).pack(side=tk.TOP, expand=False, fill=tk.X)
tk.Label(frame, text=f'v{__version__} (2022-03-07)', fg=self.skin.fg_color, bg=self.skin.bg_color).pack(side=tk.TOP, expand=False, fill=tk.X)
tk.Label(frame, text='Author: Jan Kukačka, 2021', fg=self.skin.fg_color, bg=self.skin.bg_color).pack(side=tk.TOP, expand=False, fill=tk.X)
tk.Label(frame, text='Provided under MIT license.', fg=self.skin.fg_color, bg=self.skin.bg_color).pack(side=tk.TOP, expand=False, fill=tk.X)
tk.Label(frame, text='Icon credits: Icon home, Gregor Cresnar,\nFreepik, Google, Uptal Barman\nArkinasi, Royyan Wijaya and Pancracysdh.', fg=self.skin.fg_color, bg=self.skin.bg_color).pack(side=tk.TOP, expand=False, fill=tk.X)
Expand Down

0 comments on commit a30cf75

Please sign in to comment.