Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bradyajohnston/bulknd2totif


https://github.com/bradyajohnston/bulknd2totif

Last synced: 12 days ago
JSON representation

Awesome Lists containing this project

README

        

# Batch .nd2 to .tif converter
---
Depending on the software package used to control a particular microscope, .nd2 or .tif files are commonly created. The MASH-FRET analysis package for smFRET experiments requires .tif files for processing.

I wrote this simple ImageJ macro that:
1. Opens all of the `.nd2` files in a given directory.
1. Saves an identically-named `.tif` file in the same location,
1. Operates on all sub-directories as well.

Simply point this at the folder where all of your movies are from the days experiments and wait for ImageJ to do the hard work for you.

```java
macro "Convert stk to TIF" {

//locate the main directory to be analyzed
dir=getDirectory("Select the directory");
setBatchMode(true)
ext_nd2 = ".nd2";
ext_tif = ".TIF";

///////////
count = 0;
countFiles(dir);
n = 0;
processFiles(dir);
//print(count+" files processed");

function countFiles(dir) {
list = getFileList(dir);
for (i=0; i0) {
selectImage(nImages);
close();
}

}
print("All files converted");
}
}

//-------------------------------------------------------------------------------------------------------------

function getSubstring(name, prefix, postfix) {
start=indexOf(name, prefix)+lengthOf(prefix);
end=start+indexOf(substring(name, start), postfix);
if(start>=0&&end>=0)
return substring(name, start, end);
else
return "";
}

```