Image_registration_1 macro
Relevant to Figure 2; Extended Data Figure 5, 6
This ImageJ macro registers individual 2P imaging fields to the post-hoc IMHC using one of the IMHC channels. The macro uses bUnwarpJ for registration.
The macro requires a 2P recording/z-projected 2P recording and the IMHC image.
The 2P image can be upsampled with the "Scale..." function in ImageJ to match the scaling of the confocal image. This will preserve the resolution of the confocal image after registering the the 2P image.
Parameters to change:
- path: choose where you want to save the output
- twoPtype: set to true if you are using a z-projected 2P recording, set to false if you are using a raw 2P stack
- regchannum: the channel number of the registration channel in the IMHC image (RBPMS channel in these images)
- regchan: the name of the antibody and fluorophore of the registration channel for naming purposes
- pixels_permicron: set to the scaling used (match the confocal image)
bUnwarpJ parameters:
- Set the IMHC image as the source and the 2P image as the target
- Set Initial and Final Deformation to "fine"
- Set landmark weight to be 1 and image weight to be 0 (this means bUnwarpJ only uses landmarks to register the 2 images)
- Tick the 'Save Transformations' box
- Save landmarks (YYYYMMDD_[imageID]_landmarks)
Output:
- Reg_source image: IMHC image registered to 2P image. This image is used in the analysis
- Reg_target image: 2P image registered to the IMHC image. This is not used.
- direct_transf txt file: transformation file used to register IMHC image to 2P image. Used in Image_registration_2
- inverse_transf txt file: transformation file. This is not used.