diff --git a/SOFTWARE/IMJOY/.gitignore b/SOFTWARE/IMJOY/.gitignore deleted file mode 100755 index 894a44cc..00000000 --- a/SOFTWARE/IMJOY/.gitignore +++ /dev/null @@ -1,104 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ diff --git a/SOFTWARE/IMJOY/LICENSE b/SOFTWARE/IMJOY/LICENSE deleted file mode 100755 index 590195a2..00000000 --- a/SOFTWARE/IMJOY/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Wei Ouyang - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/SOFTWARE/IMJOY/README.md b/SOFTWARE/IMJOY/README.md deleted file mode 100755 index be033fde..00000000 --- a/SOFTWARE/IMJOY/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# ImJoy Project Template -This is a template for project layout we propose for projects supporting ImJoy plugins. The overall organization is standard and your code can very well be use without ImJoy. Two additional elements allow the direct use with ImJoy: - -0. Folder **`imjoy-plugins`**: contains the ImJoy plugin files (extension 'imjoy.html'). -1. File **`manifest.imjoy.json`**: specifies how your ImJoy plugins will be shown in the ImJoy plugin import menu - -## Creating url to automatically install your plugins -The ImJoy plugin files can be used to [generate a url](http://imjoy.io/docs/index.html#/development?id=distributing-your-plugin-with-url) which automatically opens ImJoy and installs your plugin with all dependencies. - -This example install the template plugin: [Template Plugin](https://imjoy.io/#/app?plugin=https://raw.githubusercontent.com/oeway/ImJoy-project-template/master/imjoy-plugins/templatePlugin.imjoy.html) - -Once the plugin is installed, click `Template Plugin` in the plugin menu and follow the instructions in the dialog to install the Python Plugin Engine. You can then execute the plugin. - -### Using tags -ImJoy plugins can have different **[tags](http://imjoy.io/docs/index.html#/development?id=plugins-and-tags)** determining how the plugin is shown in the interface and how it is executed, e.g. to allow processing either on a CPU or GPU. These tags can be set in the url, and you can provide different options to the user. - - - - - diff --git a/SOFTWARE/IMJOY/data/hologram_mouse.jpg b/SOFTWARE/IMJOY/data/hologram_mouse.jpg deleted file mode 100644 index 89b9695d..00000000 Binary files a/SOFTWARE/IMJOY/data/hologram_mouse.jpg and /dev/null differ diff --git a/SOFTWARE/IMJOY/manifest.imjoy.json b/SOFTWARE/IMJOY/manifest.imjoy.json deleted file mode 100755 index d591fce7..00000000 --- a/SOFTWARE/IMJOY/manifest.imjoy.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "UC2 Projects", - "description": "UC2 - ImJoy plugin repository.", - "version": "0.2.0", - "uri_root": "", - "plugins": [ - { - "name": "Inline Hologram Reconstruction", - "type": "native-python", - "version": "0.1.1", - "api_version": "0.1.2", - "description": "Should backpropagate a Hologram numerically", - "tags": [], - "ui": "", - "inputs": null, - "outputs": null, - "flags": [], - "icon": null, - "env": null, - "requirements": [ - "numpy" - ], - "dependencies": ["bionanoimaging/UC2-GIT/tree/master/SOFTWARE/IMJOY/imjoy-plugins:UC2 Holorecon"], - "uri": "imjoy-plugins/UC2_Inline_Hologram_Reconstruction.imjoy.html" - } - ], - "collections": [] -} diff --git a/SOFTWARE/IMJOY/repository/.gitkeep b/SOFTWARE/IMJOY/repository/.gitkeep deleted file mode 100755 index 8b137891..00000000 --- a/SOFTWARE/IMJOY/repository/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/SOFTWARE/IMJOY/repository/FresnelPropagator.py b/SOFTWARE/IMJOY/repository/FresnelPropagator.py deleted file mode 100644 index 9a5578e7..00000000 --- a/SOFTWARE/IMJOY/repository/FresnelPropagator.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- - -# manage the imports -import numpy as np -import matplotlib.pyplot as plt -import os -import time - - -# %load_ext autoreload -# %reload_ext autoreload - -# FRESNEL PROPAGATOR - -# function [Ef,x,y,G,E0fft,fx,fy,H,indx] = FresnelPropagator(E0, ps, lambda0, z, background) -# -# This function computes the double-slit diffraction pattern using the -# Fresnel Approximation. This code was modified from Dan and Aamod's -# Fresnel propagator codes. -# -# Parameters: E0 - initial complex field in x-y source plane -# ps - pixel size in microns -# lambda0 - wavelength in nm -# z - z-value (distance from sensor to object) -# background - optional background image to divide out from -# input field -# -# Returns: Ef - -# x - -# y - -# G - -# E0fft - -# fx - -# fy - -# H - -# - -def abssqr(x): - # this is what a detector sees (only intensities) - return np.real(x*np.conj(x)) - -def FT(x): - # this only defines the correct fwd fourier transform including proper shift of the frequencies - return np.fft.fftshift(np.fft.fft2(x)) # Fourier transform and shift - -def iFT(x): - # this only defines the correct inverse fourier transform including proper shift of the frequencies - return np.fft.ifft2(np.fft.ifftshift(x)) # inverse Fourier transform and shift - -def FresnelPropagator(E0, ps, lambda0, z): - # Parameters: E0 - initial complex field in x-y source plane - # ps - pixel size in microns - # lambda0 - wavelength in nm - # z - z-value (distance from sensor to object) - # background - optional background image to divide out from - # - - upsample_scale = 1; # Scale by which to upsample image - n = upsample_scale * E0.shape[1] # Image width in pixels (same as height) - grid_size = ps * n; # Grid size in x-direction - - - # Inverse space - fx = np.linspace(-(n-1)/2*(1/grid_size), (n-1)/2*(1/grid_size), n) - fy = np.linspace(-(n-1)/2*(1/grid_size), (n-1)/2*(1/grid_size), n) - Fx, Fy = np.meshgrid(fx, fy) - - # Fresnel kernel / point spread function h = H(kx, ky) - # from Fourier Optics, chapter 4 - # H = sqrt(z*lambda0)*exp(1i*pi*lambda0*z*(Fx.^2+Fy.^2)); - # sphere=exp(i*k/2/zc*(xx.^2+yy.^2)); - H = np.exp(1j*(2 * np.pi / lambda0) * z) * np.exp(1j * np.pi * lambda0 * z * (Fx**2 + Fy**2)) - #H= cos(pi*lambda0*z*(Fx.^2+Fy.^2)+(2*pi*z)/lambda0)+1i.*sin(pi*lambda0*z*(Fx.^2+Fy.^2)+(2*pi*z)/lambda0); - - # Compute FFT centered about 0 - E0fft = FT((E0)); # Centered about 0 since fx and fy centered about 0 - - # Multiply spectrum with fresnel phase-factor - G = H * E0fft - Ef = iFT(G) # Output after deshifting Fourier transform - - return Ef \ No newline at end of file diff --git a/SOFTWARE/IMJOY/repository/FresnelPropagatorGUI.js b/SOFTWARE/IMJOY/repository/FresnelPropagatorGUI.js deleted file mode 100644 index 75a1ca45..00000000 --- a/SOFTWARE/IMJOY/repository/FresnelPropagatorGUI.js +++ /dev/null @@ -1,72 +0,0 @@ - diff --git a/SOFTWARE/IMJOY/repository/UC2_Inline_Hologram_Reconstruction.imjoy.html b/SOFTWARE/IMJOY/repository/UC2_Inline_Hologram_Reconstruction.imjoy.html deleted file mode 100644 index f2ab5fe3..00000000 --- a/SOFTWARE/IMJOY/repository/UC2_Inline_Hologram_Reconstruction.imjoy.html +++ /dev/null @@ -1,167 +0,0 @@ - -Demo plugin to demonstrate how to plot charts in ImJoy. For this, some data is generated -in a Pythons plugin andd displayed in a separate window. - -Here, we create an image (`.png`) in the Python plugin. This image is then send -to a window plugin and displayed there. Such an image is not restricted to simple charts, -and can thus also contain more complex data which can not be send by the plugin communicatino protocols. - - - - - -{ - "name": "Process Inline Hologram", - "type": "window", - "version": "0.0.2", - "api_version": "0.1.2", - "description": "Sending Image to the IMJOY plugin to backpropagate it into the sample plane.", - "tags": [], - "ui": [ - "Distance to the sensor plane: {id:'z_dist', type: 'number', min: 0, placeholder:1e-3}" - ], - "inputs": null, - "outputs": null, - "flags": [], - "icon": "swap_horiz", - "env": null, - "requirements": [ - "https://unpkg.com/spectre.css/dist/spectre.min.css", - "https://unpkg.com/spectre.css/dist/spectre-exp.min.css", - "https://unpkg.com/spectre.css/dist/spectre-icons.min.css" - ], - "dependencies": [] -} - - - - - - -
- -
-
- -

-
-
- - -
- -
- -
- - -
- -
-
-
- - diff --git a/SOFTWARE/IMJOY/update_manifest.js b/SOFTWARE/IMJOY/update_manifest.js deleted file mode 100755 index 17a57173..00000000 --- a/SOFTWARE/IMJOY/update_manifest.js +++ /dev/null @@ -1,85 +0,0 @@ -var https = require('https'); -var fs = require('fs'); - -var childProcess = require('child_process'); - -function runScript(scriptPath, callback) { - // keep track of whether callback has been invoked to prevent multiple invocations - var invoked = false; - - var process = childProcess.fork(scriptPath); - - // listen for errors as they may prevent the exit event from firing - process.on('error', function (err) { - if (invoked) return; - invoked = true; - if(callback) callback(err); - }); - - // execute the callback once the process has finished running - process.on('exit', function (code) { - if (invoked) return; - invoked = true; - var err = code === 0 ? null : new Error('exit code ' + code); - if(callback) callback(err); - }); - -} - - -function downloadScripts(){ - return new Promise((resolve, reject)=>{ - https.get("https://raw.githubusercontent.com/oeway/ImJoy/master/web/src/pluginParser.js", (response)=>{ - if(response.statusCode == 200){ - var file = fs.createWriteStream( './pluginParser.js'); - var code = '' - response.on('data', (d) => { - code = code + d.toString() - }); - response.on('end', () => { - code = code.replace('export function', 'function') - code = code + '\nexports.parseComponent = parseComponent;' - file.write(code); - file.close(()=>{ - https.get("https://raw.githubusercontent.com/oeway/ImJoy/master/web/src/buildManifest.js", (response)=>{ - if(response.statusCode == 200){ - var code2 = '' - response.on('data', (d) => { - code2 = code2 + d.toString() - }); - response.on('end', () => { - var file = fs.createWriteStream( './buildManifest.js'); - file.write(code2); - file.close(resolve); - }) - } - else{ - reject(response.statusCode) - } - - }).on('error', function(err) { // Handle errors - reject(err.message); - }); - }); - }) - } - else{ - reject(response.statusCode) - } - - }).on('error', function(err) { // Handle errors - reject(err.message); - }); - }) -} - -downloadScripts().then(()=>{ - runScript('./buildManifest.js', ()=>{ - fs.unlink('./pluginParser.js', ()=>{}) - fs.unlink('./buildManifest.js', ()=>{}) - }) - -}).catch((err)=>{ - console.error(err) - runScript('./buildManifest.js') -})