Posted by
Kenneth Sloan-2 on
Mar 05, 2018; 8:56pm
URL: http://imagej.273.s1.nabble.com/accessing-the-ImageStack-created-by-Linear-Stack-Alignment-with-SIFT-tp5020207p5020214.html
Answering my own question...
This seems to work:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ImageStack enFaceStack = ....create original stack...
ImageStack originalEnFaceStack = enFaceStack;
ImagePlus originalImagePlus = new ImagePlus("original", originalEnFaceStack);
IJ.run(originalImagePlus,
"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"
);
ImagePlus alignedImagePlus = WindowManager.getCurrentImage();
ImageStack alignedImageStack = alignedImagePlus.getImageStack();
for(int i=1;i<=alignedImageStack.getSize();i++)
alignedImageStack.setSliceLabel(enFaceStack.getSliceLabel(i)+" aligned",i);
enFaceStack = alignedImageStack;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This leaves a "log" window, and the "aligned n of n" window visible. I'll probably start using the "log" window for my own reporting, and I suppose I can make the "aligned n of n" invisible.
I'm not thrilled with depending on a global "current Image" to get a handle on the result of running a command, but I suppose this is necessary for scripting.
Thanks again for the response.
--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html