informatics-isi-edu / synspy

Synaptic segmentation and visualization with fluorescence microscopy
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Add beam-splitter alignment matrix to Images #70

Closed karlcz closed 5 years ago

karlcz commented 5 years ago

We need a new column to track the alignment between the two color channels projected into the single TIFF image plane via the beam-splitter.

For now, we want to track the actual alignment matrix used by current registration methods, which is a bit obscure.

  1. The image is chopped into two volumes by slicing [:,:,0:1024] for the "synapse" or "green" channel and [:,:,1024:2048] for the "autofluorescence" or "red" channel.
  2. The microns-per-pixel scaling factors are applied to each axis to consider coordinates in micron space
  3. An affine transform moves the green channel into the red channel space.

Note 1: the "green" and "red" here refer to the detection filters, and do not correspond to RGB image packing formats. Conventionally, we would store the "green" channel first and the "red" channel second if we interleaved these into a single 2-channel TIFF stack.

Note 2: the matrix moves green into red because in actuality we apply these transforms to centroid coordinates of extracted features. If we want to produce an interleaved image, we would really want to invert the matrix and move red into green via resampling, to preserve the original green channel data while potentially degrading the autofluorescence data.

karlcz commented 5 years ago

done.