Skip to content

Instantly share code, notes, and snippets.

Avatar
🔬
🔬👀📑🗃📊🏨🗄📇📖📝🎶📈📉📃🖍🔬🔬🏋🏻‍♂🚴🏻‍♂🚙👨‍💻🤷‍♂📸📺🎛🔭🔬💊🔐🍫🌸

Serdar Balcı sbalci

🔬
🔬👀📑🗃📊🏨🗄📇📖📝🎶📈📉📃🖍🔬🔬🏋🏻‍♂🚴🏻‍♂🚙👨‍💻🤷‍♂📸📺🎛🔭🔬💊🔐🍫🌸
View GitHub Profile
@sbalci
sbalci / AperioToQuPath.groovy
Created Jun 28, 2021 — forked from DanaCase/AperioToQuPath.groovy
Convert Exported Aperio Image Scope Annotations to QuPath Annotations
View AperioToQuPath.groovy
import qupath.lib.scripting.QP
import qupath.lib.geom.Point2
import qupath.lib.roi.PolygonROI
import qupath.lib.objects.PathAnnotationObject
import qupath.lib.images.servers.ImageServer
//Aperio Image Scope displays images in a different orientation
def rotated = true
@sbalci
sbalci / block.R
Created Jun 10, 2021 — forked from krlmlr/block.R
Block assigning to a variable more than once
View block.R
`<-` <- function(lhs, rhs, envir = parent.frame()) {
assign(as.character(substitute(lhs)), rhs, envir)
lockBinding(substitute(lhs), envir)
invisible(rhs)
}
@sbalci
sbalci / !Classifying objects in QuPath
Created Apr 13, 2021 — forked from Svidro/!Classifying objects in QuPath
Classification based groovy scripts for QuPath
View !Classifying objects in QuPath
Collection of scripts mostly from Pete, but also taken from the forums. Note you can always run a saved classifier using the
runClassifier() command, with the file path included as a string.
TOC
A simple cell classifier.groovy - One way to classify cells.
A simple classifier 2.groovy - Another way.
Annotation Classifications to Name field.groovy - Sets the Name of the annotation to its classification. Useful for applying a second
View my_pmpro_email_headers_admin_emails.php
<?php
/*
Add bcc for checkout emails
*/
function my_pmpro_email_headers_admin_emails($headers, $email)
{
//bcc checkout emails
if($email->template == "membership_expiring" || $email->template == "membership_expired")
{
//add bcc
@sbalci
sbalci / QuPath_cells_to_areas.groovy
Created Feb 24, 2021 — forked from petebankhead/QuPath_cells_to_areas.groovy
QuPath script to calculate areas (e.g. of tumor) based upon classified cells only
View QuPath_cells_to_areas.groovy
/**
* QuPath script to calculate areas (e.g. of tumor) based upon classified cells only.
*
* It works by using a distance transform applied to binary images generated from the
* objects of each class, and then assigns each pixel to the closest object.
*
* Having done this, new annotations are generated for these regions.
*
* WARNINGS!
* - This will remove *all* previous annotations & replace them with new annotations
@sbalci
sbalci / repo-reset.md
Created Jan 31, 2021 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
View !Making Measurements in QuPath
Collections of scripts harvested mainly from Pete, but also picked up from the forums
TOC
Accessing dynamic measurements.groovy - Most annotation measurements are dynamically created when you click on the annotation, and
are not accessible through the standard getMeasurement function. This is a way around that.
Affine transformation.groovy - access more accurate measurements for the affine transformation used in the image alignment (m5/m6+)
Alignment of local cells.groovy - check neighborhood for similarly aligned cells
@sbalci
sbalci / Git: Empty branch.md
Created Jan 5, 2021 — forked from blattmann/Git: Empty branch.md
Git: Create empty branch
View Git: Empty branch.md

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@sbalci
sbalci / Subfolder to git repo.md
Created Jan 2, 2021 — forked from cruftlord/Subfolder to git repo.md
Convert subfolder into Git submodule
View Subfolder to git repo.md
View my-pmpro-redirect-to-levels-after-register.php
<?php
/**
* This recipe will redirect you to the levels page after registration
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_redirect_after_register( $user_id ){