Dear Aaron,
Sorry for the delay on answering you. I was on holidays and I'm catching up
with my e-mail. I'm adding our conversation to the ImageJ list since it can
be of interest for more people.
If I understood well, you want to register all slices to a specific one and
save the transformations, is that it? I believe a script is the way to go
then. You can use your favorite scripting language among the available ones
(
http://fiji.sc/Scripting_Help). I usually script in Beanshell because it's
basically Java without the type declarations.
If you want to do it with Register Virtual Stack Slices, have a look at the
example in the site:
http://fiji.sc/Register_virtual_stack_slices#Scripting_.2F_PlugInYou could do the same but within a loop for each slice. The only problem
would be to have different input and output folder per slice, what can be
cumbersome.
You can also script bUnwarpJ, doing something like this:
import bunwarpj.*;
import ij.IJ;
reference = "/home/myUser/myReferenceImage.tif"
slices = new String[]{ "/data/slice-001.tif", "/data/slice-002.tif",
"/data/slice-003.tif"};
// open target image
target = IJ.openImage( reference );
// default parameters
p = new Param();
for( i=0; i<slice.length; i++ )
{
// open source image
source = IJ.openImage( slices[ i ] );
// calculate transform (no masks)
warp = bUnwarpJ_.computeTransformationBatch( target, source, null,
null, p );
// save resuts
output1 = warp.getDirectResults();
output2 = warp.getInverseResults();
IJ.saveAsTiff( output1, "out-"+i+"-dir.tif" );
IJ.saveAsTiff( output2, "out-"+i+"-inv.tif" );
}
Let me know if you need more help!
ignacio
On Thu, Jan 1, 2015 at 7:30 PM, Aaron Andalman <
[hidden email]>
wrote:
> Dear Ignacio,
>
> I'm interested in using register virtual stack slices, but instead of
> registering adjacent slices, I'd like to register each slice of the stack
> with a single low noise reference image using bunwarpJ. I'm an experienced
> developer, but I'm never scripted for FIJI, thus I was hoping to get your
> advice.
>
> Would it be practical to modify Register Virtual Stack Slices (and
> Transform Virtual Stack Slices) to have this functionality? Or would I be
> better off writing my own Macro? Is it preferable to script in Java with
> Fiji, or is python or ijm workable. I'd still like to be able to save out
> the transforms and then apply then to other stacks if possible.
>
> Happy new year.
>
> Thanks for your advice,
> Aaron
>
> --
> Ignacio Arganda-Carreras, Ph.D.
> Seung's lab, 46-5065
> Department of Brain and Cognitive Sciences
> Massachusetts Institute of Technology
> 43 Vassar St.
> Cambridge, MA 02139
> USA
>
> Phone: (001) 617-324-3747
> Website:
http://bioweb.cnb.csic.es/~iarganda/index_EN.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html