Package: nobrainer-zoo
Nobrainer-zooNobrainer-zoo is a toolbox with a collection of deep learning neuroimaging models that eases the use of pretrained
models for various applications. Nobrainer-zoo provides the required environment with all the dependencies for
training/inference of models. You needsingularity/apptainer(>= 3.7.x/1.0.x) ordockerto run the Nobrainer-zoo.InstallationWe highly recommend to create a separate environment for the nobrainer-zoo. You can use conda or python to create the environment.conda create -n nobrainer-zoo python=3
conda activate nobrainer-zooorpython3 -m venv /path/to/new/virtual/environment/nobrainer-zoo
source /path/to/new/virtual/environment/nobrainer-zoo/bin/activateThen install the nobrainer-zoo:[Releases]    pip install nobrainer-zoo
[Dev version] pip install https://github.com/neuronets/nobrainer-zoo/archive/refs/heads/main.zipAfter installation, Nobrainer-zoo should be initialized. It also needs a cache folder to download some helper files based on your needs. By default, it creates a cache folder in your home directory (~/.nobrainer). If you do not want the cache folder in yourhomedirectory, you can setup a different cache location by setting the environmental variableNOBRAINER_CACHE. run below command to set it.export NOBRAINER_CACHE=<path_to_your_cache_directory>since this environmental variable will be lost when you close your terminal session you need to run it next time or a better solution is, to add it to your~/.bashrcfile.
simply open the file with your text editor and add the above line at the end. Restart your terminal or re-run yourbashrcfile by.~/bashrcto make this change effective.To initialize thenobrainer-zoorun:nobrainer-zoo init*Note: You need to initialize the nobrainer-zoo only once.Run help to see the functions and each function's options.nobrainer-zoo --help
nobrainer-zoo ls --help
nobrainer-zoo predict --help
nobrainer-zoo fit --help
nobrainer-zoo register --help
nobrainer-zoo generate --helpAvailable modelsTo see the list of available models in the nobrainer-zoo runnobrainer-zoo lsModels are added based on their organization, model name , and version. One model might have different versions. Some models (such askwykorSyntSR) have various types which means there was various training method or dataset that lead to different trained models. You can select the model type withmodel_typeoption for the train and inference.List of models which will be added in near future can be findhere. You can suggest a modelhere.Note: models are distributed under their original license.Inference ExampleInference with default options,nobrainer-zoo predict -m neuronets/brainy/0.1.0 <path_to_input> <path_to_save_output>

nobrainer-zoo register -m DDIG/SynthMorph/1.0.0 --model_type brains <path_to_moving> <path_to_fixed> <path_to_moved>pass the model specific options with--optionsargument to the model.nobrainer-zoo predict -m neuronets/brainy/0.1.0 <path_to_input> <path_to_save_output> --options verbose block_shape=[128,128,128]

nobrainer-zoo predict -m UCL/SynthSeg/0.1 <path_to_input> <path_to_save_output> --options post=<path_to_posteriors>Note: Nobrainer-zoo will use the gpu by default. So, if you want to force it to use the cpu while the gpu is available you need to pass--cpuflag. If you are using docker without any gpu passing the--cpuflag is a must. Otherwise, you will get an error.Note: If you are using docker make sure to use the absolute path for input and putput files.Train ExampleFor training with sample dataset you do not need to pass any dataset pattern.nobrainer-zoo fit -m neuronets/brainyTo train the network with your own data pass the dataset pattern in the form of tfrecords.nobrainer-zoo fit -m neuronets/brainy "<data_train_pattern>" "<data_evaluate_pattern>"Other parameters can be changed by providing a spec file or changing them with cli command.nobrainer-zoo fit -m neuronets/brainy --spec_file <path_to_spec_file>nobrainer-zoo fit -m neuronets/brainy --train epoch=2