17#ifndef __registration_multi_contrast_h__
18#define __registration_multi_contrast_h__
36 namespace Registration
41 if (!image_name.size())
throw Exception (
"image output path is empty");
43 throw Exception (
"output image \"" + image_name +
"\" already exists (use -force option to force overwrite)");
47 parser.
parse (image_name);
50 H.name() = image_name;
53 for (; *format_handler; format_handler++)
54 if ((*format_handler)->check (
H,
H.ndim() - Pdim.size()))
57 if (!*format_handler) {
59 const size_t extension_index =
basename.find_last_of (
".");
60 if (extension_index == std::string::npos)
61 throw Exception (
"unknown format for image \"" + image_name +
"\" (no file extension specified)");
63 throw Exception (
"unknown format for image \"" + image_name +
"\" (unsupported file extension: " +
basename.substr (extension_index) +
")");
90 assert (new_lmax >= 0);
91 if (new_lmax <
lmax) {
103 o <<
"MultiContrast: [start:" << a.
start <<
", nvols:" << a.
nvols <<
", lmax:" << a.
lmax <<
", image_lmax:" << a.
image_lmax
a class to interpret numbered filenames
void parse(const std::string &imagename, size_t max_num_sequences=std::numeric_limits< size_t >::max())
size_t LforN(int N)
returns the largest lmax given N parameters
size_t NforL(int lmax)
the number of (even-degree) coefficients for the given value of lmax
std::string basename(const std::string &name)
bool exists(const std::string &path)
void preload_data(vector< Header > &input, Image< default_type > &images, const vector< MultiContrastSetting > &mc_params)
std::ostream & operator<<(std::ostream &o, const MultiContrastSetting &a)
FORCE_INLINE void check_image_output(const std::string &image_name, const Header &reference)
double default_type
the default type used throughout MRtrix
MultiContrastSetting(size_t image_nvols, bool do_reorientation=false, ssize_t limit_lmax=std::numeric_limits< ssize_t >::max())
FORCE_INLINE void lower_lmax(ssize_t new_lmax)