Big Stitcher - trying to understand XML file

Hello,

I am using Big Stitcher to stitch a large 3D image. After stitching, an XML file is created. In that file each image is associated with 3 vectors called, Translation to Regular Grid, Stitching Transform, and Calibration. I would like to understand how to use these vectors in order to fuse the images myself in python using the parameters mentioned previously from the XML file. Any help here is appreciated. A snapshot of a sample XML file is below.

Thanks,
Corey Elowsky

@coreyelowsky_CSHL,

Welcome to the forum.

The vectors there are the “upper” 3 x 4 part of an affine transform matrix in homogeneous coordinates.

The vector is [v1, v2, v3, ... v12] corresponds to the matrix:

v1  v2  v3  v4
v5  v6  v7  v8
v9 v10 v11 v12
0    0   0   1 

Please think carefully about whether it’s really worth reimplementing fusion…it’s complicated, and if you want to implement it yourself, it will be a lot of work.

If you’re really set on doing it, the code is open source, so the way to understand what you need to do for fusion, is to understand the code.
E.g. here is a starting point to get into the fusion code.

John

1 Like

John,

Thanks for your quick response! After thinking it over I guess I don’t really need to implement fusion myself. However, I still need to be able to take a given pixel coordinate and obtain its stitched coordinate so that I can specify a proper bounding box for Big Stitcher’s fusion. In order to do this, do I simply matrix multiply my pixel coordinate with all three affine matrices (Stitching Transform, Translation to Regular Grid, Calibration) in the XML file? Or is there some other way to obtain a given pixel’s coordinate after stitching?

Thanks,
Corey Elowsky

1 Like

Hi Corey (@coreyelowsky_CSHL),

@hoerldavid or @StephanPreibisch will know the answer exactly, but I’ll fill in where I can.

If you know approximately how much your images moved (from looking at them in the bigstitcher window), you may be able to infer which transformations to use. It’s “relatively” easy in your case since the transforms are translations (except for calibration). In this context “Calibration” is the transformation from pixel to physical units.

John

Hi, by default BigStitcher puts a Bounding Box around all views you selected … so just select the views you want to fuse and the Bounding Box will be there. You can define it independently as well. Does this help? What do you want to achieve?

All the best,
Stephan

1 Like

Stephan,

Thanks for the response. Unfortunately, selecting and fusing entire views has proven to be too time consuming for our application as we are dealing with large image stacks. My goal is to be able to take a single vocal location and obtain its post-fusion coordinates by using the parameters from the XML file, so that in turn, I can define my own smaller bounding box surrounding that one voxel. (All of this being done through macros). I have tried applying all three affine matrices (translation to regular grid, stitching transform, and calibration) to a single voxel, but it doesnt seem to output the correct coordinates in the fused image.

Thanks,
Corey Elowsky

I figured it out! I was applying the transformation matrices in the incorrect order. I didn’t realize I needed to apply the calibration matrix first. Thank you for your help!

Corey Elowsky

1 Like