Package: yeastvision
YeastVisionA GUI-based framework for segmentation, tracking, time-series analysis of the full Saccharomyces cerevisiae lifecycle.Yeastvision can identify and track a single cell throughout all of the stages aboveKey FeaturesAgenerative video interpolation modelto increase time-series resolution up to 16xLoad, analyze, and segmentmultiple experiments containing numerous phase/flourescent channelsSegmentcytoplasm, vacuoles, buds, mating, and sporulating yeast cellsTrack and reconstruct lineagesof large cell coloniesExtract and plottime-seriesdata in the GUIInstallationLocal installation (< 2 minutes)System requirementsThis package supports Linux, Windows and Mac OS (versions later than Yosemite). GPU support is available for NVIDIA GPU's. A GPU is recommended, but not required, to runyeastvisionInstructionsIf you have an olderyeastvisionenvironment you should remove it withconda env remove -n yeastvisionbefore creating a new one.yeastvisionis ready to go for cpu-usage as soon as it downloaded. GPU-usage requires some additional steps after download. To download:Install anAnacondadistribution of Python. Note you might need to use an anaconda prompt if you did not add anaconda to the path.Open an anaconda prompt/command promptCreate a new environment withconda create --name yeastvision python=3.10.0.Activate this new environment by runningconda activate yeastvisionRunpython -m pip install yeastvisionto download our package plus all dependenciesDownload the weightsonline.Runinstall-weightsin the same directory as theyeastvision_weights.zipfileYou should upgrade yeastvision (packagehere) periodically as it is still in development. To do so, run the following in the environment:python-mpipinstallyeastvision--upgradeUsing YeastVision with Nvidia GPUAgain, ensure your yeastvision conda environment is active for the following commands.To use your NVIDIA GPU with python, you will first need to install the NVIDIA driver for your GPU, check out thiswebsiteto download it. Ensure it is downloaded and your GPU is detected by runningnvidia-smiin the terminal.Yeastvision relies on two machine-learning frameworks:tensorflowandpytorch. We will need to configure both of these packages for gpu usagePyTorchFirst, we need to remove the CPU version of torch:pip uninstall torchAnd the cpu version of torchvision:pip uninstall torchvisionNow installtorchandtorchvisionfor CUDA version 11.3 (Ensure that your nvidia drivers are up to date for version 11.3 by runningnvidia-smiand check that a version >=11.3 is displayed in the top right corner of the output table).conda install pytorch==1.12.0 torchvision==0.13.0 cudatoolkit=11.3 -c pytorchAfter install you can checkconda listforpytorch, and its version info should havecuXX.X, notcpu.TensorflowAll we need to do here is install the cuDNN package for tensorflow gpu usageconda install cudnn=8.1.0Common Installation ProblemsYou may receive the following error upon upgradingtorchandtorchvision:AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)This is solved by upgrading the charselt_normalizer package with the following command:pip install --force-reinstall charset-normalizer==3.1.0If you get a version error fornumpy, run the following commands:pip uninstall numpy; pip install numpy==1.24Run yeastvision locallyThe quickest way to start is to open the GUI from a command line terminal. Activate the correct conda environment, then run:yeastvisionTo begin, drag and drop a directory containing images, flourescence channels, and masks into the GUI.A single directory represents an experiment and will be added to a drop down at the top of the GUI after being loaded either through drag and drop, or the file dropdown.Multiple directories can be added, and you can toggle through experiments as you analyze them in the GUI.As you utilize GUI features, all GUI-generated labels and images will be stored in the experiment directory as .npz files. Deleting these files will result in a loss of this GUI-generated data.Directory Conventions: Ensure the GUI can parse your dataYeastvisionis hardcoded to recognize several standard conventions when loading an experiment directory:A directory must contain imagesto be analyzed but does not have to contain masksA single file within the directory should contain a single image only.All channel and mask types should be present in the same number of time points.All files should include an appropriate file extension, and file extensions should remain consistent across data typesNaming: Files should be named accordingly to their channel and mask type:Each data type in the directory should have a standard id to identify it.The id should directly follow the file extensionAny image that acts as a label should have_maskin the id.Ensure that distinct channels have distinct ids.Here is an example of an experiment with two time points, two channels, and two pre-generated labels, sorted by name:im001_channel1.tif, im001_channel2.tif, im001_mask1.tif, im1_mask002.tif, im002_channel1.tif, im002_channel2.tif, im002_mask1.tif, im002_mask2.tifGUI FeaturesSegmentationYeastvision contains models and tracking algorithms to analyze all stages of the yeast lifecyclePixel flow-based modelsModelSegmentsproSegproliferating cells (general cytoplasm segmentation)spoSegsporulating cellsmatSegmating cellsbudSegbud-necksConventional U-NET modelsModelSegmentsbudNETbud-necks (optimized for crowded conditions)vacNETvacuolesModel RetrainingLoad Training MasksSelect the model to be retrained from the mainscreen model dropdownClick Menu->Models->RetrainEnsure training data is correct and choose model suffix (default is date-time)Select hyperparameters (default should work for most use cases)Train the model, using terminal to gauge progress.The custom model will auto-run on the next available image in the training set, if there is not a mask already on this image.If you are happy with the new model, go to Menu->Models->Load Custom Models, and the model will be added to the model dropdown. Otherwise, retrain with new dataRetraining TipsTraining takes very long without a GPU even though it possible to retrain using only CPU.When you are initially producing a training set, leave some blank masks towards the end of the movie so that the training procedure has room to auto-runThe path to the new weights will be printed on the terminal.Ensure that the fullname of the retrained model is present in the weights filename upon trying to load it via the models menu. This ensures that GUI can associate the weights with the correct model architectureTimeseries analysis: interpolation, tracking, and plottingOptional: Interpolate images to increase resolution, generating intermediate frames that improve tracking accuracySegment and track the interpolated frame. Tracking automatically generates a cell data table that includes various morphological and image properties of each cell over each frame in the movie.Optional: reconstruct proliferating cell lineagesRemove interpolated frames from the mask, so that only frames present in the original movie exist in the final tracked movieProduce some initial plots of the data using the 'show plot window' button. This will allow you to view single cell and population averages over time.Keyboard ShortcutsCommandFunctionup/downscroll through channnelscntrl + up/downScroll through labelsright/left arrowsscroll through timeseriescntrl + right/leftscroll through timeseries by 3Ooutline DrawingBbrush DrawingEeraser.increment brush size,decrecement brush sizeDelete/BackspaceDelete Selected Cellcshow current label contoursftoggle probability (if present)space bartoggle mask displaypshow plot windowTroubleshooting: Common ProblemsProblemSolutionCannot scroll through images/masks on the displayClick on the display to bring focus back to this widgetLoaded images without masks but cannot drawAn existing label must be present to draw: Add a blank label with File -> Add Blank Label