In this demo, we will demonstrate how to get the segmentation of ATP2A2 in 3D fluorescent microscopy images of hiPS cells.
*Note: This demo only uses the classic segmentation workflow and thus does not require a GPU. See package aics-segmentation.
We recommend users starting by identifying a structure in the lookup table that looks the most similar to the segmentation task that you have. Once you have identified a structure, open the corresponding Jupyter Notebook and follow the instructions in the notebook to tune the workflow. After finalizing the algorithms and parameters in the workflow, modify batch_processing.py to batch process all images (file by file or folder by folder).
List of "playgrounds" for the lookup table:
- playground_st6gal.ipynb: workflow for Sialyltransferase 1
- playground_spotty.ipynb: workflow for Fibrillarin, Beta catenin
- playground_npm1.ipynb: workflow for Nucleophosmin
- playground_curvi.ipynb: workflows for Sec61 beta, Tom 20, Lamin B1 (mitosis-specific)
- playground_lamp1.ipynb: workflow for LAMP-1
- playground_dots.ipynb: workflows for Centrin-2, Desmoplakin, and PMP34
- playground_gja1.ipynb: workflow for Connexin-43
- playground_filament3d.ipynb: workflows for Tight junction protein ZO1, Beta actin, Non-muscle myosin IIB, Alpha-actinin-1, Alpha tubulin, Troponin I, and Titin
- playground_shell.ipynb: workflow for Lamin B1 (Interphase-specific)
In this example, ATP2A2 localizes to the nuclear periphery and ER tubules, very similar to Sec61B. Therefore we are starting with playground_curvi.ipynb
.
First, start your Jupyter Notebook App (make sure to activate your conda environment, see package aics-segmentation for details).
jupyter notebook
Now, Jupyter Notebook should have opened in your default browser and you can make a copy of playground_curvi.ipynb
to start working. Simply follow the instructions embedded in the notebook to tune the workflow for your image. (how to use a Jupyter Notebook?)
You can easily test your workflow on multiple images with batch processing following the steps below.
- Duplicate the template file in
/aics-segmentation/aicssegmentation/structure_wrapper/seg_template.py
and change name to/aics-segmentation/aicssegmentation/structure_wrapper/seg_atp2a2.py
- Open
seg_atp2a2.py
- Change the function name from
Workflow_template()
toWorkflow_atp2a2()
- insert parameters and functions at the placeholders. Meanwhile, make sure you
import
all the functions you want to use. You can checkseg_lamin_interphase.py
under structure_wrapper to see examples. - Save the file
- Run (make sure to use your own path and structure channel index)
batch_processing --workflow_name atp2a2 --struct_ch 1 --output_dir /path/to/output per_dir --input_dir /path/to/raw --data_type .czi
Or, you can also use these scripts (aicssegmentation/bin/run_toolkit.sh
for linux/mac, aicssegmentation/bin/run_toolkit.bat
)
The goal of the Jupyter Notebook "playground" is to design and assess the overall workflow on one or a couple of images. After applying on more images (ideally representing possible variations in the full dataset to be analyzed), we want to make sure the workflow works well on different examples.
If everything looks good, the script is ready for processing new data for analysis.
If the results are okay/aceptable on all images, but may need a little tuning (e.g., decreasing the cutoff value of filament_3d_wrapper
to be more permissive), you can adjust the paramters in seg_atp2a2.py
. You may need several rounds of finetuning of the parameters in batch mode to finally achieve the most satisfactory results on all representative images. You may not have to go back to the Jupyter Notebook file since the notebook is only meant to help you quickly test out the overall workflow and get reasonable parameters.
If the results are good on some images, but bad on others, or the results are only good on certain cells, you may consider use the iterative deep learning workflow to improve the segmentation quality. See demo 2 for details.