Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • f99a844
  • /
  • scriptsMatlab
  • /
  • tomatoMatlab.m
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:7ac4862552ea7629c32f4c7c57c4cb87cfa17264
directory badge Iframe embedding
swh:1:dir:085f573e771a55838794d0455a574f42ea282f07
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
tomatoMatlab.m
% To use tomato you need two things:
% 1. tomato executable
% 2. configuration file in yaml. 
%	a. yamlmatlab allows you to read yaml to a structure and write a
%	structure to yaml
%   b. the best way to start with the config files is to read a template
%   yaml file
%   c. define/modify parameters in the structure
%   d. save structure to a yaml file
% Then, using matlab 'system' command you can run tomato from matlab. Voila!
%
% Hint: look at the output of the tomato executable to see what options are
% available in the yaml config file
%
% Konrad Werys 2018
% konrad.werys@cardiov.ox.ac.uk

clear 

%% 1. what is the path to the tomato exacutable?
% exepath = 'TomatoExe_v0.1_Windows_x64.exe'; % downloaded from github on windows
exepath = '../cmake-build-release/TomatoExe'; % build from clion on macos

%% 2.a. add yaml reading and writing lib to path
addpath(genpath('../thirdparty/yamlmatlab'));

%% 2.b. the best way to start with the config files is to read a template yaml file and modify it (2.c.)
template_yaml_file = '../tests/testData/Hcmr_Phantom_1916_Shmolli_192i_e11_inputDirs.yaml';
YamlStruct = yaml.ReadYaml(template_yaml_file);

%% 2.c. define/modify params in the structure. Input params are obligatory for calculation, the rest are optional. 

% %%% input params %%%
YamlStruct.dir_magnitude = '../tests/testData/dicom/Hcmr_Phantom_1916_260C/Konrad_Shmolli/ShMOLLI_192i_e11_12';
YamlStruct.dir_phase = '../tests/testData/dicom/Hcmr_Phantom_1916_260C/Konrad_Shmolli/ShMOLLI_192i_e11_13';
% YamlStruct.files_magnitude = '';
% YamlStruct.files_phase = '';

% % %%% output params %%%
% YamlStruct.dir_output_map = 'map';
% YamlStruct.dir_output_fitparams = 'fitparams';
% YamlStruct.output_map_series_number = 9998;
% YamlStruct.output_fitparams_series_number = 9999;

% %%% calculation params %%%
% YamlStruct.parameter_to_map = 'T1_MOLLI';
% YamlStruct.fitting_method = 'LevMarVnl';
% YamlStruct.functions_type = 'FunctionsBasic';
% YamlStruct.sign_calc_method= 'NoSign';
% YamlStruct.start_point_calc_method = 'Default';
% YamlStruct.fTolerance = 1.0E-12;
% YamlStruct.max_function_evals = 4000.0;
% YamlStruct.use_gradient = 0;
% YamlStruct.mean_cut_off = 10;
% YamlStruct.number_of_threads = 0;

% %%% visualise params %%%
% YamlStruct.visualise = 1;

%% 2.d. save structure to a yaml file
my_yaml_file = './my_yaml_file.yaml';
yaml.WriteYaml(my_yaml_file, YamlStruct, 0);

%% Run tomato
system([exepath, ' ', my_yaml_file]);

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top