Pipeline Process - ActiveBrainAtlasPipeline/neuroglancer GitHub Wiki
Post CZI Creation Process
To install the software prerequisites, look here.. Or just use the installed virtual environment on ratto, basalis and muralis: source /usr/local/share/pipeline/bin/activate
Running any of these commands at high resolution, you will want to prefix each command with nohup
and put a '&' at the end of the command. That will make it run in the background and you can log out.
Run: python create_meta.py --animal DKXX
This will scan each czi file.
Extracts the tif meta information and inserts into the slide_czi_to_tif.
This will read the sections view in the database. This can be run before the QC section
below. Doing that will create some extra unused tifs, but that is not a problem.
Create tif files for channel 1.
Create png files for channel 1.
Repeat process for the other 2 channels when ready.
Muralis 40 jobs. This step is handled by java so parallelization is good.
Run tif2jp2.sh DKXX in programming/pipeline_utility/registration. This script runs Matlab so you must have a license. This will create jp2 files which CSHL uses.
After logging in, go to the Slides link in the Brain category.
Enter the animal name in the search box.
Under the PREP ID column, click the link of the slide you want to edit.
If the entire slide is bad, mark it as Bad under Slide Status.
If a scene needs to be marked as Bad, Out of Focus or the End slide, select the appropriate Scene QC.
If you mark it as Bad or Out of Focus, the nearest neighbor will NOT be inserted. Use the replicate tool to copy either the one before or the one after.
If you want to replicate a scene, choose the Replicate field and add an amount to replicate.
The list of scenes are listed near the bottom of the page.
When you are done, click one of the Save buttons at the bottom of the page.
After editing the slides, you can view the list of sections under the Sections link under Brain.
This will fill the directory of the full and low resolution files for channel 1.
Repeat process for the other 2 channels when ready.
View a couple thumbnails to determine how much rotation/flips to perform.
Run: python create_masks.py --animal DKXX
This will read the thumbnail directory and create masks in the DKXX/preps/masks/thumbnail_colored dir. You will need to go into that directory and check each mask to make sure the mask is covering only the necessary parts. If there is either tissue missing or the mask is too big do:
Use the black paintbrush to hide extra masking (the mask needs to be reduced)
Use the white paintbrush to make the mask bigger.
When you have checked all masks and they are good, rerun the create_mask.py program like this python src/create_masks.py --animal DKXX --final true This will create the black and white masks in DKXX/preps/masks/thumbnail_masked dir.
No need to use channel 2 or 3. It works solely on channel 1.
Run: python create_histogram.py --animal DKXX --channel 1 --single single
This will read the directory of the thumbnail resolution files for channel 1.
Create histogram for each files for channel 1.
Repeat process for the other 2 channels when ready.
The necessary rotation and flip parameters must be in the scan run table..
Be careful with the rotation and flip. To do a 90 degree right rotation requires rotation=1
View a few of the files in DKXX/preps/CH1/thumbnail_cleaned.
full resolution on ratto one channel takes 863 minutes. When it is finished, check file count
and make sure there are no small files, especially with high resolution.
Run: python create_elastix.py --animal DKXX
This will create the DKXX/preps/elastix directory and a subdirectory for each file pair.
The elastix dir will be used to align the other channels and the full resoltions.
This will use the DKXX/preps/elastix directory for the transformation parameters. It will then use PIL to do an affine transformation to do section to section alignment.
Run: python create_web.py --animal DKXX
This will use the DKXX/preps/CH1/thumbnail_aligned directory for source images. It will then use PIL to do an create web viewable images.
Add 8 bit normalized files from a brain with for i in *.tif; do new=$(echo "DK62.$i"); cp -vi $i /net/birdstore/Active_Atlas_Data/data_root/brains_info/masks/normalized/$new; done
Do the same with the thumbnail_masked dir
Run the src/masking/train-mask.py file to create a new model in: /net/birdstore/Active_Atlas_Data/data_root/brains_info/masks/mask.model.pth