Skip to content

Instantly share code, notes, and snippets.

Philipp Hanslovsky hanslovsky

Block or report user

Report or block hanslovsky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View move-kotlin-files.sh
#!/usr/bin/env bash
ROOT_DIR="$HOME/workspace/paintera/paintera"
JAVA_SRC="$ROOT_DIR/src/main/java"
KOTLIN_SRC="$ROOT_DIR/src/main/kotlin"
cd $JAVA_SRC
FILES=$(find . -type f -name '*kt')
@hanslovsky
hanslovsky / cachged-image-example.kts
Created Jan 30, 2020
kscript example for how to create ImgLib2 cached cell images and show them in BDV
View cachged-image-example.kts
#!/usr/bin/env kscript
@file:MavenRepository("scijava.public", "https://maven.scijava.org/content/groups/public")
@file:DependsOn("sc.fiji:bigdataviewer-vistools:1.0.0-beta-11")
import kotlin.math.pow
import bdv.util.BdvFunctions
import bdv.util.volatiles.VolatileViews
import net.imglib2.Localizable
@hanslovsky
hanslovsky / error-message
Created Dec 17, 2019
syrnchronizing cell img access generation both on java and python
View error-message
Traceback (most recent call last):
File "jnius/jnius_proxy.pxi", line 156, in jnius.invoke0
Access is null, returning!
File "jnius/jnius_proxy.pxi", line 124, in jnius.py_invoke0
AttributeError: 'dict' object has no attribute 'invoke'
Traceback (most recent call last):
Access is null, returning!
File "jnius/jnius_proxy.pxi", line 156, in jnius.invoke0
File "jnius/jnius_proxy.pxi", line 124, in jnius.py_invoke0
AttributeError: 'dict' object has no attribute 'invoke'
@hanslovsky
hanslovsky / pyimagej-qt.py
Last active Dec 16, 2019
pyimagej-from-qt-thread
View pyimagej-qt.py
import time
def main():
import threading
ij = [None]
def start_qt_and_ij():
from PyQt5 import QtCore, QtWidgets
app = QtWidgets.QApplication([])
View count-locked-voxels.groovy
import java.util.concurrent.Executors
import javafx.application.Platform
import javafx.util.Duration
import net.imglib2.algorithm.util.Grids
import net.imglib2.util.Intervals
import net.imglib2.view.Views
import org.janelia.saalfeldlab.paintera.state.LabelSourceState
import org.janelia.saalfeldlab.paintera.state.label.ConnectomicsLabelState
@hanslovsky
hanslovsky / convert-cremi-mutex-watersheds-all.sh
Last active Nov 4, 2019
Evaluation of mutex watersheds for cremi and lauritzen
View convert-cremi-mutex-watersheds-all.sh
_convert() {
ITERATION=$1
SETUP=$2
THRESHOLD=$3
SAMPLE=$4
CONTAINER="/nrs/saalfeld/hanslovskyp/experiments/quasi-isotropic-predictions/affinities-glia/neuron_ids-unlabeled-unmask-background/predictions/CREMI/sample_${SAMPLE}.n5"
BASE_PATH="volumes/predictions/neuron_ids-unlabeled-unmask-background/${SETUP}/${ITERATION}"
if [ -z "${THRESHOLD}" ]; then
SOURCE="${BASE_PATH}/mutex-watershed-merged"
else
View make-paintera-movie.groovy
import javafx.application.Platform
import javafx.util.Duration
def sources = paintera.baseView.sourceInfo()
def properties = paintera.properties
def bookmarkConfig = properties.bookmarkConfig
Platform.runLater({ sources.currentSourceIndexProperty().set(1)})
def manager = paintera.baseView.manager()
def duration = Duration.seconds(5.0)
def bookmarks = bookmarkConfig.unmodifiableBookmarks
for (int i = 0; i < 6; ++i) {
View mutex-watershed.kts
#!/usr/bin/env kscript
//KOTLIN_OPTS -J-Xmx5g
@file:MavenRepository("scijava.public", "https://maven.scijava.org/content/groups/public")
@file:DependsOn("org.janelia.saalfeldlab:imglib2-mutex-watershed:0.1.0-SNAPSHOT")
@file:DependsOn("org.janelia.saalfeldlab:n5:2.1.1")
@file:DependsOn("org.janelia.saalfeldlab:n5-imglib2:3.4.0")
@file:DependsOn("org.apache.commons:commons-compress:1.18")
@hanslovsky
hanslovsky / PluginTest.kt
Created Sep 20, 2019
What's going on with scijava plugins in kotlin and Windows?
View PluginTest.kt
import org.scijava.plugin.Plugin
import org.scijava.plugin.SciJavaPlugin
@Plugin(type = SciJavaPlugin::class)
class PluginTest : SciJavaPlugin
You can’t perform that action at this time.