Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Manuel Nietert
AutoBuSTeD
Commits
5c63a2fe
Commit
5c63a2fe
authored
Jul 21, 2021
by
Manuel Nietert
Browse files
Added the ImageJ Fiji macro script for the alignment of images in a folder
parent
f784290b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Image Alignment/Sift_reg.ijm
0 → 100644
View file @
5c63a2fe
// visit all subfolders and run sift alignment
// on all images in a folder
//
// Paul Wuerzberg
requires("1.37e")
setBatchMode(true);
call("java.lang.System.gc");
dir = getDirectory( "Choose the Directory" );
openfolders(dir);
function openfolders(dir){
list = getFileList( dir );
x=0;
for ( i=0; i<list.length; i++ ) {
if (endsWith(list[i], "/"))
{
openfolders(dir + list[i]);
}
else{
x=1;
}
}
if (x==1){processFiles(dir);}
}
function processFiles(dir) {
list = getFileList( dir );
for ( i=0; i<list.length; i++ ) {
open( dir + list[i] );
}
run("Images to Stack", "name=Stack title=[] use");
run("Linear Stack Alignment with SIFT", "initial_gaussian_blur=1.60 steps_per_scale_octave=3 minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 maximal_alignment_error=25 inlier_ratio=0.05 expected_transformation=Rigid interpolate");
run("Stack to Images");
//myDir = some_dir+"align"+File.separator;
//File.makeDirectory(myDir);
for ( i = list.length - 1; i>=0; i-- )
{
//saveAs("Jpeg", some_dir + "align/" + list[i]);
saveAs("Jpeg", dir + "_alin_" + list[i]);
close();
}
close();
// gc after each round may be overkill
call("java.lang.System.gc");
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment