Skip to content

Instantly share code, notes, and snippets.

View ajay1685's full-sized avatar

Ajay Zalavadia ajay1685

View GitHub Profile
%From TrackMate export the tracks as xml
xmlfile = 'Full path to the \Tracks.xml';
close all;
tracks = importTrackMateTracks(xmlfile);
%set track origin to zero cordinates
zeroTrackX = zeros(size(tracks{1,1}(:,2),1),size(tracks,1));
zeroTrackY = zeros(size(tracks{1,1}(:,2),1),size(tracks,1));
for i=1:1:size(tracks,1)
zeroTrackX(:,i) = (tracks{i,1}(:,2) - (tracks{i,1}(1,2)));
zeroTrackY(:,i) = tracks{i,1}(:,3) - (tracks{i,1}(1,3));
@ajay1685
ajay1685 / sendTelegramMessage.groovy
Created November 1, 2022 14:52
Telegram alerts from a QuPath script
//use BotFather to create a bot, BotFather can also provide API token for your bot
bot_token="0123456789:AaBcDeFGhxihUjCw6uiE9HED_lLuVy_dummy"
//Start a new chat and add your bot to the chat, get a chat_id for that chat
//More information about chat id at : https://www.alphr.com/find-chat-id-telegram/
new URL("https://api.telegram.org/bot"+bot_token+"/getUpdates").text //find chat id in the response
//use the chat id found above
chat_id= "-123456789"
@ajay1685
ajay1685 / UnInform.py
Last active October 5, 2023 16:38
Using pyvips to stitch component data images generated by inform
# -*- coding: utf-8 -*-
"""
This script is used for stitching the component_data.tif files generated by un-mixing workflow in inForm. This
script uses tifffile to read the metadata (Channel names & colors, spatial calibration and stage cordinates) from
input files. pyvips (libvips) is used to read the pixel data from image files and create a stitched image. The final stitched image is saved
in ome-tiff compatible format with minimal ome-xml.
Created on Wed Aug 22 15:53:08 2021
Modified on 2023-07-18: add resolution, channel names and channel colors to ome-xml. some code cleanup.
@author: Ajay Zalavadia (zalavadia.ajay@gmail.com)
"""
@ajay1685
ajay1685 / Merge-Channels-PyVips.py
Last active July 8, 2024 19:39
Merge channels and save as OME-TIFF using pyvips.
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 19 14:45:08 2021
@author: Ajay Zalavadia (zalavadia.ajay@gmail.com)_
"""
import math
import os
import glob
import logging