Skip to content

Instantly share code, notes, and snippets.

caticoa3

Block or report user

Report or block caticoa3

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
@caticoa3
caticoa3 / contour_crop.py
Created Jun 29, 2018
Crops objects out of images. A mask that segments each object and the original image need to be provided.
View contour_crop.py
# 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
caticoa3 / ignore_CP_save_erros.sh
Created Jun 29, 2018
Bash script to ignore save errors when processing multiple images from command line with Cell Profiler
View ignore_CP_save_erros.sh
#!/bin/bash
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
caticoa3 / ilastik_run.sh
Last active Jun 15, 2018
Running ilastik at command line with two processors and targeted maximum of 2000MB of ram
View ilastik_run.sh
LAZYFLOW_THREADS=2 LAZYFLOW_TOTAL_RAM_MB=2000 ~/Applications/ilastik-1.3.0-Linux/run_ilastik.sh --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"
You can’t perform that action at this time.