Skip to content

Instantly share code, notes, and snippets.

caticoa3 / .block
Last active Jun 13, 2020 — forked from john-guerra/.block
GeoJson map of Colombia Municipios
View .block
license: mit
caticoa3 /
Last active May 26, 2020
app.index_string = '''<!DOCTYPE html>
<!-- Global site tag (gtag.js) - Google Analytics -->
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'UA-XXXXXX', 'auto');
caticoa3 /
Created Jun 29, 2018
Crops objects out of images. A mask that segments each object and the original image need to be provided.
# coding: utf-8
import os
import numpy as np
import cv2
from pathlib2 import Path
#import re
'''Run on Python2.7'''
image_dir = '../IllumCorr/'
caticoa3 /
Created Jun 29, 2018
Bash script to ignore save errors when processing multiple images from command line with Cell Profiler
n=1 #Image Set number to start processing batch
final_image=826 #Last Image Set number in your batch
cellprofiler -p ML/Batch_data.h5 -c -r -f $n -l $final_image |& tee log.txt #Here the output from terminal is save to log.txt.
while [ $? -ne 1 ]; do
#Parse log.txt file, extracting the image set # at which the error occurs
no_save_error_image=$(sed -n '/^.*ValueError:/{n;p}' log.txt | sed -n -e 's/^.Image # //p' | sed -n -e 's/, module SaveImages.$//p')
n_=$(($no_save_error_image + 1))
#Restart CellProfiler at the next image set
caticoa3 /
Last active Jun 15, 2018
Running ilastik at command line with two processors and targeted maximum of 2000MB of ram
LAZYFLOW_THREADS=2 LAZYFLOW_TOTAL_RAM_MB=2000 ~/Applications/ilastik-1.3.0-Linux/ --headless --project segmentation_0_corrected.ilp --raw_data IllumCorr/*.??.??/*/*CY3*IC.tiff --output_format tiff --output_filename_format {dataset_dir}/{nickname}_{result_type}.tiff --export_source="Simple Segmentation"