by Isabel D’Alessandro and Emily Kellogg
Registering a Light-Level Stack to a Standard Template Brain #
You can use CMTK to register your light-level confocal stack to a standard Drosophila template brain. Follow the instructions here to install the CMTK Registration GUI Fiji plugin. The Fiji GUI seems only to work on Linux (and not on Windows), so you can use a Linux virtual machine to run this GUI. Alternatively, if you install CMTK on your Windows system (see forum discussions here and here for how to do this), you can run the same programs from the command line. There is a guide on Google Drive that is linked here.
Using the CMTK Registration GUI Plugin #
Assuming you are using the CMTK Registration GUI Fiji Plugin, I recommend setting up a Registration folder with the following subfolders:
- Commands: (this is where the command scripts generated by the Fiji plugin will go. You’ll need to run these scripts to complete the registration)
- Images: This is where your light-level images to be registered will go
- Refbrain: This is where the standard brain templates will go
- Reformatted: This is where registered/reformatted versions of your light-level images will go
- Registration: this is where the registration files generated by CMTK will go
- Registration_text_files: this is where I place only the .txt registration files generated by CMTK
There are a number of standard brain templates that you can download and use for your registration. For example, FCWB, JFRC2013, JFRC2010, and JFRC2018U are templates you can use. Here is a link to a Refbrain zip folder. Additional templates are available here. Places the template(s) that you want to use for your registration in the Registration/Refbrain folder.
Using the Plugin to perform the Registration #
- Be sure to rotate your light level image so that it is roughly oriented correctly (anterior side at the beginning of the stack/brain is not tilted).
- In Fiji, take your light level image and split the channels using Image → Color → Split Channels. Save your nc82/reference channel (you can also save the other channel(s), up to 2) as a .nrrd file. Place this file in the Registration/Images folder.
- There is a specific naming convention that this program uses. Name your nc82/reference channel whatever you’d like but be sure to add _01.nrrd to the end of the file name (i.e FC2C_AD_DBD_01.nrrd). This will tell the program what channel is what. If you want to include other channels that have labeling you will use _02.nrrd or _03.nrrd.
- I also recommend putting both the reference channel and the other channel(s) into 1 folder, you can name this whatever you want but I recommend including the cell type, genotype, and a way to know which confocal stack you used.
- Launch the CMTK Registration GUI. It will pull up a window where you will be asked to provide your input directories. Choose the larger Registration folder as the ‘Registration Folder’. Choose your desired reference brain from the Registration/Rebrain folder as the ‘Reference Brain’. Choose the reference channel of your stack in the Registration/Images folder as the ‘Input Image or Image Directory’. Under the Registration Actions section, leave all boxes checked. Under the Reformat Channels section, leave all boxes checked. For the Registration Parameters section, select ‘Cachero, Ostrovsky 2010’. For the Action section select ‘Write Script’. Then click OK.
- Above are directions just to create a registration file that you can apply to traced neurons from your image. If you want to actually reformat your light level images then leave the boxes checked under the Reformat Channels section. The number of checked boxes will depend on how many channels you have.
- The CMTK Registration GUI will generate a command script in the Registration/commands folder. Run this script in the terminal.
- After the script has finished running your registration, within the Registration/Registration folder, you should see two folders: affine and warp. These are different methods of registration. You can take a look at both and see which looks better for your purpose. I typically use the warp registration. Within the warp directory (or affine directory), you will see a subfolder with a name based on your image and reference brain. Within this directory, you should see a file called registration.gz. Click on this folder to unzip it. You should see a .txt file called registration.txt. Save this text file to the Registration/Registration_text_files folder.
- You can choose to apply this registration to a skeleton of your neuron of interest (see below) or you can use the reformatted files to compare to quickly compare to hemibrain/Flywire neurons in Fiji.
Applying the Registration to your Image #
If you want to convert the neuron(s) in your image into a neuron object to be used with natverse tools, you first need to skeletonize the image. This can be done manually using the Simple Neurite tracer Fiji plugin or automatically using one of a number of automatic skeletonization tools. Save this skeleton as a .swc file and read it into R using:
neuronTracing <- read.neuron(neuronTracing_file,class=“neuron”)
Read your .txt registration file into R using:
x <- as.cmtkreg(registration)
Then, apply the registration to your neuron object using:
registeredNeuron <- xform(neuronTracing, x)
If instead, you want to apply the registration directly to your gfp channel, you can do this by using the cmtk registration function reformatx from the command line. Your command will look something like:
Path_to_reformatx -o path_to_desired_save_location –floating path_to_reference_nc82_image path_to_reference_template path_to_registration_file
/opt/local/lib/cmtk/bin/reformatx -o /Users/WilsonLab/Desktop/Registration/Reformatted –floating /Users/WilsonLab/Desktop/20201007_MBON32_R20B12AD_VT045150GDBD_2.2.nrrd /Users/WilsonLab/Desktop/Registration/Refbrain/JRC2018_UNISEX_38um_iso_16bit.nrrd /Users/WilsonLab/Desktop/Registration/Registration_text_files/registration
nat-tech#
nat-tech is a repository on GitHub that aims to automate the process of applying a registration to a light level image. All you have to do is create folders on the server (i.e unprocessed and processed) and place un-registered confocal .tif files in the unprocessed folder. These images are then automatically registered, co-plotted with their hemibrain counterparts. The documentation and code for this repository is here.
This Github repository was created by Emily Kellogg and Alexander Bates