First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection of scripts mostly from Pete, but also taken from the forums. Note you can always run a saved classifier using the | |
runClassifier() command, with the file path included as a string. | |
TOC | |
A simple cell classifier.groovy - One way to classify cells. | |
A simple classifier 2.groovy - Another way. | |
Annotation Classifications to Name field.groovy - Sets the Name of the annotation to its classification. Useful for applying a second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import ceil | |
"""from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
from PyQt5.QtWidgets import *""" | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
I recently built a small agent-based model using Python and wanted to visualize the model in action. But as much as Python is an ideal tool for scientific computation (numpy, scipy, matplotlib), it's not as good for dynamic visualization (pygame?).
You know what's a very mature and flexible tool for drawing graphics? The DOM! For simple graphics you can use HTML and CSS; for more complicated stuff you can use Canvas, SVG, or WebGL. There are countless frameworks, libraries, and tutorials to help you draw exactly what you need. In my case, this was the animation I wanted:
(Each row represents a "worker" in my model, and each rectangle represents a "task.")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def _html_repr_helper(contents, index=()): | |
dims_left = contents.ndim - len(index) | |
if dims_left == 0: | |
s = contents[index] | |
else: | |
s = ''.join(_html_repr_helper(contents, index + (i,)) for i in range(contents.shape[len(index)])) | |
return "<div class='numpy-array-ndim-{} numpy-array-ndim-m{}' title='[{}]'>{}</div>".format( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# change the package name to the existing PyPi package you would like to build and adjust the Python versions | |
pkg='whitebox' | |
array=( 3.5 3.6 3.7 ) | |
echo "Building conda package ..." | |
cd ~ | |
conda skeleton pypi $pkg | |
cd $pkg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code picked up from https://github.com/keras-team/keras/blob/master/keras/backend/tensorflow_backend.py | |
# Just used tf.nn.weighted_cross_entropy_with_logits instead of tf.nn.sigmoid_cross_entropy_with_logits with input pos_weight in calculation | |
import tensorflow as tf | |
from keras import backend as K | |
""" Weighted binary crossentropy between an output tensor and a target tensor. | |
# Arguments | |
pos_weight: A coefficient to use on the positive examples. | |
# Returns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* GROOVY SCRIPT COMPUTING ON THE FLY EDGES OF A LABEL IMAGE | |
* ----- | |
* - Computes a sample label image | |
* - Computes lazily with a disk cached cell img an image which finds the border of the labels in 3D | |
* - Displays both images in BigDataViewer | |
* | |
* Code to create the label image mainly copied from: | |
* - https://imagej.net/ImgLib2_Examples#Example_8_-_Working_with_sparse_data | |
* - And https://github.com/imglib/imglib2-cache-examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, asyncio, random, threading, datetime | |
from qtpy.QtWidgets import QApplication, QProgressBar | |
from asyncqt import QEventLoop, QThreadExecutor | |
app = QApplication(sys.argv) | |
loop = QEventLoop(app) | |
asyncio.set_event_loop(loop) | |
progress = QProgressBar() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qtpy.QtWidgets import ( | |
QPushButton, | |
QComboBox, | |
QTabWidget, | |
QHBoxLayout, | |
QFileDialog, | |
QDialogButtonBox, | |
QWidget, | |
QSlider, | |
) |