Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradyajohnston/bulknd2totif
https://github.com/bradyajohnston/bulknd2totif
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bradyajohnston/bulknd2totif
- Owner: BradyAJohnston
- Created: 2020-03-16T12:39:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-16T12:42:01.000Z (over 4 years ago)
- Last Synced: 2024-10-07T05:21:06.819Z (about 1 month ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 "";
}```