function downloadTrainedLD2HDCTCycleGANNet(url,destination)
% downloadTrainedLD2HDCTCycleGANNet Download the pretrained CycleGAN
% generator network that converts Low-Dose CT to High-Dose CT images. The
% model also includes the generator to train the inverse High-Dose CT to
% Low-Dose CT images and the corresponding discriminators.

% Copyright 2021 The MathWorks, Inc.

filename = 'trainedLD2HDCTCycleGANNet.mat';
netDirFullPath = destination;
netFileFullPath = fullfile(destination,filename);

if ~exist(netFileFullPath,'file')
    fprintf('Downloading pretrained Low-Dose to High-Dose CT CycleGAN network.\n');
    fprintf('This can take several minutes to download...\n');
    if ~exist(netDirFullPath,'dir')
        mkdir(netDirFullPath);
    end
    websave(netFileFullPath,url);
    fprintf('Done.\n\n');
else
    fprintf('Pretrained Low-Dose to High-Dose CT CycleGAN network already exists.\n\n');
end
end