Skip to content

Instantly share code, notes, and snippets.

View beigelk's full-sized avatar

Kat(herine) Beigel beigelk

View GitHub Profile
@darencard
darencard / imagej_macros_scale_png.md
Last active February 26, 2024 17:53
ImageJ macro to automate scale bar addition using command line

Overview:

Below is a ImageJ macro that will read a user-provided image file, add a scale bar, and then output a PNG image. The user must specify two arguments, the input file and the output file, as one quote-enclosed argument (see example below). The scale bar characteristics have been hard coded and can be changed by hand, or the script can be modified to allow argument specifications.

This macro is designed to be called from the command line using the ImageJ executable. With my Mac OSX computer running Fiji, the path is /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx. This has not been tested elsewhere and may not work without some effort. It relies on the Bio-Formats plugin to read the file and was written to convert from Zeiss's .czi files, so no guarantee that it works with others as desired. It is especially important to note that this does not set the scale, but infers it based on the metadata stored in the .czi files. Therefore, it will probably not work well with other file types.

If y

@nk-gears
nk-gears / appsScript_ListFilesFolders_Mesgarpour.js
Created November 16, 2016 16:35 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
@sparkalow
sparkalow / list-files-in-folders.gs
Created September 21, 2016 17:42
Google Apps Script to recursively list files in a folder
/*
Recusrsively add a list of files from a named foler to a sheet
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var searchMenuEntries = [{
name: "Create List from Folder",
functionName: "start"
}];
@tommilligan
tommilligan / ImageJ TomMs Microbio Macros
Last active February 27, 2024 14:23
ImageJ Macros for uniformly cropping, adding scalebars and resizing PCM images [m] & uniformly cropping and renaming photos [s].
// This file is distributed under the terms of the GNU GPL v2
// ImageJ macros file
// To install these to your ImageJ program temporarily:
// - Plugins > Macros > Install... (Ctrl-Shift-M)
// To install these to your ImageJ program permenantly:
// - Find the "StartupMacros.txt" file on your computer
// - e.g. C:\Program Files (x86)\ImageJ\macros\StartupMacros.txt (Windows)
// - e.g. /Applications/ImageJ/macros/StartupMacros.txt (Mac)
// - Copy and paste the contents of this file at the end of StartupMacros.txt