// config file, the commnets have to be removed before using it as json, for example with the included load json function
{
    "general_config": {
        "model": "gan", // pix2pix | cyclegan, GAN model to use
        //"comment": "", // comment to the configuration TODO:not used currently
        "network_G": "unet3d", // unet3d | unet3dfull | densenet3d | resnet_6blocks | resnet_2blocks | resnet_9blocks | RRDBNet3D_8blocks, generator network type
        "norm_layer": "instancenorm", // batchnorm | identity | instancenorm, identity is no normalization at all
        "use_sigmoid_G": true, // use Sigmoid for pix2pix as last layer or if false use tanh as last layer, it helps if the input is scaled accordingly
        "drop_rate": 0, // use dropout layers in network if drop_rate > 0
        "upmode": "pixelshuffle", // pixelshuffle | interpolation | transposedconv, which upscaling layer to use
        "num_downs": 5, // used in unet3d to define the number of downsampling layer, minimum is 2
        "ngf": 24, // number of filters in last layer of the generator, used in unet3d, unet3dfull, resnet_2blocks, resnet_6blocks, resnet_9blocks
        "scale_factor": 0, // scale the image up at the end of the generator network for downscaled generation to get the original size (only in pixpix with unet3d)
        "network_D": "n_layers", // basic | n_layers | pixel, Discriminator Network, PatchGAN basic or with n layers or pixel GAN with discrimination for every pixel
        "ndf": 64, // number of filters in the last layer of the discriminator
        "n_layer_D": 4, // the number of convolutional downsampling layers in the discriminator
        "save_path": "./", // root save path
        "data_path": "", // root data path
        "test_data_path": "", // root test data path
        "train_list_path": "", // path to the file list for training
        "test_list_path": "", // path to the file list for testing
        "fid_config": "",
        "regex_splits": [
            ".*plant1_.*", 
            ".*plant2_.*", 
            ".*plant4_.*", 
            ".*plant13_.*", 
            ".*plant15_.*", 
            ".*plant18_.*"
        ], // regular expression by witch the train list can be split into train and validation list
        "split_indx": [
            0,
            1
        ], // split the training list into train and validation list by choosing index from regex_splits or if -1 choose randomly
        "batch_size_train": 3,
        "batch_size_test": 7,
        "print_freq": 600, // how often should training results be saved in iterations
        "print_networks": true, // print the network architectures
        "save_epoch_freq": 100, // how often should the trained models be saved
        "gpu_ids": [
            0
        ], // gpus to use by id in list
        "lambda_identity_A": 0, // identity loss wheight for cycleGAN forward
        "lambda_identity_B": 0, // identity loss wheight for cycleGAN backward
        "lambda_gp": 0, // gradient panelty wheight
        "lambda_pixel" : 0, // pixel loss wheight for pix2pix model       
        "GANLoss": "vanilla", // GAN loss mode vanilla | lsgan | wgangp
        "pixel_loss": "MSE", // pixel loss mode for identity | cycle and pix2pix loss L1 | MSE | BCE, BCE needs correctly scaled outputs
        "RaSGAN": false, // use realative GAN loss if desired
        "pool_size": 10, // image pool size for the discriminator
        "epochs": 160, // epochs with fixed learning rate if lr_policy linear or simply the epochs
        "lr_policy": "linear", // learning rate policy linear | step | plateau | cosine
        "epochs_decay": 60, // epochs with decaying learning rate for lr_policy linear
        "lr_decay_iters": 20, // decay learning rate every lr_decay_iters for lr_policy step
        "learning_rate": 0.00015,
        "betas": [
            0.5,
            0.999
        ], // the betas for Adam optimizer
        "direction": "AtoB", // direction for the image generation
        "isTrain": false, // train or load model from saved models
        "evaluate": true, // evaluate or not
        "cross_val": false, // cross validate over plants, evaluate is turned on automatically and test is turned off
        "evaluate_whole": true, // evaluate on whole images or not
        "val_freq": 0, // how often should the performance be evaluated inside training ,in iterations, 0 means never
        "test": true, // test or not
        "overlap": 32, // overlap for evalution of whole images patchwise
        "overlap_mode": "fade", // overlap mode: "fade" overlapping regions or "crop"
        "pad_crop": 16, // pad before evaluating to reduce distortion on edges and crop after
        "percent_black": 0, // give the network x percent empty images to regularize the network
        "load_from": "", // load networks from saved networks and continue training or evaluation
        "inception_metric_layer": "ReLU-15",  // the intermediate layer from which inception scroes like FID or LPIPS are computed
        "eval_metrics": [
            //"NCC_3ch",
            "NCC_1ch",
            //"ZNCC_3ch",
            "ZNCC_1ch",
            "SSIM_1ch",
            //"SSIM_3ch",
            //"PSNR_3ch",
            "PSNR_1ch",
            "MSE_1ch"//,
            //"MSE_3ch"
        ], // metrics to use when evaluating
        "augmentation": {
                        "scales": [
                            0
                        ], 
                        "rotations": [
                            0,
                            1,
                            2
                        ], 
                        "mirroring": 0.5
        }
    },
    "image_config": {
        "shape": [
            128,
            128,
            128
        ], // shape of the image patches for patchwise generation
        // "scale_level" : 3, // for dowsampled generation, 0 is full size and 3 is original size divided by 2^scale_level
        "grayscale": true, // is it grayscale or colored
        // "shuffle_both": true, // shuffle both the mask and image list seperately for cyclegan, the use of this is not verified
        // "divisible_by": 32, // pad the input image so it fits through the network by making its shape divisible_by
        // "percent_not_empty": 0.001, // avoid black training images by forcing at least something in the image when loading
        "load_fcn": "", // define loading function by string has to be loaded in the python script
        "axes_order": [
            3,
            2,
            1,
            0
        ], // to reorder the axes as desired 
        "transforms": {
            "fcn": [
                "normalization"
            ],
            "norm_method": "scale",
            "max_val": 32768
        } // transformation like normalization, scaling, rotation ..., take a look at the implementation or define your own functions
        // "transforms": {
        //                 "fcn": [
        //                     "normalization"
        //                 ],
        //                 "norm_method": "minmax",
        //                 "max_val":32767,
        //                 "min_val":0,
        //                 "feature_range": [
        //                    -1,
        //                     1
        //                 ]
        // } // minmax normalization to fit range [-1,1]
        //"transforms": {
        //                "fcn":[
        //                   "normalization"
        //               ],
        //                "norm_method": "meanstd_data" 
        //} // Standardization as normalization
    },
    "mask_config": {
        "shape": [
            128,
            128,
            128
        ], // shape of the image patches for patchwise generation
        // "scale_level" : 3, // for dowsampled generation, 0 is full size and 3 is original size divided by 2^scale_level
        "grayscale": true, // is it grayscale or colored
        "dist_trans": true, // add the distance transformation of the mask image as wheight map for the cycle loss of the mask
        // "shuffle_both": true, // shuffle both the mask and image list seperately for cyclegan, the use of this is not verified
        // "divisible_by": 32, // pad the input image so it fits through the network by making its shape divisible_by
        // "percent_not_empty": 0.005, // avoid black training images by forcing at least something in the image when loading
        "load_fcn": "", // define loading function by string has to be loaded in the python script
        "axes_order": [
            3,
            2,
            1,
            0
        ]//,// to reorder the axes as desired 
        // "transforms": {
        //     "fcn": [
        //         "get_boundaries"
        //     ],
        //     "mode": "inner"
        // } // transformation like normalization, scaling, rotation ..., take a look at the implementation or define your own functions
    }
}