Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
alexriss committed Dec 11, 2023
2 parents ca6aa04 + 758d2cd commit 504f140
Show file tree
Hide file tree
Showing 74 changed files with 7,459 additions and 1,707 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- '1.8'
- '1.9'
# - '^1.9.0-0'
# - 'nightly'
os:
- ubuntu-latest
Expand All @@ -36,16 +38,7 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
Expand Down
48 changes: 30 additions & 18 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,60 @@ keywords = ["SPM", "STM", "AFM", "scanning probe microscopy", "scanning tunnelin
license = "GPLv3"
desc = "Organize scanning probe microscopy images and spectra"
authors = ["Alex Riss"]
version = "0.4.4"
version = "0.6.1"

[deps]
Blink = "ad839575-38b3-5650-b840-f874b8c74a25"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSExpr = "97c1335a-c9c5-57fe-bc5d-ec35cebe8660"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
NaturalSort = "c020b1a1-e9b0-503a-9c33-f039bfc54a85"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
SkipNan = "aed68c70-c8b0-4309-8cd1-d392a74f991a"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
SpmImages = "a5d333f8-9588-4c9f-ac4d-4583361e1fcb"
SpmSpectroscopy = "9ab0b2fc-e013-4186-b0b9-58e9a8cad668"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
Blink = "=0.12.5"
CodecZlib = "^0.7"
ColorSchemes = "^3.15"
DataFrames = "^1.3"
DataStructures = "^0.18"
ImageIO = "^0.6"
Images = "^0.25"
JLD2 = "^0.4"
JSON = "^0.21"
Mustache = "^1.0"
NaturalSort = "^1.0"
SnoopPrecompile = "^1.0"
SpmImages = "^0.3"
Blink = "=0.12.8"
CodecZlib = "=0.7.2"
ColorSchemes = "=3.23.0"
DSP = "=0.7.8"
DataFrames = "=1.6.1"
DataStructures = "=0.18.15"
FFTW = "=1.7.1"
ImageFiltering = "=0.7.6"
ImageIO = "=0.6.7"
Images = "=0.26.0"
JLD2 = "=0.4.32"
JSExpr = "=0.5.4"
JSON = "=0.21.4"
Mustache = "=1.0.17"
NaturalSort = "=1.0.0"
SkipNan = "^0.2"
PrecompileTools = "=1.2.0"
SpmImages = "^0.3.2"
SpmSpectroscopy = "^0.5"
StatsBase = "^0.33"
ZipFile = "^0.10"
julia = "^1.8"
StatsBase = "=0.34.0"
TranscodingStreams = "=0.9.13"
ZipFile = "=0.10.1"
julia = "^1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Currently, [Nanonis](https://www.specs-group.com/nanonis/) scanning tunneling mi
[Demo](#demo)
[Disclaimer](#disclaimer)
[Installation](#installation)
[Installation (alternative)](#alternative-installation)
[Cite](#cite)
[Case study](#real-world-case-study)
[Tips and tricks](#tips-and-tricks)
Expand All @@ -25,11 +26,12 @@ Currently, [Nanonis](https://www.specs-group.com/nanonis/) scanning tunneling mi

- Load and display Nanonis SPM images: grid and zoom views
- Load and display Nanonis spectra
- Fast keyboard-based navigation
- Fast navigation: dropdown menus or keyboard shortcuts
- Cycle through channels, switch between forward and backward directions
- Different types of background corrections
- Various color palettes
- Line profiles *(experimental and not yet fully tested)*
- Non-destructive edits: Gaussian, Laplacian, Fourier Filter, etc.
- Line profiles
- Star-rating and keyword systems
- Powerful search and filtering (e.g., by keywords, data type, location, scan size)
- Overview and position-based filtering
Expand Down Expand Up @@ -72,6 +74,27 @@ Currently, [Nanonis](https://www.specs-group.com/nanonis/) scanning tunneling mi
<td>Spectrum display<br />(Screenshot)</td>
<td>Spectra demo <br />(YouTube)</td>
</tr>
<tr>
<td>
<a href="https://www.youtube.com/watch?v=rnk2hWuwpuI" target="_blank"><img src="http://img.youtube.com/vi/rnk2hWuwpuI/0.jpg" width="230" /></a>
</td>
<td>
<a href="https://www.youtube.com/watch?v=VE_RGMeDTFc" target="_blank"><img src="http://img.youtube.com/vi/VE_RGMeDTFc/0.jpg" width="230" /></a>
</td>
<td>
<a href="https://www.youtube.com/watch?v=9Up7eEEuHNw" target="_blank"><img src="http://img.youtube.com/vi/9Up7eEEuHNw/0.jpg" width="230" /></a>
</td>
<!-- <td align="center">
<i>More features coming soon...</i>
&nbsp;
<br /><br />
</td> -->
</tr>
<tr>
<td>Non-destructive edits<br />(YouTube)</td>
<td>Fourier filter<br />(YouTube)</td>
<td>Menus<br />(YouTube)</td>
</tr>
</table>

It is best to play around with the app yourself, so [go ahead and install it.](#installation). Example data can be found in the [test directory](test/data).
Expand All @@ -86,7 +109,27 @@ _The app never modifies or deletes your original data. However, in case of any u

_Please only use the app if you read the disclaimer above and feel brave enough to do so._

To install and use, do the following:
Use [SpmImage Tycoon Installer](https://github.com/alexriss/SpmImageTycoonInstaller.jl). It will install a compiled version of SpmImage Tycoon with much improved startup speed. Furthermore, it can create startmenu and desktop shortcuts. This way of installation also allows to copy the app from one computer to another, by simply copying the installation directory.

Usage is simple:

1. Install [Julia](https://julialang.org/)
2. Start Julia and type the following two commands:

```julia
using Pkg
Pkg.add("SpmImageTycoonInstaller")
using SpmImageTycoonInstaller
install()
```

This will install a compiled version of [SpmImage Tycoon](https://github.com/alexriss/SpmImageTycoon.jl).
The installation will typically take 10 to 20 minutes and take up around 1 GB of space.
The same procedure can be used to update to the latest version.

## Alternative Installation

As an alternative to the automatic installation process described above, you can manually install SpmImage Tycoon:

1. Install [Julia](https://julialang.org/)
2. Start Julia and type the following two commands:
Expand All @@ -103,7 +146,7 @@ tycoon()

4. As a more convenient alternative to 3, just use one of the scripts in the [helpers directory](helpers/) to start the app. There is a [shell script](helpers/SpmImageTycoon.sh) for linux, as well as a [bat script](helpers/windows_tray/SpmImageTycoon.bat) for windows and also an [autohotkey script](helpers/windows_tray/SpmImageTycoon.ahk). You can find more information on autohotkey [here](https://www.autohotkey.com/).

### Update an existing installation
### Update an existing manual installation

1. Start Julia and type the following two commands:
```julia
Expand Down Expand Up @@ -167,11 +210,12 @@ The program relies on

The following javascript and css libraries are included in the app:

- [tagify](https://github.com/yairEO/tagify): MIT License
- [Simple-DataTables](https://github.com/fiduswriter/Simple-DataTables): LGPL License
- [Bulma](https://bulma.io/): MIT License
- [μPlot](https://github.com/leeoniya/uPlot): MIT License
- [SelectionJS](https://github.com/Simonwep/selection): MIT License
- [Simple-DataTables](https://github.com/fiduswriter/Simple-DataTables): LGPL License
- [Sortable](https://github.com/SortableJS/Sortable): MIT License
- [tagify](https://github.com/yairEO/tagify): MIT License

### Automated tests

Expand Down
77 changes: 35 additions & 42 deletions helpers/windows_tray/SpmImageTycoon.ahk
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#NoTrayIcon
#Persistent
#SingleInstance force
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
#SingleInstance
Persistent

global script

/* Setup Tray icon and add item that will handle
* double click events
*/
Menu Tray, NoStandard
Menu Tray, Icon
Menu Tray, Icon, SpmImageTycoon.ico
Menu Tray, Add, Show / Hide, TrayClick
Menu Tray, Add, Close, CloseItem
Menu Tray, Default, Show / Hide
; Setup Tray icon and add item that will handle double click events
Tray:= A_TrayMenu
Tray.Delete()
TraySetIcon("SpmImageTycoon.ico")
Tray.Add("Show / Hide", TrayClick)
Tray.Add("Close", CloseItem)
Tray.Default := "Show / Hide"

;// Run program or batch file hidden
DetectHiddenWindows On
Run SpmImageTycoon.bat,, Hide, PID
WinWait ahk_pid %PID%
DetectHiddenWindows(true)
Run("SpmImageTycoon.bat", , "Hide", &PID)
ErrorLevel := WinWait("ahk_pid " PID) , ErrorLevel := ErrorLevel = 0 ? 1 : 0
script := WinExist()
DetectHiddenWindows Off
DetectHiddenWindows(false)

SetTimer, Closer, 2000
SetTimer(Closer, 2000)

return

TrayClick:
OnTrayClick()
return
TrayClick(A_ThisMenuItem, A_ThisMenuItemPos, MyMenu) {
OnTrayClick()
return
}

;// Show / hide program or batch file on double click
OnTrayClick() {
OnTrayClick(*) {
if DllCall("IsWindowVisible", "Ptr", script) {
WinHide ahk_id %script%

WinHide("ahk_id " script)
} else {
WinShow ahk_id %script%
WinActivate ahk_id %script%
WinShow("ahk_id " script)
WinActivate("ahk_id " script)
}
}

CloseItem() {
CloseItem(*) {
DetectHiddenWindows(true)
ErrorLevel := WinWait("ahk_class ConsoleWindowClass") , ErrorLevel := ErrorLevel = 0 ? 1 : 0
ErrorLevel := ProcessClose("cmd.exe")
DetectHiddenWindows(false)
ExitApp()
}

DetectHiddenWindows On
WinWait ahk_class ConsoleWindowClass
Process, Close, cmd.exe
DetectHiddenWindows Off
ExitApp

Closer(*) {
ErrorLevel := ProcessExist(PID)
If !ErrorLevel
ExitApp()
Return
}


Closer:
Process, Exist, %PID%
If !ErrorLevel
ExitApp
Return
2 changes: 1 addition & 1 deletion helpers/windows_tray/SpmImageTycoon.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia -t auto -e "using SpmImageTycoon; tycoon();"
timeout /t 60
timeout /t 10
63 changes: 63 additions & 0 deletions helpers/windows_tray/SpmImageTycoon_v1.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#NoTrayIcon
#Persistent
#SingleInstance force

global script

/* Setup Tray icon and add item that will handle
* double click events
*/
Menu Tray, NoStandard
Menu Tray, Icon
Menu Tray, Icon, SpmImageTycoon.ico
Menu Tray, Add, Show / Hide, TrayClick
Menu Tray, Add, Close, CloseItem
Menu Tray, Default, Show / Hide

;// Run program or batch file hidden
DetectHiddenWindows On
Run SpmImageTycoon.bat,, Hide, PID
WinWait ahk_pid %PID%
script := WinExist()
DetectHiddenWindows Off

SetTimer, Closer, 2000

return

TrayClick:
OnTrayClick()
return

;// Show / hide program or batch file on double click
OnTrayClick() {
if DllCall("IsWindowVisible", "Ptr", script) {
WinHide ahk_id %script%

} else {
WinShow ahk_id %script%
WinActivate ahk_id %script%
}
}

CloseItem() {

DetectHiddenWindows On
WinWait ahk_class ConsoleWindowClass
Process, Close, cmd.exe
DetectHiddenWindows Off
ExitApp

}


Closer:
Process, Exist, %PID%
If !ErrorLevel
ExitApp
Return
Loading

0 comments on commit 504f140

Please sign in to comment.