Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

# Instructions to run this on one sample:
# conda env create -n quant -f quantification.yml
# conda activate quant
# python quantification.py -M /path/to/cellMask.tif -in /path/to/Sample_01.ome.tif -o /path/to/output/ -ch /path/to/channel_names.csv -c 46
# <julia.casado@helsinki.fi>
import os
import argparse
from pathlib import Path
import csv
import time
% Crop TMA ome.tif into the already detected cores
% Quantify with already computed masks.
% /casado
basePath = 'D:\path\to\the\project\';
maskPath = 'segmentation';
maskFileName = 'cellRingMask.tif';
omePath = 'registration';
omeSuffix = '.ome.tif';
cropCoordsPath = 'dearray';
@jcasado
jcasado / File_Export.ijm
Created June 19, 2019 10:51
Fiji script to convert multipage TIFF files
// Prepare file formats for segmentation workflow: Ilastik + Cell Profiler + HistoCAT
// Input must be a folder with multipage TIFF files, one for each sample or core
// 19.6.2019 Julia and Nuppu
basePath = "/path/to/project/folder/";
coreStacks = "tiff/files/folder/";
for_histocat = "for_histocat/"; //Where to save Image sequences
for_ilastik = "for_ilastik/"; //Where to save .h5 files
import os
import pandas as pd
import cycifsuite.detect_lost_cells as dlc
import numpy as np
import time
import glob
from multiprocessing import Process, freeze_support
def processFile(fname, path_out, manual_threshold=None):
t = time.time()
@jcasado
jcasado / find_missing_cells_from_paired_masks.py
Created March 21, 2019 13:07
Given two masks for the same file with matching cell IDs, find cells missing in the second mask.
import glob
import os
import pandas as pd
import numpy as np
import time
import skimage.io
pathIn = "Z:/Connor/Topacio_P2_AF/ashlar"
pathOut= "D:/julia/cell_filter/"
@jcasado
jcasado / dearrayTMAtoROIs.m
Created October 25, 2018 15:30
TMA Dearraying
%% 1. Input using Bio-formats
% Read image into 3D array and resize to be easy to handle
filePath = "tma_big.tif";
image = bfOpen3DVolume(filePath);
image= image{1}{1};
nuclei = image(:,:,1);
imagesub = imresize(nuclei,0.02);
%% 2. Morphological operations